From 6a1a5e39980bd4a4e254b370393039cbf8f5df0e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sun, 27 Apr 2025 03:10:36 +0000 Subject: [PATCH] CodeGen from PR 33826 in Azure/azure-rest-api-specs Merge d81add662e807780aeadab10373cc32789cbdaa1 into 3bc34dd26fb32216d923746b8126f147b27dcb6e --- ...ure.ResourceManager.CarbonOptimization.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 80 + ...sourceManager.CarbonOptimization.net8.0.cs | 389 + ...nager.CarbonOptimization.netstandard2.0.cs | 389 + .../assets.json | 7 + ...eManager.CarbonOptimization.Samples.csproj | 13 + .../Sample_TenantResourceExtensions.cs | 575 + ....ResourceManager.CarbonOptimization.csproj | 8 + .../ArmCarbonOptimizationModelFactory.cs | 492 + .../CarbonOptimizationExtensions.cs | 153 + ...ockableCarbonOptimizationTenantResource.cs | 171 + .../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 + .../Generated/Models/AccessDecisionEnum.cs | 51 + .../Models/CarbonEmission.Serialization.cs | 141 + .../src/Generated/Models/CarbonEmission.cs | 94 + ...ionDataAvailableDateRange.Serialization.cs | 134 + .../CarbonEmissionDataAvailableDateRange.cs | 82 + ...bonEmissionDataListResult.Serialization.cs | 172 + .../Models/CarbonEmissionDataListResult.cs | 97 + .../CarbonEmissionItemDetail.Serialization.cs | 166 + .../Models/CarbonEmissionItemDetail.cs | 57 + ...bonEmissionMonthlySummary.Serialization.cs | 166 + .../Models/CarbonEmissionMonthlySummary.cs | 57 + ...bonEmissionOverallSummary.Serialization.cs | 148 + .../Models/CarbonEmissionOverallSummary.cs | 41 + ...sionTopItemMonthlySummary.Serialization.cs | 175 + .../CarbonEmissionTopItemMonthlySummary.cs | 64 + ...onEmissionTopItemsSummary.Serialization.cs | 166 + .../Models/CarbonEmissionTopItemsSummary.cs | 57 + .../src/Generated/Models/CategoryTypeEnum.cs | 60 + .../Models/DateRange.Serialization.cs | 134 + .../src/Generated/Models/DateRange.cs | 78 + .../src/Generated/Models/EmissionScopeEnum.cs | 54 + .../ItemDetailsQueryFilter.Serialization.cs | 239 + .../Models/ItemDetailsQueryFilter.cs | 78 + ...ySummaryReportQueryFilter.Serialization.cs | 191 + .../Models/MonthlySummaryReportQueryFilter.cs | 49 + .../src/Generated/Models/OrderByColumnEnum.cs | 63 + ...lSummaryReportQueryFilter.Serialization.cs | 191 + .../Models/OverallSummaryReportQueryFilter.cs | 49 + .../Models/QueryFilter.Serialization.cs | 167 + .../src/Generated/Models/QueryFilter.cs | 113 + .../src/Generated/Models/ReportTypeEnum.cs | 60 + ...eCarbonEmissionItemDetail.Serialization.cs | 217 + .../ResourceCarbonEmissionItemDetail.cs | 86 + ...sionTopItemMonthlySummary.Serialization.cs | 202 + ...urceCarbonEmissionTopItemMonthlySummary.cs | 85 + ...onEmissionTopItemsSummary.Serialization.cs | 193 + .../ResourceCarbonEmissionTopItemsSummary.cs | 78 + ...pCarbonEmissionItemDetail.Serialization.cs | 184 + .../ResourceGroupCarbonEmissionItemDetail.cs | 71 + ...sionTopItemMonthlySummary.Serialization.cs | 193 + ...roupCarbonEmissionTopItemMonthlySummary.cs | 78 + ...onEmissionTopItemsSummary.Serialization.cs | 184 + ...ourceGroupCarbonEmissionTopItemsSummary.cs | 71 + .../Generated/Models/ResponseDataTypeEnum.cs | 78 + .../src/Generated/Models/SortDirectionEnum.cs | 51 + ...ubscriptionAccessDecision.Serialization.cs | 145 + .../Models/SubscriptionAccessDecision.cs | 85 + ...ySummaryReportQueryFilter.Serialization.cs | 209 + ...TopItemsMonthlySummaryReportQueryFilter.cs | 62 + ...sSummaryReportQueryFilter.Serialization.cs | 209 + .../TopItemsSummaryReportQueryFilter.cs | 62 + .../UnknownCarbonEmission.Serialization.cs | 148 + .../Generated/Models/UnknownCarbonEmission.cs | 33 + .../UnknownQueryFilter.Serialization.cs | 191 + .../Generated/Models/UnknownQueryFilter.cs | 35 + .../src/Generated/ProviderConstants.cs | 16 + .../CarbonServiceRestOperations.cs | 179 + .../src/Properties/AssemblyInfo.cs | 11 + ...rceManager.CarbonOptimization.Tests.csproj | 8 + .../CarbonOptimizationManagementTestBase.cs | 45 + ...onOptimizationManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 4 + sdk/carbonoptimization/ci.mgmt.yml | 26 + .../Azure.ResourceManager.DependencyMap.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 80 + ...re.ResourceManager.DependencyMap.net8.0.cs | 337 + ...rceManager.DependencyMap.netstandard2.0.cs | 337 + .../assets.json | 7 + ...sourceManager.DependencyMap.Samples.csproj | 13 + .../Samples/Sample_DiscoverySourceResource.cs | 113 + ...ample_DiscoverySourceResourceCollection.cs | 199 + .../Generated/Samples/Sample_MapsResource.cs | 262 + .../Samples/Sample_MapsResourceCollection.cs | 195 + .../Sample_SubscriptionResourceExtensions.cs | 50 + ...Azure.ResourceManager.DependencyMap.csproj | 8 + .../Generated/ArmDependencyMapModelFactory.cs | 128 + .../DiscoverySourceResource.Serialization.cs | 26 + .../src/Generated/DiscoverySourceResource.cs | 707 + .../DiscoverySourceResourceCollection.cs | 493 + ...scoverySourceResourceData.Serialization.cs | 178 + .../Generated/DiscoverySourceResourceData.cs | 91 + .../Extensions/DependencyMapExtensions.cs | 238 + .../MockableDependencyMapArmClient.cs | 61 + ...kableDependencyMapResourceGroupResource.cs | 105 + ...ckableDependencyMapSubscriptionResource.cs | 102 + .../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 + .../DependencyMapArmOperation.cs | 94 + .../DependencyMapArmOperationOfT.cs | 100 + .../DiscoverySourceResourceOperationSource.cs | 36 + .../MapsResourceOperationSource.cs | 36 + .../Generated/MapsResource.Serialization.cs | 26 + .../src/Generated/MapsResource.cs | 1144 + .../src/Generated/MapsResourceCollection.cs | 494 + .../MapsResourceData.Serialization.cs | 178 + .../src/Generated/MapsResourceData.cs | 88 + .../Models/DateTimeFilter.Serialization.cs | 148 + .../src/Generated/Models/DateTimeFilter.cs | 69 + ...ncyMapVisualizationFilter.Serialization.cs | 148 + .../DependencyMapVisualizationFilter.cs | 69 + ...ySourceResourceListResult.Serialization.cs | 151 + .../DiscoverySourceResourceListResult.cs | 80 + ...coverySourceResourcePatch.Serialization.cs | 144 + .../Models/DiscoverySourceResourcePatch.cs | 66 + ...ySourceResourceProperties.Serialization.cs | 124 + .../DiscoverySourceResourceProperties.cs | 87 + ...ExportDependenciesContent.Serialization.cs | 141 + .../Models/ExportDependenciesContent.cs | 79 + ...ssOnFocusedMachineContent.Serialization.cs | 149 + ...ctionsForProcessOnFocusedMachineContent.cs | 86 + ...eForFocusedMachineContent.Serialization.cs | 149 + ...onnectedMachineForFocusedMachineContent.cs | 86 + ...wForFocusedMachineContent.Serialization.cs | 141 + ...tDependencyViewForFocusedMachineContent.cs | 79 + .../MapsResourceListResult.Serialization.cs | 151 + .../Models/MapsResourceListResult.cs | 80 + .../Models/MapsResourcePatch.Serialization.cs | 144 + .../src/Generated/Models/MapsResourcePatch.cs | 66 + .../MapsResourceProperties.Serialization.cs | 133 + .../Models/MapsResourceProperties.cs | 65 + ...ySourceResourceProperties.Serialization.cs | 126 + ...fAzureDiscoverySourceResourceProperties.cs | 41 + .../Models/ProcessNameFilter.Serialization.cs | 144 + .../src/Generated/Models/ProcessNameFilter.cs | 82 + .../Models/ProcessNameFilterOperator.cs | 51 + .../src/Generated/Models/ProvisioningState.cs | 66 + .../src/Generated/Models/SourceType.cs | 48 + ...ySourceResourceProperties.Serialization.cs | 126 + ...nknownDiscoverySourceResourceProperties.cs | 31 + .../src/Generated/ProviderConstants.cs | 16 + .../DiscoverySourcesRestOperations.cs | 613 + .../RestOperations/MapsRestOperations.cs | 1091 + .../src/Properties/AssemblyInfo.cs | 11 + ...ResourceManager.DependencyMap.Tests.csproj | 8 + .../tests/DependencyMapManagementTestBase.cs | 45 + .../DependencyMapManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 4 + sdk/dependencymap/ci.mgmt.yml | 26 + sdk/durabletask/ci.mgmt.yml | 1 - ...aTestHyperExecuteOrganizationCollection.cs | 12 +- ...bdaTestHyperExecuteOrganizationResource.cs | 6 +- .../Sample_SubscriptionResourceExtensions.cs | 4 +- .../LambdaTestHyperExecuteExtensions.cs | 8 +- ...daTestHyperExecuteResourceGroupResource.cs | 4 +- ...bdaTestHyperExecuteSubscriptionResource.cs | 4 +- ...aTestHyperExecuteOrganizationCollection.cs | 20 +- ...bdaTestHyperExecuteOrganizationResource.cs | 24 +- .../OrganizationsRestOperations.cs | 2 +- .../tsp-location.yaml | 5 +- ....ResourceManager.OnlineExperimentation.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 80 + ...rceManager.OnlineExperimentation.net8.0.cs | 228 + ...er.OnlineExperimentation.netstandard2.0.cs | 228 + .../assets.json | 7 + ...nager.OnlineExperimentation.Samples.csproj | 13 + ...ple_OnlineExperimentWorkspaceCollection.cs | 272 + ...ample_OnlineExperimentWorkspaceResource.cs | 180 + .../Sample_SubscriptionResourceExtensions.cs | 50 + ...sourceManager.OnlineExperimentation.csproj | 8 + .../ArmOnlineExperimentationModelFactory.cs | 78 + .../MockableOnlineExperimentationArmClient.cs | 49 + ...ineExperimentationResourceGroupResource.cs | 105 + ...lineExperimentationSubscriptionResource.cs | 102 + .../OnlineExperimentationExtensions.cs | 219 + .../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 + ...nlineExperimentWorkspaceOperationSource.cs | 36 + .../OnlineExperimentationArmOperation.cs | 94 + .../OnlineExperimentationArmOperationOfT.cs | 100 + ...tomerManagedKeyEncryption.Serialization.cs | 148 + .../Models/CustomerManagedKeyEncryption.cs | 69 + .../KeyEncryptionKeyIdentity.Serialization.cs | 163 + .../Models/KeyEncryptionKeyIdentity.cs | 74 + .../Models/KeyEncryptionKeyIdentityType.cs | 51 + ...rimentWorkspaceListResult.Serialization.cs | 151 + .../OnlineExperimentWorkspaceListResult.cs | 80 + ...rimentWorkspaceProperties.Serialization.cs | 206 + .../OnlineExperimentWorkspaceProperties.cs | 118 + ...perimentationWorkspaceSku.Serialization.cs | 141 + .../OnlineExperimentationWorkspaceSku.cs | 76 + .../OnlineExperimentationWorkspaceSkuName.cs | 57 + .../OnlineExperimentationWorkspaceSkuTier.cs | 57 + ...ceEncryptionConfiguration.Serialization.cs | 133 + .../Models/ResourceEncryptionConfiguration.cs | 65 + .../Models/ResourceProvisioningState.cs | 54 + .../OnlineExperimentWorkspaceCollection.cs | 494 + ...neExperimentWorkspaceData.Serialization.cs | 212 + .../OnlineExperimentWorkspaceData.cs | 91 + ...perimentWorkspaceResource.Serialization.cs | 26 + .../OnlineExperimentWorkspaceResource.cs | 706 + .../src/Generated/ProviderConstants.cs | 16 + ...nlineExperimentWorkspacesRestOperations.cs | 723 + .../src/Properties/AssemblyInfo.cs | 11 + ...Manager.OnlineExperimentation.Tests.csproj | 8 + ...OnlineExperimentationManagementTestBase.cs | 45 + ...xperimentationManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 4 + sdk/onlineexperimentation/ci.mgmt.yml | 26 + sdk/pineconevectordb/ci.yml | 35 - sdk/resourcemanager/ci.mgmt.yml | 8 + .../Configuration.json | 12 + .../tsp-location.yaml | 3 +- .../tspCodeModel.json | 16451 ++++++++++++++ .../Configuration.json | 12 + .../tsp-location.yaml | 5 +- .../tspCodeModel.json | 18304 ++++++++++++++++ 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 + 516 files changed, 106646 insertions(+), 83 deletions(-) create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/Azure.ResourceManager.CarbonOptimization.sln create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/CHANGELOG.md create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/Directory.Build.props create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/README.md create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/api/Azure.ResourceManager.CarbonOptimization.net8.0.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/api/Azure.ResourceManager.CarbonOptimization.netstandard2.0.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/assets.json create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/samples/Azure.ResourceManager.CarbonOptimization.Samples.csproj create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/samples/Generated/Samples/Sample_TenantResourceExtensions.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Azure.ResourceManager.CarbonOptimization.csproj create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/ArmCarbonOptimizationModelFactory.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Extensions/CarbonOptimizationExtensions.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Extensions/MockableCarbonOptimizationTenantResource.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/Argument.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/Optional.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/AccessDecisionEnum.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmission.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmission.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataAvailableDateRange.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataAvailableDateRange.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataListResult.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataListResult.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionItemDetail.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionItemDetail.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionMonthlySummary.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionMonthlySummary.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionOverallSummary.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionOverallSummary.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemMonthlySummary.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemMonthlySummary.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemsSummary.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemsSummary.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CategoryTypeEnum.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/DateRange.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/DateRange.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/EmissionScopeEnum.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ItemDetailsQueryFilter.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ItemDetailsQueryFilter.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/MonthlySummaryReportQueryFilter.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/MonthlySummaryReportQueryFilter.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/OrderByColumnEnum.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/OverallSummaryReportQueryFilter.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/OverallSummaryReportQueryFilter.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/QueryFilter.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/QueryFilter.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ReportTypeEnum.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionItemDetail.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionItemDetail.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemMonthlySummary.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemMonthlySummary.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemsSummary.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemsSummary.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionItemDetail.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionItemDetail.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemMonthlySummary.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemMonthlySummary.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemsSummary.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemsSummary.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResponseDataTypeEnum.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/SortDirectionEnum.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/SubscriptionAccessDecision.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/SubscriptionAccessDecision.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsMonthlySummaryReportQueryFilter.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsMonthlySummaryReportQueryFilter.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsSummaryReportQueryFilter.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsSummaryReportQueryFilter.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownCarbonEmission.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownCarbonEmission.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownQueryFilter.Serialization.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownQueryFilter.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/ProviderConstants.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/RestOperations/CarbonServiceRestOperations.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Properties/AssemblyInfo.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tests/Azure.ResourceManager.CarbonOptimization.Tests.csproj create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tests/CarbonOptimizationManagementTestBase.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tests/CarbonOptimizationManagementTestEnvironment.cs create mode 100644 sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tsp-location.yaml create mode 100644 sdk/carbonoptimization/ci.mgmt.yml create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/Azure.ResourceManager.DependencyMap.sln create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/CHANGELOG.md create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/Directory.Build.props create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/README.md create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/api/Azure.ResourceManager.DependencyMap.net8.0.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/api/Azure.ResourceManager.DependencyMap.netstandard2.0.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/assets.json create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Azure.ResourceManager.DependencyMap.Samples.csproj create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_DiscoverySourceResource.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_DiscoverySourceResourceCollection.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_MapsResource.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_MapsResourceCollection.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Azure.ResourceManager.DependencyMap.csproj create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/ArmDependencyMapModelFactory.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResource.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResource.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResourceCollection.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResourceData.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResourceData.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/DependencyMapExtensions.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/MockableDependencyMapArmClient.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/MockableDependencyMapResourceGroupResource.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/MockableDependencyMapSubscriptionResource.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/Argument.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/Optional.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/DependencyMapArmOperation.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/DependencyMapArmOperationOfT.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/DiscoverySourceResourceOperationSource.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/MapsResourceOperationSource.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResource.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResource.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResourceCollection.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResourceData.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResourceData.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DateTimeFilter.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DateTimeFilter.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DependencyMapVisualizationFilter.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DependencyMapVisualizationFilter.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceListResult.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceListResult.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourcePatch.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourcePatch.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceProperties.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceProperties.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ExportDependenciesContent.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ExportDependenciesContent.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsForProcessOnFocusedMachineContent.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsForProcessOnFocusedMachineContent.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsWithConnectedMachineForFocusedMachineContent.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsWithConnectedMachineForFocusedMachineContent.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetDependencyViewForFocusedMachineContent.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetDependencyViewForFocusedMachineContent.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceListResult.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceListResult.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourcePatch.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourcePatch.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceProperties.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceProperties.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/OffAzureDiscoverySourceResourceProperties.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/OffAzureDiscoverySourceResourceProperties.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProcessNameFilter.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProcessNameFilter.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProcessNameFilterOperator.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProvisioningState.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/SourceType.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/UnknownDiscoverySourceResourceProperties.Serialization.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/UnknownDiscoverySourceResourceProperties.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/ProviderConstants.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/RestOperations/DiscoverySourcesRestOperations.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/RestOperations/MapsRestOperations.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Properties/AssemblyInfo.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/tests/Azure.ResourceManager.DependencyMap.Tests.csproj create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/tests/DependencyMapManagementTestBase.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/tests/DependencyMapManagementTestEnvironment.cs create mode 100644 sdk/dependencymap/Azure.ResourceManager.DependencyMap/tsp-location.yaml create mode 100644 sdk/dependencymap/ci.mgmt.yml create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/Azure.ResourceManager.OnlineExperimentation.sln create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/CHANGELOG.md create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/Directory.Build.props create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/README.md create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/api/Azure.ResourceManager.OnlineExperimentation.net8.0.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/api/Azure.ResourceManager.OnlineExperimentation.netstandard2.0.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/assets.json create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Azure.ResourceManager.OnlineExperimentation.Samples.csproj create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Generated/Samples/Sample_OnlineExperimentWorkspaceCollection.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Generated/Samples/Sample_OnlineExperimentWorkspaceResource.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Azure.ResourceManager.OnlineExperimentation.csproj create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/ArmOnlineExperimentationModelFactory.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/MockableOnlineExperimentationArmClient.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/MockableOnlineExperimentationResourceGroupResource.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/MockableOnlineExperimentationSubscriptionResource.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/OnlineExperimentationExtensions.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/Argument.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/Optional.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/LongRunningOperation/OnlineExperimentWorkspaceOperationSource.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/LongRunningOperation/OnlineExperimentationArmOperation.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/LongRunningOperation/OnlineExperimentationArmOperationOfT.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/CustomerManagedKeyEncryption.Serialization.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/CustomerManagedKeyEncryption.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/KeyEncryptionKeyIdentity.Serialization.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/KeyEncryptionKeyIdentity.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/KeyEncryptionKeyIdentityType.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceListResult.Serialization.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceListResult.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceProperties.Serialization.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceProperties.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSku.Serialization.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSku.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSkuName.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSkuTier.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/ResourceEncryptionConfiguration.Serialization.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/ResourceEncryptionConfiguration.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/ResourceProvisioningState.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceCollection.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceData.Serialization.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceData.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceResource.Serialization.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceResource.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/ProviderConstants.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/RestOperations/OnlineExperimentWorkspacesRestOperations.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Properties/AssemblyInfo.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tests/Azure.ResourceManager.OnlineExperimentation.Tests.csproj create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tests/OnlineExperimentationManagementTestBase.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tests/OnlineExperimentationManagementTestEnvironment.cs create mode 100644 sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tsp-location.yaml create mode 100644 sdk/onlineexperimentation/ci.mgmt.yml delete mode 100644 sdk/pineconevectordb/ci.yml create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/Configuration.json create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/tspCodeModel.json create mode 100644 sdk/standbypool/Azure.ResourceManager.StandbyPool/Configuration.json create mode 100644 sdk/standbypool/Azure.ResourceManager.StandbyPool/tspCodeModel.json 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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/Azure.ResourceManager.CarbonOptimization.sln b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/Azure.ResourceManager.CarbonOptimization.sln new file mode 100644 index 000000000000..3a8d474164cf --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/Azure.ResourceManager.CarbonOptimization.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.CarbonOptimization.Samples", "samples\Azure.ResourceManager.CarbonOptimization.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.CarbonOptimization", "src\Azure.ResourceManager.CarbonOptimization.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.CarbonOptimization.Tests", "tests\Azure.ResourceManager.CarbonOptimization.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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/CHANGELOG.md b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/Directory.Build.props b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/README.md b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/README.md new file mode 100644 index 000000000000..3b923fdb5722 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure CarbonOptimization 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 CarbonOptimization management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.CarbonOptimization --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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/api/Azure.ResourceManager.CarbonOptimization.net8.0.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/api/Azure.ResourceManager.CarbonOptimization.net8.0.cs new file mode 100644 index 000000000000..1549b5eee98b --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/api/Azure.ResourceManager.CarbonOptimization.net8.0.cs @@ -0,0 +1,389 @@ +namespace Azure.ResourceManager.CarbonOptimization +{ + public static partial class CarbonOptimizationExtensions + { + public static Azure.Response QueryCarbonEmissionDataAvailableDateRangeCarbonService(this Azure.ResourceManager.Resources.TenantResource tenantResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> QueryCarbonEmissionDataAvailableDateRangeCarbonServiceAsync(this Azure.ResourceManager.Resources.TenantResource tenantResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable QueryCarbonEmissionReportsCarbonServices(this Azure.ResourceManager.Resources.TenantResource tenantResource, Azure.ResourceManager.CarbonOptimization.Models.QueryFilter queryParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable QueryCarbonEmissionReportsCarbonServicesAsync(this Azure.ResourceManager.Resources.TenantResource tenantResource, Azure.ResourceManager.CarbonOptimization.Models.QueryFilter queryParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.CarbonOptimization.Mocking +{ + public partial class MockableCarbonOptimizationTenantResource : Azure.ResourceManager.ArmResource + { + protected MockableCarbonOptimizationTenantResource() { } + public virtual Azure.Response QueryCarbonEmissionDataAvailableDateRangeCarbonService(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> QueryCarbonEmissionDataAvailableDateRangeCarbonServiceAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable QueryCarbonEmissionReportsCarbonServices(Azure.ResourceManager.CarbonOptimization.Models.QueryFilter queryParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable QueryCarbonEmissionReportsCarbonServicesAsync(Azure.ResourceManager.CarbonOptimization.Models.QueryFilter queryParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + public static partial class ArmCarbonOptimizationModelFactory + { + public static Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission CarbonEmission(string dataType = null, double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?)) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionDataAvailableDateRange CarbonEmissionDataAvailableDateRange(string startDate = null, string endDate = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionItemDetail CarbonEmissionItemDetail(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum)) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionMonthlySummary CarbonEmissionMonthlySummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string date = null, double carbonIntensity = 0) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionOverallSummary CarbonEmissionOverallSummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?)) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionTopItemMonthlySummary CarbonEmissionTopItemMonthlySummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), string date = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionTopItemsSummary CarbonEmissionTopItemsSummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum)) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.ItemDetailsQueryFilter ItemDetailsQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange = null, System.Collections.Generic.IEnumerable subscriptionList = null, System.Collections.Generic.IEnumerable resourceGroupUrlList = null, System.Collections.Generic.IEnumerable resourceTypeList = null, System.Collections.Generic.IEnumerable locationList = null, System.Collections.Generic.IEnumerable carbonScopeList = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum orderBy = default(Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum), Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum sortDirection = default(Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum), int pageSize = 0, string skipToken = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.MonthlySummaryReportQueryFilter MonthlySummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange = null, System.Collections.Generic.IEnumerable subscriptionList = null, System.Collections.Generic.IEnumerable resourceGroupUrlList = null, System.Collections.Generic.IEnumerable resourceTypeList = null, System.Collections.Generic.IEnumerable locationList = null, System.Collections.Generic.IEnumerable carbonScopeList = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.OverallSummaryReportQueryFilter OverallSummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange = null, System.Collections.Generic.IEnumerable subscriptionList = null, System.Collections.Generic.IEnumerable resourceGroupUrlList = null, System.Collections.Generic.IEnumerable resourceTypeList = null, System.Collections.Generic.IEnumerable locationList = null, System.Collections.Generic.IEnumerable carbonScopeList = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.QueryFilter QueryFilter(string reportType = null, Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange = null, System.Collections.Generic.IEnumerable subscriptionList = null, System.Collections.Generic.IEnumerable resourceGroupUrlList = null, System.Collections.Generic.IEnumerable resourceTypeList = null, System.Collections.Generic.IEnumerable locationList = null, System.Collections.Generic.IEnumerable carbonScopeList = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionItemDetail ResourceCarbonEmissionItemDetail(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), string subscriptionId = null, string resourceGroup = null, string resourceId = null, string location = null, string resourceType = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionTopItemMonthlySummary ResourceCarbonEmissionTopItemMonthlySummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), string date = null, string subscriptionId = null, string resourceGroup = null, string resourceId = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionTopItemsSummary ResourceCarbonEmissionTopItemsSummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), string subscriptionId = null, string resourceGroup = null, string resourceId = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionItemDetail ResourceGroupCarbonEmissionItemDetail(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), string subscriptionId = null, string resourceGroupUri = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionTopItemMonthlySummary ResourceGroupCarbonEmissionTopItemMonthlySummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), string date = null, string subscriptionId = null, string resourceGroupUri = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionTopItemsSummary ResourceGroupCarbonEmissionTopItemsSummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), string subscriptionId = null, string resourceGroupUri = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.TopItemsMonthlySummaryReportQueryFilter TopItemsMonthlySummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange = null, System.Collections.Generic.IEnumerable subscriptionList = null, System.Collections.Generic.IEnumerable resourceGroupUrlList = null, System.Collections.Generic.IEnumerable resourceTypeList = null, System.Collections.Generic.IEnumerable locationList = null, System.Collections.Generic.IEnumerable carbonScopeList = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), int topItems = 0) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.TopItemsSummaryReportQueryFilter TopItemsSummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange = null, System.Collections.Generic.IEnumerable subscriptionList = null, System.Collections.Generic.IEnumerable resourceGroupUrlList = null, System.Collections.Generic.IEnumerable resourceTypeList = null, System.Collections.Generic.IEnumerable locationList = null, System.Collections.Generic.IEnumerable carbonScopeList = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), int topItems = 0) { throw null; } + } + public abstract partial class CarbonEmission : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected CarbonEmission(double latestMonthEmissions, double previousMonthEmissions) { } + public double LatestMonthEmissions { get { throw null; } } + public double? MonthlyEmissionsChangeValue { get { throw null; } } + public double? MonthOverMonthEmissionsChangeRatio { get { throw null; } } + public double PreviousMonthEmissions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CarbonEmissionDataAvailableDateRange : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CarbonEmissionDataAvailableDateRange() { } + public string EndDate { get { throw null; } } + public string StartDate { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionDataAvailableDateRange System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionDataAvailableDateRange System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CarbonEmissionItemDetail : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CarbonEmissionItemDetail() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string ItemName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionItemDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionItemDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CarbonEmissionMonthlySummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CarbonEmissionMonthlySummary() : base (default(double), default(double)) { } + public double CarbonIntensity { get { throw null; } } + public string Date { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionMonthlySummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionMonthlySummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CarbonEmissionOverallSummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CarbonEmissionOverallSummary() : base (default(double), default(double)) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionOverallSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionOverallSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CarbonEmissionTopItemMonthlySummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CarbonEmissionTopItemMonthlySummary() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string Date { get { throw null; } } + public string ItemName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionTopItemMonthlySummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionTopItemMonthlySummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CarbonEmissionTopItemsSummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CarbonEmissionTopItemsSummary() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string ItemName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionTopItemsSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionTopItemsSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 CategoryTypeEnum : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CategoryTypeEnum(string value) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum Location { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum Resource { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum ResourceGroup { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum ResourceType { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum Subscription { get { throw null; } } + public bool Equals(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum 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.CarbonOptimization.Models.CategoryTypeEnum left, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum right) { throw null; } + public static implicit operator Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum left, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DateRange : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DateRange(System.DateTimeOffset start, System.DateTimeOffset end) { } + public System.DateTimeOffset End { get { throw null; } } + public System.DateTimeOffset Start { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.DateRange System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.DateRange System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 EmissionScopeEnum : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EmissionScopeEnum(string value) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum Scope1 { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum Scope2 { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum Scope3 { get { throw null; } } + public bool Equals(Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum 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.CarbonOptimization.Models.EmissionScopeEnum left, Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum right) { throw null; } + public static implicit operator Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum left, Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ItemDetailsQueryFilter : Azure.ResourceManager.CarbonOptimization.Models.QueryFilter, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ItemDetailsQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange, System.Collections.Generic.IEnumerable subscriptionList, System.Collections.Generic.IEnumerable carbonScopeList, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType, Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum orderBy, Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum sortDirection, int pageSize) : base (default(Azure.ResourceManager.CarbonOptimization.Models.DateRange), default(System.Collections.Generic.IEnumerable), default(System.Collections.Generic.IEnumerable)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum OrderBy { get { throw null; } } + public int PageSize { get { throw null; } } + public string SkipToken { get { throw null; } set { } } + public Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum SortDirection { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ItemDetailsQueryFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ItemDetailsQueryFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonthlySummaryReportQueryFilter : Azure.ResourceManager.CarbonOptimization.Models.QueryFilter, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonthlySummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange, System.Collections.Generic.IEnumerable subscriptionList, System.Collections.Generic.IEnumerable carbonScopeList) : base (default(Azure.ResourceManager.CarbonOptimization.Models.DateRange), default(System.Collections.Generic.IEnumerable), default(System.Collections.Generic.IEnumerable)) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.MonthlySummaryReportQueryFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.MonthlySummaryReportQueryFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 OrderByColumnEnum : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OrderByColumnEnum(string value) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum ItemName { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum LatestMonthEmissions { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum MonthlyEmissionsChangeValue { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum MonthOverMonthEmissionsChangeRatio { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum PreviousMonthEmissions { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum ResourceGroup { get { throw null; } } + public bool Equals(Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum 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.CarbonOptimization.Models.OrderByColumnEnum left, Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum right) { throw null; } + public static implicit operator Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum left, Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OverallSummaryReportQueryFilter : Azure.ResourceManager.CarbonOptimization.Models.QueryFilter, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OverallSummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange, System.Collections.Generic.IEnumerable subscriptionList, System.Collections.Generic.IEnumerable carbonScopeList) : base (default(Azure.ResourceManager.CarbonOptimization.Models.DateRange), default(System.Collections.Generic.IEnumerable), default(System.Collections.Generic.IEnumerable)) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.OverallSummaryReportQueryFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.OverallSummaryReportQueryFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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 QueryFilter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected QueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange, System.Collections.Generic.IEnumerable subscriptionList, System.Collections.Generic.IEnumerable carbonScopeList) { } + public System.Collections.Generic.IList CarbonScopeList { get { throw null; } } + public Azure.ResourceManager.CarbonOptimization.Models.DateRange DateRange { get { throw null; } } + public System.Collections.Generic.IList LocationList { get { throw null; } } + public System.Collections.Generic.IList ResourceGroupUrlList { get { throw null; } } + public System.Collections.Generic.IList ResourceTypeList { get { throw null; } } + public System.Collections.Generic.IList SubscriptionList { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.QueryFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.QueryFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceCarbonEmissionItemDetail : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceCarbonEmissionItemDetail() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string ItemName { get { throw null; } } + public string Location { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceId { get { throw null; } } + public string ResourceType { get { throw null; } } + public string SubscriptionId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionItemDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionItemDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceCarbonEmissionTopItemMonthlySummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceCarbonEmissionTopItemMonthlySummary() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string Date { get { throw null; } } + public string ItemName { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceId { get { throw null; } } + public string SubscriptionId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionTopItemMonthlySummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionTopItemMonthlySummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceCarbonEmissionTopItemsSummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceCarbonEmissionTopItemsSummary() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string ItemName { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceId { get { throw null; } } + public string SubscriptionId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionTopItemsSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionTopItemsSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceGroupCarbonEmissionItemDetail : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceGroupCarbonEmissionItemDetail() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string ItemName { get { throw null; } } + public string ResourceGroupUri { get { throw null; } } + public string SubscriptionId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionItemDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionItemDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceGroupCarbonEmissionTopItemMonthlySummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceGroupCarbonEmissionTopItemMonthlySummary() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string Date { get { throw null; } } + public string ItemName { get { throw null; } } + public string ResourceGroupUri { get { throw null; } } + public string SubscriptionId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionTopItemMonthlySummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionTopItemMonthlySummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceGroupCarbonEmissionTopItemsSummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceGroupCarbonEmissionTopItemsSummary() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string ItemName { get { throw null; } } + public string ResourceGroupUri { get { throw null; } } + public string SubscriptionId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionTopItemsSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionTopItemsSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 SortDirectionEnum : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SortDirectionEnum(string value) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum Asc { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum Desc { get { throw null; } } + public bool Equals(Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum 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.CarbonOptimization.Models.SortDirectionEnum left, Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum right) { throw null; } + public static implicit operator Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum left, Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TopItemsMonthlySummaryReportQueryFilter : Azure.ResourceManager.CarbonOptimization.Models.QueryFilter, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TopItemsMonthlySummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange, System.Collections.Generic.IEnumerable subscriptionList, System.Collections.Generic.IEnumerable carbonScopeList, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType, int topItems) : base (default(Azure.ResourceManager.CarbonOptimization.Models.DateRange), default(System.Collections.Generic.IEnumerable), default(System.Collections.Generic.IEnumerable)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public int TopItems { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.TopItemsMonthlySummaryReportQueryFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.TopItemsMonthlySummaryReportQueryFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TopItemsSummaryReportQueryFilter : Azure.ResourceManager.CarbonOptimization.Models.QueryFilter, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TopItemsSummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange, System.Collections.Generic.IEnumerable subscriptionList, System.Collections.Generic.IEnumerable carbonScopeList, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType, int topItems) : base (default(Azure.ResourceManager.CarbonOptimization.Models.DateRange), default(System.Collections.Generic.IEnumerable), default(System.Collections.Generic.IEnumerable)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public int TopItems { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.TopItemsSummaryReportQueryFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.TopItemsSummaryReportQueryFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/api/Azure.ResourceManager.CarbonOptimization.netstandard2.0.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/api/Azure.ResourceManager.CarbonOptimization.netstandard2.0.cs new file mode 100644 index 000000000000..1549b5eee98b --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/api/Azure.ResourceManager.CarbonOptimization.netstandard2.0.cs @@ -0,0 +1,389 @@ +namespace Azure.ResourceManager.CarbonOptimization +{ + public static partial class CarbonOptimizationExtensions + { + public static Azure.Response QueryCarbonEmissionDataAvailableDateRangeCarbonService(this Azure.ResourceManager.Resources.TenantResource tenantResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> QueryCarbonEmissionDataAvailableDateRangeCarbonServiceAsync(this Azure.ResourceManager.Resources.TenantResource tenantResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable QueryCarbonEmissionReportsCarbonServices(this Azure.ResourceManager.Resources.TenantResource tenantResource, Azure.ResourceManager.CarbonOptimization.Models.QueryFilter queryParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable QueryCarbonEmissionReportsCarbonServicesAsync(this Azure.ResourceManager.Resources.TenantResource tenantResource, Azure.ResourceManager.CarbonOptimization.Models.QueryFilter queryParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.CarbonOptimization.Mocking +{ + public partial class MockableCarbonOptimizationTenantResource : Azure.ResourceManager.ArmResource + { + protected MockableCarbonOptimizationTenantResource() { } + public virtual Azure.Response QueryCarbonEmissionDataAvailableDateRangeCarbonService(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> QueryCarbonEmissionDataAvailableDateRangeCarbonServiceAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable QueryCarbonEmissionReportsCarbonServices(Azure.ResourceManager.CarbonOptimization.Models.QueryFilter queryParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable QueryCarbonEmissionReportsCarbonServicesAsync(Azure.ResourceManager.CarbonOptimization.Models.QueryFilter queryParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + public static partial class ArmCarbonOptimizationModelFactory + { + public static Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission CarbonEmission(string dataType = null, double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?)) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionDataAvailableDateRange CarbonEmissionDataAvailableDateRange(string startDate = null, string endDate = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionItemDetail CarbonEmissionItemDetail(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum)) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionMonthlySummary CarbonEmissionMonthlySummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string date = null, double carbonIntensity = 0) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionOverallSummary CarbonEmissionOverallSummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?)) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionTopItemMonthlySummary CarbonEmissionTopItemMonthlySummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), string date = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionTopItemsSummary CarbonEmissionTopItemsSummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum)) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.ItemDetailsQueryFilter ItemDetailsQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange = null, System.Collections.Generic.IEnumerable subscriptionList = null, System.Collections.Generic.IEnumerable resourceGroupUrlList = null, System.Collections.Generic.IEnumerable resourceTypeList = null, System.Collections.Generic.IEnumerable locationList = null, System.Collections.Generic.IEnumerable carbonScopeList = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum orderBy = default(Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum), Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum sortDirection = default(Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum), int pageSize = 0, string skipToken = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.MonthlySummaryReportQueryFilter MonthlySummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange = null, System.Collections.Generic.IEnumerable subscriptionList = null, System.Collections.Generic.IEnumerable resourceGroupUrlList = null, System.Collections.Generic.IEnumerable resourceTypeList = null, System.Collections.Generic.IEnumerable locationList = null, System.Collections.Generic.IEnumerable carbonScopeList = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.OverallSummaryReportQueryFilter OverallSummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange = null, System.Collections.Generic.IEnumerable subscriptionList = null, System.Collections.Generic.IEnumerable resourceGroupUrlList = null, System.Collections.Generic.IEnumerable resourceTypeList = null, System.Collections.Generic.IEnumerable locationList = null, System.Collections.Generic.IEnumerable carbonScopeList = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.QueryFilter QueryFilter(string reportType = null, Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange = null, System.Collections.Generic.IEnumerable subscriptionList = null, System.Collections.Generic.IEnumerable resourceGroupUrlList = null, System.Collections.Generic.IEnumerable resourceTypeList = null, System.Collections.Generic.IEnumerable locationList = null, System.Collections.Generic.IEnumerable carbonScopeList = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionItemDetail ResourceCarbonEmissionItemDetail(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), string subscriptionId = null, string resourceGroup = null, string resourceId = null, string location = null, string resourceType = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionTopItemMonthlySummary ResourceCarbonEmissionTopItemMonthlySummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), string date = null, string subscriptionId = null, string resourceGroup = null, string resourceId = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionTopItemsSummary ResourceCarbonEmissionTopItemsSummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), string subscriptionId = null, string resourceGroup = null, string resourceId = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionItemDetail ResourceGroupCarbonEmissionItemDetail(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), string subscriptionId = null, string resourceGroupUri = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionTopItemMonthlySummary ResourceGroupCarbonEmissionTopItemMonthlySummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), string date = null, string subscriptionId = null, string resourceGroupUri = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionTopItemsSummary ResourceGroupCarbonEmissionTopItemsSummary(double latestMonthEmissions = 0, double previousMonthEmissions = 0, double? monthOverMonthEmissionsChangeRatio = default(double?), double? monthlyEmissionsChangeValue = default(double?), string itemName = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), string subscriptionId = null, string resourceGroupUri = null) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.TopItemsMonthlySummaryReportQueryFilter TopItemsMonthlySummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange = null, System.Collections.Generic.IEnumerable subscriptionList = null, System.Collections.Generic.IEnumerable resourceGroupUrlList = null, System.Collections.Generic.IEnumerable resourceTypeList = null, System.Collections.Generic.IEnumerable locationList = null, System.Collections.Generic.IEnumerable carbonScopeList = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), int topItems = 0) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.TopItemsSummaryReportQueryFilter TopItemsSummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange = null, System.Collections.Generic.IEnumerable subscriptionList = null, System.Collections.Generic.IEnumerable resourceGroupUrlList = null, System.Collections.Generic.IEnumerable resourceTypeList = null, System.Collections.Generic.IEnumerable locationList = null, System.Collections.Generic.IEnumerable carbonScopeList = null, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType = default(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum), int topItems = 0) { throw null; } + } + public abstract partial class CarbonEmission : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected CarbonEmission(double latestMonthEmissions, double previousMonthEmissions) { } + public double LatestMonthEmissions { get { throw null; } } + public double? MonthlyEmissionsChangeValue { get { throw null; } } + public double? MonthOverMonthEmissionsChangeRatio { get { throw null; } } + public double PreviousMonthEmissions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CarbonEmissionDataAvailableDateRange : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CarbonEmissionDataAvailableDateRange() { } + public string EndDate { get { throw null; } } + public string StartDate { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionDataAvailableDateRange System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionDataAvailableDateRange System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CarbonEmissionItemDetail : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CarbonEmissionItemDetail() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string ItemName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionItemDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionItemDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CarbonEmissionMonthlySummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CarbonEmissionMonthlySummary() : base (default(double), default(double)) { } + public double CarbonIntensity { get { throw null; } } + public string Date { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionMonthlySummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionMonthlySummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CarbonEmissionOverallSummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CarbonEmissionOverallSummary() : base (default(double), default(double)) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionOverallSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionOverallSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CarbonEmissionTopItemMonthlySummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CarbonEmissionTopItemMonthlySummary() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string Date { get { throw null; } } + public string ItemName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionTopItemMonthlySummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionTopItemMonthlySummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CarbonEmissionTopItemsSummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CarbonEmissionTopItemsSummary() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string ItemName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionTopItemsSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.CarbonEmissionTopItemsSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 CategoryTypeEnum : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CategoryTypeEnum(string value) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum Location { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum Resource { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum ResourceGroup { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum ResourceType { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum Subscription { get { throw null; } } + public bool Equals(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum 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.CarbonOptimization.Models.CategoryTypeEnum left, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum right) { throw null; } + public static implicit operator Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum left, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DateRange : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DateRange(System.DateTimeOffset start, System.DateTimeOffset end) { } + public System.DateTimeOffset End { get { throw null; } } + public System.DateTimeOffset Start { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.DateRange System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.DateRange System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 EmissionScopeEnum : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EmissionScopeEnum(string value) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum Scope1 { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum Scope2 { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum Scope3 { get { throw null; } } + public bool Equals(Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum 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.CarbonOptimization.Models.EmissionScopeEnum left, Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum right) { throw null; } + public static implicit operator Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum left, Azure.ResourceManager.CarbonOptimization.Models.EmissionScopeEnum right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ItemDetailsQueryFilter : Azure.ResourceManager.CarbonOptimization.Models.QueryFilter, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ItemDetailsQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange, System.Collections.Generic.IEnumerable subscriptionList, System.Collections.Generic.IEnumerable carbonScopeList, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType, Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum orderBy, Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum sortDirection, int pageSize) : base (default(Azure.ResourceManager.CarbonOptimization.Models.DateRange), default(System.Collections.Generic.IEnumerable), default(System.Collections.Generic.IEnumerable)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum OrderBy { get { throw null; } } + public int PageSize { get { throw null; } } + public string SkipToken { get { throw null; } set { } } + public Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum SortDirection { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ItemDetailsQueryFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ItemDetailsQueryFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonthlySummaryReportQueryFilter : Azure.ResourceManager.CarbonOptimization.Models.QueryFilter, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonthlySummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange, System.Collections.Generic.IEnumerable subscriptionList, System.Collections.Generic.IEnumerable carbonScopeList) : base (default(Azure.ResourceManager.CarbonOptimization.Models.DateRange), default(System.Collections.Generic.IEnumerable), default(System.Collections.Generic.IEnumerable)) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.MonthlySummaryReportQueryFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.MonthlySummaryReportQueryFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 OrderByColumnEnum : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OrderByColumnEnum(string value) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum ItemName { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum LatestMonthEmissions { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum MonthlyEmissionsChangeValue { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum MonthOverMonthEmissionsChangeRatio { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum PreviousMonthEmissions { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum ResourceGroup { get { throw null; } } + public bool Equals(Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum 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.CarbonOptimization.Models.OrderByColumnEnum left, Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum right) { throw null; } + public static implicit operator Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum left, Azure.ResourceManager.CarbonOptimization.Models.OrderByColumnEnum right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OverallSummaryReportQueryFilter : Azure.ResourceManager.CarbonOptimization.Models.QueryFilter, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OverallSummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange, System.Collections.Generic.IEnumerable subscriptionList, System.Collections.Generic.IEnumerable carbonScopeList) : base (default(Azure.ResourceManager.CarbonOptimization.Models.DateRange), default(System.Collections.Generic.IEnumerable), default(System.Collections.Generic.IEnumerable)) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.OverallSummaryReportQueryFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.OverallSummaryReportQueryFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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 QueryFilter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected QueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange, System.Collections.Generic.IEnumerable subscriptionList, System.Collections.Generic.IEnumerable carbonScopeList) { } + public System.Collections.Generic.IList CarbonScopeList { get { throw null; } } + public Azure.ResourceManager.CarbonOptimization.Models.DateRange DateRange { get { throw null; } } + public System.Collections.Generic.IList LocationList { get { throw null; } } + public System.Collections.Generic.IList ResourceGroupUrlList { get { throw null; } } + public System.Collections.Generic.IList ResourceTypeList { get { throw null; } } + public System.Collections.Generic.IList SubscriptionList { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.QueryFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.QueryFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceCarbonEmissionItemDetail : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceCarbonEmissionItemDetail() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string ItemName { get { throw null; } } + public string Location { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceId { get { throw null; } } + public string ResourceType { get { throw null; } } + public string SubscriptionId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionItemDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionItemDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceCarbonEmissionTopItemMonthlySummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceCarbonEmissionTopItemMonthlySummary() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string Date { get { throw null; } } + public string ItemName { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceId { get { throw null; } } + public string SubscriptionId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionTopItemMonthlySummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionTopItemMonthlySummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceCarbonEmissionTopItemsSummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceCarbonEmissionTopItemsSummary() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string ItemName { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceId { get { throw null; } } + public string SubscriptionId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionTopItemsSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceCarbonEmissionTopItemsSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceGroupCarbonEmissionItemDetail : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceGroupCarbonEmissionItemDetail() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string ItemName { get { throw null; } } + public string ResourceGroupUri { get { throw null; } } + public string SubscriptionId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionItemDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionItemDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceGroupCarbonEmissionTopItemMonthlySummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceGroupCarbonEmissionTopItemMonthlySummary() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string Date { get { throw null; } } + public string ItemName { get { throw null; } } + public string ResourceGroupUri { get { throw null; } } + public string SubscriptionId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionTopItemMonthlySummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionTopItemMonthlySummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceGroupCarbonEmissionTopItemsSummary : Azure.ResourceManager.CarbonOptimization.Models.CarbonEmission, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResourceGroupCarbonEmissionTopItemsSummary() : base (default(double), default(double)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public string ItemName { get { throw null; } } + public string ResourceGroupUri { get { throw null; } } + public string SubscriptionId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionTopItemsSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.ResourceGroupCarbonEmissionTopItemsSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 SortDirectionEnum : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SortDirectionEnum(string value) { throw null; } + public static Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum Asc { get { throw null; } } + public static Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum Desc { get { throw null; } } + public bool Equals(Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum 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.CarbonOptimization.Models.SortDirectionEnum left, Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum right) { throw null; } + public static implicit operator Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum left, Azure.ResourceManager.CarbonOptimization.Models.SortDirectionEnum right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TopItemsMonthlySummaryReportQueryFilter : Azure.ResourceManager.CarbonOptimization.Models.QueryFilter, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TopItemsMonthlySummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange, System.Collections.Generic.IEnumerable subscriptionList, System.Collections.Generic.IEnumerable carbonScopeList, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType, int topItems) : base (default(Azure.ResourceManager.CarbonOptimization.Models.DateRange), default(System.Collections.Generic.IEnumerable), default(System.Collections.Generic.IEnumerable)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public int TopItems { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.TopItemsMonthlySummaryReportQueryFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.TopItemsMonthlySummaryReportQueryFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TopItemsSummaryReportQueryFilter : Azure.ResourceManager.CarbonOptimization.Models.QueryFilter, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TopItemsSummaryReportQueryFilter(Azure.ResourceManager.CarbonOptimization.Models.DateRange dateRange, System.Collections.Generic.IEnumerable subscriptionList, System.Collections.Generic.IEnumerable carbonScopeList, Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum categoryType, int topItems) : base (default(Azure.ResourceManager.CarbonOptimization.Models.DateRange), default(System.Collections.Generic.IEnumerable), default(System.Collections.Generic.IEnumerable)) { } + public Azure.ResourceManager.CarbonOptimization.Models.CategoryTypeEnum CategoryType { get { throw null; } } + public int TopItems { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.TopItemsSummaryReportQueryFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CarbonOptimization.Models.TopItemsSummaryReportQueryFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/assets.json b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/assets.json new file mode 100644 index 000000000000..1666f2353a3d --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/carbonoptimization/Azure.ResourceManager.CarbonOptimization", + "Tag": "" +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/samples/Azure.ResourceManager.CarbonOptimization.Samples.csproj b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/samples/Azure.ResourceManager.CarbonOptimization.Samples.csproj new file mode 100644 index 000000000000..7f297a3f03f9 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/samples/Azure.ResourceManager.CarbonOptimization.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/samples/Generated/Samples/Sample_TenantResourceExtensions.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/samples/Generated/Samples/Sample_TenantResourceExtensions.cs new file mode 100644 index 000000000000..cc2bfc61f5fe --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/samples/Generated/Samples/Sample_TenantResourceExtensions.cs @@ -0,0 +1,575 @@ +// 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.CarbonOptimization.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.CarbonOptimization.Samples +{ + public partial class Sample_TenantResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionLocationItemDetailsReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsLocationItemDetailsReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new ItemDetailsQueryFilter( + new DateRange(DateTimeOffset.Parse("2024-05-01"), DateTimeOffset.Parse("2024-05-01")), + new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, + new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, + CategoryTypeEnum.Location, + OrderByColumnEnum.LatestMonthEmissions, + SortDirectionEnum.Desc, + 100); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionOverallMonthlySummaryReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsMonthlySummaryReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new MonthlySummaryReportQueryFilter(new DateRange(DateTimeOffset.Parse("2024-03-01"), DateTimeOffset.Parse("2024-05-01")), new string[] { "00000000-0000-0000-0000-000000000000" }, new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionMonthlySummaryReportWithOptionalFilterLocationListResourceTypeListResourceGroupUrlList() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsMonthlySummaryReportWithOtherOptionalFilter.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new MonthlySummaryReportQueryFilter(new DateRange(DateTimeOffset.Parse("2024-03-01"), DateTimeOffset.Parse("2024-05-01")), new string[] { "00000000-0000-0000-0000-000000000000" }, new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }) + { + ResourceGroupUrlList = { "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-name" }, + ResourceTypeList = { "microsoft.storage/storageaccounts", "microsoft.databricks/workspaces" }, + LocationList = { "east us", "west us" }, + }; + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionOverallSummaryReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsOverallSummaryReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new OverallSummaryReportQueryFilter(new DateRange(DateTimeOffset.Parse("2023-06-01"), DateTimeOffset.Parse("2023-06-01")), new string[] { "00000000-0000-0000-0000-000000000000" }, new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionOverallSummaryReportWithOptionalFilterLocationListResourceTypeListResourceGroupUrlList() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsOverallSummaryReportWithOtherOptionalFilter.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new OverallSummaryReportQueryFilter(new DateRange(DateTimeOffset.Parse("2023-06-01"), DateTimeOffset.Parse("2023-06-01")), new string[] { "00000000-0000-0000-0000-000000000000" }, new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }) + { + ResourceGroupUrlList = { "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-name" }, + ResourceTypeList = { "microsoft.storage/storageaccounts", "microsoft.databricks/workspaces" }, + LocationList = { "east us", "west us" }, + }; + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionResourceGroupItemDetailsReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsResourceGroupItemDetailsReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new ItemDetailsQueryFilter( + new DateRange(DateTimeOffset.Parse("2024-05-01"), DateTimeOffset.Parse("2024-05-01")), + new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, + new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, + CategoryTypeEnum.ResourceGroup, + OrderByColumnEnum.LatestMonthEmissions, + SortDirectionEnum.Desc, + 100); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionResourceItemDetailsReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsResourceItemDetailsReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new ItemDetailsQueryFilter( + new DateRange(DateTimeOffset.Parse("2024-05-01"), DateTimeOffset.Parse("2024-05-01")), + new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, + new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, + CategoryTypeEnum.Resource, + OrderByColumnEnum.LatestMonthEmissions, + SortDirectionEnum.Desc, + 100); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionResourceItemDetailsReportWithPaginationToken() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsResourceItemDetailsReportWithPaginationToken.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new ItemDetailsQueryFilter( + new DateRange(DateTimeOffset.Parse("2024-05-01"), DateTimeOffset.Parse("2024-05-01")), + new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, + new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, + CategoryTypeEnum.Resource, + OrderByColumnEnum.LatestMonthEmissions, + SortDirectionEnum.Desc, + 100) + { + SkipToken = "dGVzZGZhZGZzZnNkZg==", + }; + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionResourceTypeItemDetailsReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsResourceTypeItemDetailsReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new ItemDetailsQueryFilter( + new DateRange(DateTimeOffset.Parse("2024-05-01"), DateTimeOffset.Parse("2024-05-01")), + new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, + new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, + CategoryTypeEnum.ResourceType, + OrderByColumnEnum.LatestMonthEmissions, + SortDirectionEnum.Desc, + 100); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionSubscriptionsItemDetailsReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsSubscriptionItemDetailsReportReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new ItemDetailsQueryFilter( + new DateRange(DateTimeOffset.Parse("2024-05-01"), DateTimeOffset.Parse("2024-05-01")), + new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, + new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, + CategoryTypeEnum.Subscription, + OrderByColumnEnum.LatestMonthEmissions, + SortDirectionEnum.Desc, + 100); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionTopNLocationsMonthlyReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsTopNLocationItemsMonthlyReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new TopItemsMonthlySummaryReportQueryFilter(new DateRange(DateTimeOffset.Parse("2024-03-01"), DateTimeOffset.Parse("2024-05-01")), new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, CategoryTypeEnum.Location, 2); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionTopNLocationsReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsTopNLocationItemsReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new TopItemsSummaryReportQueryFilter(new DateRange(DateTimeOffset.Parse("2024-05-01"), DateTimeOffset.Parse("2024-05-01")), new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, CategoryTypeEnum.Location, 5); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionTopNResourceGroupMonthlyReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsTopNResourceGroupItemsMonthlyReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new TopItemsMonthlySummaryReportQueryFilter(new DateRange(DateTimeOffset.Parse("2024-03-01"), DateTimeOffset.Parse("2024-05-01")), new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, CategoryTypeEnum.ResourceGroup, 2); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionTopNResourceGroupReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsTopNResourceGroupItemsReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new TopItemsSummaryReportQueryFilter(new DateRange(DateTimeOffset.Parse("2024-05-01"), DateTimeOffset.Parse("2024-05-01")), new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, CategoryTypeEnum.ResourceGroup, 5); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionTopNResourceMonthlyReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsTopNResourceItemsMonthlyReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new TopItemsMonthlySummaryReportQueryFilter(new DateRange(DateTimeOffset.Parse("2024-03-01"), DateTimeOffset.Parse("2024-05-01")), new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, CategoryTypeEnum.Resource, 2); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionTopNResourceReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsTopNResourceItemsReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new TopItemsSummaryReportQueryFilter(new DateRange(DateTimeOffset.Parse("2024-05-01"), DateTimeOffset.Parse("2024-05-01")), new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, CategoryTypeEnum.Resource, 5); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionTopNResourceTypeMonthlyReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsTopNResourceTypeItemsMonthlyReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new TopItemsMonthlySummaryReportQueryFilter(new DateRange(DateTimeOffset.Parse("2024-03-01"), DateTimeOffset.Parse("2024-05-01")), new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, CategoryTypeEnum.ResourceType, 2); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionTopNResourceTypeReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsTopNResourceTypeItemsReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new TopItemsSummaryReportQueryFilter(new DateRange(DateTimeOffset.Parse("2024-05-01"), DateTimeOffset.Parse("2024-05-01")), new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, CategoryTypeEnum.ResourceType, 5); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionTopNSubscriptionsMonthlyReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsTopNSubscriptionItemsMonthlyReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new TopItemsMonthlySummaryReportQueryFilter(new DateRange(DateTimeOffset.Parse("2024-03-01"), DateTimeOffset.Parse("2024-05-01")), new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, CategoryTypeEnum.Subscription, 2); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionReportsCarbonServices_QueryCarbonEmissionTopNSubscriptionsReport() + { + // Generated from example definition: 2025-04-01/queryCarbonEmissionsTopNSubscriptionItemsReport.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionReports" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + QueryFilter queryParameters = new TopItemsSummaryReportQueryFilter(new DateRange(DateTimeOffset.Parse("2024-05-01"), DateTimeOffset.Parse("2024-05-01")), new string[] { "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000001,", "00000000-0000-0000-0000-000000000002", "00000000-0000-0000-0000-000000000003", "00000000-0000-0000-0000-000000000004", "00000000-0000-0000-0000-000000000005", "00000000-0000-0000-0000-000000000006", "00000000-0000-0000-0000-000000000007", "00000000-0000-0000-0000-000000000008" }, new EmissionScopeEnum[] { EmissionScopeEnum.Scope1, EmissionScopeEnum.Scope3 }, CategoryTypeEnum.Subscription, 5); + await foreach (CarbonEmission item in tenantResource.QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task QueryCarbonEmissionDataAvailableDateRangeCarbonService_CarbonServiceQueryCarbonEmissionDataAvailableDateRange() + { + // Generated from example definition: 2025-04-01/carbonEmissionsDataAvailableDateRange.json + // this example is just showing the usage of "CarbonService_QueryCarbonEmissionDataAvailableDateRange" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://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 + CarbonEmissionDataAvailableDateRange result = await tenantResource.QueryCarbonEmissionDataAvailableDateRangeCarbonServiceAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Azure.ResourceManager.CarbonOptimization.csproj b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Azure.ResourceManager.CarbonOptimization.csproj new file mode 100644 index 000000000000..11e74eb2756a --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Azure.ResourceManager.CarbonOptimization.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider CarbonOptimization. + 1.0.0-beta.1 + azure;management;arm;resource manager;carbonoptimization + Azure.ResourceManager.CarbonOptimization + + diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/ArmCarbonOptimizationModelFactory.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/ArmCarbonOptimizationModelFactory.cs new file mode 100644 index 000000000000..6a7854c38299 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/ArmCarbonOptimizationModelFactory.cs @@ -0,0 +1,492 @@ +// 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.CarbonOptimization.Models +{ + /// Model factory for models. + public static partial class ArmCarbonOptimizationModelFactory + { + /// Initializes a new instance of . + /// The ReportType requested for carbon emissions data. Required. Specifies how data is aggregated and displayed in the output, as explained in the ReportTypeEnum. + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase. + /// List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'. + /// List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// A new instance for mocking. + public static QueryFilter QueryFilter(string reportType = null, DateRange dateRange = null, IEnumerable subscriptionList = null, IEnumerable resourceGroupUrlList = null, IEnumerable resourceTypeList = null, IEnumerable locationList = null, IEnumerable carbonScopeList = null) + { + subscriptionList ??= new List(); + resourceGroupUrlList ??= new List(); + resourceTypeList ??= new List(); + locationList ??= new List(); + carbonScopeList ??= new List(); + + return new UnknownQueryFilter( + reportType == null ? default : new ReportTypeEnum(reportType), + dateRange, + subscriptionList?.ToList(), + resourceGroupUrlList?.ToList(), + resourceTypeList?.ToList(), + locationList?.ToList(), + carbonScopeList?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase. + /// List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'. + /// List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// A new instance for mocking. + public static OverallSummaryReportQueryFilter OverallSummaryReportQueryFilter(DateRange dateRange = null, IEnumerable subscriptionList = null, IEnumerable resourceGroupUrlList = null, IEnumerable resourceTypeList = null, IEnumerable locationList = null, IEnumerable carbonScopeList = null) + { + subscriptionList ??= new List(); + resourceGroupUrlList ??= new List(); + resourceTypeList ??= new List(); + locationList ??= new List(); + carbonScopeList ??= new List(); + + return new OverallSummaryReportQueryFilter( + ReportTypeEnum.OverallSummaryReport, + dateRange, + subscriptionList?.ToList(), + resourceGroupUrlList?.ToList(), + resourceTypeList?.ToList(), + locationList?.ToList(), + carbonScopeList?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase. + /// List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'. + /// List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// A new instance for mocking. + public static MonthlySummaryReportQueryFilter MonthlySummaryReportQueryFilter(DateRange dateRange = null, IEnumerable subscriptionList = null, IEnumerable resourceGroupUrlList = null, IEnumerable resourceTypeList = null, IEnumerable locationList = null, IEnumerable carbonScopeList = null) + { + subscriptionList ??= new List(); + resourceGroupUrlList ??= new List(); + resourceTypeList ??= new List(); + locationList ??= new List(); + carbonScopeList ??= new List(); + + return new MonthlySummaryReportQueryFilter( + ReportTypeEnum.MonthlySummaryReport, + dateRange, + subscriptionList?.ToList(), + resourceGroupUrlList?.ToList(), + resourceTypeList?.ToList(), + locationList?.ToList(), + carbonScopeList?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase. + /// List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'. + /// List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// Specifies the category type for which to retrieve top-emitting items. See supported values defined in CategoryTypeEnum. + /// The number of top items to return, based on emissions. This value must be between 1 and 10. + /// A new instance for mocking. + public static TopItemsSummaryReportQueryFilter TopItemsSummaryReportQueryFilter(DateRange dateRange = null, IEnumerable subscriptionList = null, IEnumerable resourceGroupUrlList = null, IEnumerable resourceTypeList = null, IEnumerable locationList = null, IEnumerable carbonScopeList = null, CategoryTypeEnum categoryType = default, int topItems = default) + { + subscriptionList ??= new List(); + resourceGroupUrlList ??= new List(); + resourceTypeList ??= new List(); + locationList ??= new List(); + carbonScopeList ??= new List(); + + return new TopItemsSummaryReportQueryFilter( + ReportTypeEnum.TopItemsSummaryReport, + dateRange, + subscriptionList?.ToList(), + resourceGroupUrlList?.ToList(), + resourceTypeList?.ToList(), + locationList?.ToList(), + carbonScopeList?.ToList(), + serializedAdditionalRawData: null, + categoryType, + topItems); + } + + /// Initializes a new instance of . + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase. + /// List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'. + /// List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// Specifies the category type to retrieve top-emitting items, aggregated by month. See supported types in CategoryTypeEnum. + /// The number of top items to return, based on emissions. Must be between 1 and 10. + /// A new instance for mocking. + public static TopItemsMonthlySummaryReportQueryFilter TopItemsMonthlySummaryReportQueryFilter(DateRange dateRange = null, IEnumerable subscriptionList = null, IEnumerable resourceGroupUrlList = null, IEnumerable resourceTypeList = null, IEnumerable locationList = null, IEnumerable carbonScopeList = null, CategoryTypeEnum categoryType = default, int topItems = default) + { + subscriptionList ??= new List(); + resourceGroupUrlList ??= new List(); + resourceTypeList ??= new List(); + locationList ??= new List(); + carbonScopeList ??= new List(); + + return new TopItemsMonthlySummaryReportQueryFilter( + ReportTypeEnum.TopItemsMonthlySummaryReport, + dateRange, + subscriptionList?.ToList(), + resourceGroupUrlList?.ToList(), + resourceTypeList?.ToList(), + locationList?.ToList(), + carbonScopeList?.ToList(), + serializedAdditionalRawData: null, + categoryType, + topItems); + } + + /// Initializes a new instance of . + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase. + /// List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'. + /// List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// Specifies the category type for detailed emissions data, such as Resource, ResourceGroup, ResourceType, Location, or Subscription. See supported types in CategoryTypeEnum. + /// The column name to order the results by. See supported values in OrderByColumnEnum. + /// Direction for sorting results. See supported values in SortDirectionEnum. + /// Number of items to return in one request, max value is 5000. + /// Pagination token for fetching the next page of data. This token is nullable and will be returned in the previous response if additional data pages are available. + /// A new instance for mocking. + public static ItemDetailsQueryFilter ItemDetailsQueryFilter(DateRange dateRange = null, IEnumerable subscriptionList = null, IEnumerable resourceGroupUrlList = null, IEnumerable resourceTypeList = null, IEnumerable locationList = null, IEnumerable carbonScopeList = null, CategoryTypeEnum categoryType = default, OrderByColumnEnum orderBy = default, SortDirectionEnum sortDirection = default, int pageSize = default, string skipToken = null) + { + subscriptionList ??= new List(); + resourceGroupUrlList ??= new List(); + resourceTypeList ??= new List(); + locationList ??= new List(); + carbonScopeList ??= new List(); + + return new ItemDetailsQueryFilter( + ReportTypeEnum.ItemDetailsReport, + dateRange, + subscriptionList?.ToList(), + resourceGroupUrlList?.ToList(), + resourceTypeList?.ToList(), + locationList?.ToList(), + carbonScopeList?.ToList(), + serializedAdditionalRawData: null, + categoryType, + orderBy, + sortDirection, + pageSize, + skipToken); + } + + /// Initializes a new instance of . + /// The data type of the query result, indicating the format of the returned response. + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// A new instance for mocking. + public static CarbonEmission CarbonEmission(string dataType = null, double latestMonthEmissions = default, double previousMonthEmissions = default, double? monthOverMonthEmissionsChangeRatio = null, double? monthlyEmissionsChangeValue = null) + { + return new UnknownCarbonEmission( + dataType == null ? default : new ResponseDataTypeEnum(dataType), + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// A new instance for mocking. + public static CarbonEmissionOverallSummary CarbonEmissionOverallSummary(double latestMonthEmissions = default, double previousMonthEmissions = default, double? monthOverMonthEmissionsChangeRatio = null, double? monthlyEmissionsChangeValue = null) + { + return new CarbonEmissionOverallSummary( + ResponseDataTypeEnum.OverallSummaryData, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// The date, representing the month, for which the emissions data is reported, formatted as yyyy-MM-dd (e.g., 2024-03-01). + /// Carbon intensity for the specified month, typically in units of kgCO2E per unit of normalized usage. + /// A new instance for mocking. + public static CarbonEmissionMonthlySummary CarbonEmissionMonthlySummary(double latestMonthEmissions = default, double previousMonthEmissions = default, double? monthOverMonthEmissionsChangeRatio = null, double? monthlyEmissionsChangeValue = null, string date = null, double carbonIntensity = default) + { + return new CarbonEmissionMonthlySummary( + ResponseDataTypeEnum.MonthlySummaryData, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData: null, + date, + carbonIntensity); + } + + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// The identifier of the item being reported on, which could refer to the resource name, resource type name, location, resource group name, or subscription ID, depending on the specified category type. + /// The category type of the item. This defines which dimension the emissions are aggregated by, and the supported values are defined in CategoryTypeEnum (e.g., Subscription, ResourceGroup, Resource, etc.). + /// A new instance for mocking. + public static CarbonEmissionTopItemsSummary CarbonEmissionTopItemsSummary(double latestMonthEmissions = default, double previousMonthEmissions = default, double? monthOverMonthEmissionsChangeRatio = null, double? monthlyEmissionsChangeValue = null, string itemName = null, CategoryTypeEnum categoryType = default) + { + return new CarbonEmissionTopItemsSummary( + ResponseDataTypeEnum.TopItemsSummaryData, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData: null, + itemName, + categoryType); + } + + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// The resource name of the resource for the Resource Category. + /// The category type of the item. This defines which dimension the emissions are aggregated by, and the supported values are defined in CategoryTypeEnum (e.g., Subscription, ResourceGroup, Resource, etc.). + /// Subscription Id. + /// Resource group name. + /// Resource Id, The URI of the resource for the Resource Category. This identifies the resource being reported. + /// A new instance for mocking. + public static ResourceCarbonEmissionTopItemsSummary ResourceCarbonEmissionTopItemsSummary(double latestMonthEmissions = default, double previousMonthEmissions = default, double? monthOverMonthEmissionsChangeRatio = null, double? monthlyEmissionsChangeValue = null, string itemName = null, CategoryTypeEnum categoryType = default, string subscriptionId = null, string resourceGroup = null, string resourceId = null) + { + return new ResourceCarbonEmissionTopItemsSummary( + ResponseDataTypeEnum.ResourceTopItemsSummaryData, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData: null, + itemName, + categoryType, + subscriptionId, + resourceGroup, + resourceId); + } + + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// The resourceGroup name of the resource for ResourceGroup Category. + /// ResourceGroup Item category. + /// Subscription Id. + /// Resource Group url, value format is '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}'. + /// A new instance for mocking. + public static ResourceGroupCarbonEmissionTopItemsSummary ResourceGroupCarbonEmissionTopItemsSummary(double latestMonthEmissions = default, double previousMonthEmissions = default, double? monthOverMonthEmissionsChangeRatio = null, double? monthlyEmissionsChangeValue = null, string itemName = null, CategoryTypeEnum categoryType = default, string subscriptionId = null, string resourceGroupUri = null) + { + return new ResourceGroupCarbonEmissionTopItemsSummary( + ResponseDataTypeEnum.ResourceGroupTopItemsSummaryData, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData: null, + itemName, + categoryType, + subscriptionId, + resourceGroupUri); + } + + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Item name, it can be resource name, resource type name, location, resource group name or subscriptionId. It depends on category type. + /// Item category, see supported type value defined in CategoryTypeEnum. + /// The date, representing the month, for which the emissions data is reported, formatted as yyyy-MM-dd (e.g., 2024-03-01). + /// A new instance for mocking. + public static CarbonEmissionTopItemMonthlySummary CarbonEmissionTopItemMonthlySummary(double latestMonthEmissions = default, double previousMonthEmissions = default, double? monthOverMonthEmissionsChangeRatio = null, double? monthlyEmissionsChangeValue = null, string itemName = null, CategoryTypeEnum categoryType = default, string date = null) + { + return new CarbonEmissionTopItemMonthlySummary( + ResponseDataTypeEnum.TopItemsMonthlySummaryData, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData: null, + itemName, + categoryType, + date); + } + + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// The resource name of resource for Resource Category. + /// Resource Item category. + /// Monthly date string, format is yyyy-MM-dd. + /// Subscription Id. + /// Resource Group. + /// The fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// A new instance for mocking. + public static ResourceCarbonEmissionTopItemMonthlySummary ResourceCarbonEmissionTopItemMonthlySummary(double latestMonthEmissions = default, double previousMonthEmissions = default, double? monthOverMonthEmissionsChangeRatio = null, double? monthlyEmissionsChangeValue = null, string itemName = null, CategoryTypeEnum categoryType = default, string date = null, string subscriptionId = null, string resourceGroup = null, string resourceId = null) + { + return new ResourceCarbonEmissionTopItemMonthlySummary( + ResponseDataTypeEnum.ResourceTopItemsMonthlySummaryData, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData: null, + itemName, + categoryType, + date, + subscriptionId, + resourceGroup, + resourceId); + } + + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// It's resource group name for ResourceGroup category. + /// ResourceGroup Item category. + /// Monthly date string, format is yyyy-MM-dd. + /// Subscription Id. + /// Resource Group url, the format is '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}'. + /// A new instance for mocking. + public static ResourceGroupCarbonEmissionTopItemMonthlySummary ResourceGroupCarbonEmissionTopItemMonthlySummary(double latestMonthEmissions = default, double previousMonthEmissions = default, double? monthOverMonthEmissionsChangeRatio = null, double? monthlyEmissionsChangeValue = null, string itemName = null, CategoryTypeEnum categoryType = default, string date = null, string subscriptionId = null, string resourceGroupUri = null) + { + return new ResourceGroupCarbonEmissionTopItemMonthlySummary( + ResponseDataTypeEnum.ResourceGroupTopItemsMonthlySummaryData, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData: null, + itemName, + categoryType, + date, + subscriptionId, + resourceGroupUri); + } + + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Item name, it can be resource name, resource type name, location, resource group name or subscriptionId. It depends on category type. + /// Item category, see supported type value defined in CategoryTypeEnum. + /// A new instance for mocking. + public static CarbonEmissionItemDetail CarbonEmissionItemDetail(double latestMonthEmissions = default, double previousMonthEmissions = default, double? monthOverMonthEmissionsChangeRatio = null, double? monthlyEmissionsChangeValue = null, string itemName = null, CategoryTypeEnum categoryType = default) + { + return new CarbonEmissionItemDetail( + ResponseDataTypeEnum.ItemDetailsData, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData: null, + itemName, + categoryType); + } + + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// It's resource name. + /// Resource Item category, see supported value defined in CategoryTypeEnum. + /// Subscription Id. + /// Resource Group. + /// The fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// Resource Location (e.g., 'east us'). + /// The type of resource, for example: microsoft.storage/storageaccounts. + /// A new instance for mocking. + public static ResourceCarbonEmissionItemDetail ResourceCarbonEmissionItemDetail(double latestMonthEmissions = default, double previousMonthEmissions = default, double? monthOverMonthEmissionsChangeRatio = null, double? monthlyEmissionsChangeValue = null, string itemName = null, CategoryTypeEnum categoryType = default, string subscriptionId = null, string resourceGroup = null, string resourceId = null, string location = null, string resourceType = null) + { + return new ResourceCarbonEmissionItemDetail( + ResponseDataTypeEnum.ResourceItemDetailsData, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData: null, + itemName, + categoryType, + subscriptionId, + resourceGroup, + resourceId, + location, + resourceType); + } + + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// It's resource group name. + /// ResourceGroup Item category. + /// Subscription Id. + /// Resource Group url, value format is '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}'. + /// A new instance for mocking. + public static ResourceGroupCarbonEmissionItemDetail ResourceGroupCarbonEmissionItemDetail(double latestMonthEmissions = default, double previousMonthEmissions = default, double? monthOverMonthEmissionsChangeRatio = null, double? monthlyEmissionsChangeValue = null, string itemName = null, CategoryTypeEnum categoryType = default, string subscriptionId = null, string resourceGroupUri = null) + { + return new ResourceGroupCarbonEmissionItemDetail( + ResponseDataTypeEnum.ResourceGroupItemDetailsData, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData: null, + itemName, + categoryType, + subscriptionId, + resourceGroupUri); + } + + /// Initializes a new instance of . + /// Start date parameter, format is yyyy-MM-dd. + /// End date parameter, format is yyyy-MM-dd. + /// A new instance for mocking. + public static CarbonEmissionDataAvailableDateRange CarbonEmissionDataAvailableDateRange(string startDate = null, string endDate = null) + { + return new CarbonEmissionDataAvailableDateRange(startDate, endDate, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Extensions/CarbonOptimizationExtensions.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Extensions/CarbonOptimizationExtensions.cs new file mode 100644 index 000000000000..72b3f1d2860f --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Extensions/CarbonOptimizationExtensions.cs @@ -0,0 +1,153 @@ +// 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.ResourceManager.CarbonOptimization.Mocking; +using Azure.ResourceManager.CarbonOptimization.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.CarbonOptimization +{ + /// A class to add extension methods to Azure.ResourceManager.CarbonOptimization. + public static partial class CarbonOptimizationExtensions + { + private static MockableCarbonOptimizationTenantResource GetMockableCarbonOptimizationTenantResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableCarbonOptimizationTenantResource(client, resource.Id)); + } + + /// + /// API for Carbon Emissions Reports + /// + /// + /// Request Path + /// /providers/Microsoft.Carbon/carbonEmissionReports + /// + /// + /// Operation Id + /// CarbonService_QueryCarbonEmissionReports + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Query parameters. + /// The cancellation token to use. + /// or is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable QueryCarbonEmissionReportsCarbonServicesAsync(this TenantResource tenantResource, QueryFilter queryParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return GetMockableCarbonOptimizationTenantResource(tenantResource).QueryCarbonEmissionReportsCarbonServicesAsync(queryParameters, cancellationToken); + } + + /// + /// API for Carbon Emissions Reports + /// + /// + /// Request Path + /// /providers/Microsoft.Carbon/carbonEmissionReports + /// + /// + /// Operation Id + /// CarbonService_QueryCarbonEmissionReports + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Query parameters. + /// The cancellation token to use. + /// or is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable QueryCarbonEmissionReportsCarbonServices(this TenantResource tenantResource, QueryFilter queryParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return GetMockableCarbonOptimizationTenantResource(tenantResource).QueryCarbonEmissionReportsCarbonServices(queryParameters, cancellationToken); + } + + /// + /// API for query carbon emission data available date range + /// + /// + /// Request Path + /// /providers/Microsoft.Carbon/queryCarbonEmissionDataAvailableDateRange + /// + /// + /// Operation Id + /// CarbonService_QueryCarbonEmissionDataAvailableDateRange + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + public static async Task> QueryCarbonEmissionDataAvailableDateRangeCarbonServiceAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return await GetMockableCarbonOptimizationTenantResource(tenantResource).QueryCarbonEmissionDataAvailableDateRangeCarbonServiceAsync(cancellationToken).ConfigureAwait(false); + } + + /// + /// API for query carbon emission data available date range + /// + /// + /// Request Path + /// /providers/Microsoft.Carbon/queryCarbonEmissionDataAvailableDateRange + /// + /// + /// Operation Id + /// CarbonService_QueryCarbonEmissionDataAvailableDateRange + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + public static Response QueryCarbonEmissionDataAvailableDateRangeCarbonService(this TenantResource tenantResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return GetMockableCarbonOptimizationTenantResource(tenantResource).QueryCarbonEmissionDataAvailableDateRangeCarbonService(cancellationToken); + } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Extensions/MockableCarbonOptimizationTenantResource.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Extensions/MockableCarbonOptimizationTenantResource.cs new file mode 100644 index 000000000000..1844e5dce5ba --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Extensions/MockableCarbonOptimizationTenantResource.cs @@ -0,0 +1,171 @@ +// 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.CarbonOptimization.Models; + +namespace Azure.ResourceManager.CarbonOptimization.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class MockableCarbonOptimizationTenantResource : ArmResource + { + private ClientDiagnostics _carbonServiceClientDiagnostics; + private CarbonServiceRestOperations _carbonServiceRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableCarbonOptimizationTenantResource() + { + } + + /// 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 MockableCarbonOptimizationTenantResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics CarbonServiceClientDiagnostics => _carbonServiceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CarbonOptimization", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private CarbonServiceRestOperations CarbonServiceRestClient => _carbonServiceRestClient ??= new CarbonServiceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// API for Carbon Emissions Reports + /// + /// + /// Request Path + /// /providers/Microsoft.Carbon/carbonEmissionReports + /// + /// + /// Operation Id + /// CarbonService_QueryCarbonEmissionReports + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// + /// Query parameters. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable QueryCarbonEmissionReportsCarbonServicesAsync(QueryFilter queryParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(queryParameters, nameof(queryParameters)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CarbonServiceRestClient.CreateQueryCarbonEmissionReportsRequest(queryParameters); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => CarbonEmission.DeserializeCarbonEmission(e), CarbonServiceClientDiagnostics, Pipeline, "MockableCarbonOptimizationTenantResource.QueryCarbonEmissionReportsCarbonServices", "value", null, cancellationToken); + } + + /// + /// API for Carbon Emissions Reports + /// + /// + /// Request Path + /// /providers/Microsoft.Carbon/carbonEmissionReports + /// + /// + /// Operation Id + /// CarbonService_QueryCarbonEmissionReports + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// + /// Query parameters. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable QueryCarbonEmissionReportsCarbonServices(QueryFilter queryParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(queryParameters, nameof(queryParameters)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CarbonServiceRestClient.CreateQueryCarbonEmissionReportsRequest(queryParameters); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => CarbonEmission.DeserializeCarbonEmission(e), CarbonServiceClientDiagnostics, Pipeline, "MockableCarbonOptimizationTenantResource.QueryCarbonEmissionReportsCarbonServices", "value", null, cancellationToken); + } + + /// + /// API for query carbon emission data available date range + /// + /// + /// Request Path + /// /providers/Microsoft.Carbon/queryCarbonEmissionDataAvailableDateRange + /// + /// + /// Operation Id + /// CarbonService_QueryCarbonEmissionDataAvailableDateRange + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> QueryCarbonEmissionDataAvailableDateRangeCarbonServiceAsync(CancellationToken cancellationToken = default) + { + using var scope = CarbonServiceClientDiagnostics.CreateScope("MockableCarbonOptimizationTenantResource.QueryCarbonEmissionDataAvailableDateRangeCarbonService"); + scope.Start(); + try + { + var response = await CarbonServiceRestClient.QueryCarbonEmissionDataAvailableDateRangeAsync(cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// API for query carbon emission data available date range + /// + /// + /// Request Path + /// /providers/Microsoft.Carbon/queryCarbonEmissionDataAvailableDateRange + /// + /// + /// Operation Id + /// CarbonService_QueryCarbonEmissionDataAvailableDateRange + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// + /// The cancellation token to use. + public virtual Response QueryCarbonEmissionDataAvailableDateRangeCarbonService(CancellationToken cancellationToken = default) + { + using var scope = CarbonServiceClientDiagnostics.CreateScope("MockableCarbonOptimizationTenantResource.QueryCarbonEmissionDataAvailableDateRangeCarbonService"); + scope.Start(); + try + { + var response = CarbonServiceRestClient.QueryCarbonEmissionDataAvailableDateRange(cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/Argument.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..14aabd37427d --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/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.CarbonOptimization +{ + 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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..bebee292a598 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/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.CarbonOptimization +{ + 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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/ChangeTrackingList.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..c0a69d82c3dd --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/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.CarbonOptimization +{ + 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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..17b91f2f6601 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/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.CarbonOptimization +{ + 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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/Optional.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..f2b00200cb54 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/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.CarbonOptimization +{ + 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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..8336c2723269 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/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.CarbonOptimization +{ + 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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/AccessDecisionEnum.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/AccessDecisionEnum.cs new file mode 100644 index 000000000000..188baea42301 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/AccessDecisionEnum.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.CarbonOptimization.Models +{ + /// Enum for Access Decision. + internal readonly partial struct AccessDecisionEnum : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AccessDecisionEnum(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AllowedValue = "Allowed"; + private const string DeniedValue = "Denied"; + + /// Access allowed. + public static AccessDecisionEnum Allowed { get; } = new AccessDecisionEnum(AllowedValue); + /// Access denied. + public static AccessDecisionEnum Denied { get; } = new AccessDecisionEnum(DeniedValue); + /// Determines if two values are the same. + public static bool operator ==(AccessDecisionEnum left, AccessDecisionEnum right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AccessDecisionEnum left, AccessDecisionEnum right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AccessDecisionEnum(string value) => new AccessDecisionEnum(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AccessDecisionEnum other && Equals(other); + /// + public bool Equals(AccessDecisionEnum 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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmission.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmission.Serialization.cs new file mode 100644 index 000000000000..724a2de5ade2 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmission.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.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + [PersistableModelProxy(typeof(UnknownCarbonEmission))] + public partial class CarbonEmission : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CarbonEmission)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("dataType"u8); + writer.WriteStringValue(DataType.ToString()); + writer.WritePropertyName("latestMonthEmissions"u8); + writer.WriteNumberValue(LatestMonthEmissions); + writer.WritePropertyName("previousMonthEmissions"u8); + writer.WriteNumberValue(PreviousMonthEmissions); + if (Optional.IsDefined(MonthOverMonthEmissionsChangeRatio)) + { + writer.WritePropertyName("monthOverMonthEmissionsChangeRatio"u8); + writer.WriteNumberValue(MonthOverMonthEmissionsChangeRatio.Value); + } + if (Optional.IsDefined(MonthlyEmissionsChangeValue)) + { + writer.WritePropertyName("monthlyEmissionsChangeValue"u8); + writer.WriteNumberValue(MonthlyEmissionsChangeValue.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 + } + } + } + + CarbonEmission IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CarbonEmission)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCarbonEmission(document.RootElement, options); + } + + internal static CarbonEmission DeserializeCarbonEmission(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("dataType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "ItemDetailsData": return CarbonEmissionItemDetail.DeserializeCarbonEmissionItemDetail(element, options); + case "MonthlySummaryData": return CarbonEmissionMonthlySummary.DeserializeCarbonEmissionMonthlySummary(element, options); + case "OverallSummaryData": return CarbonEmissionOverallSummary.DeserializeCarbonEmissionOverallSummary(element, options); + case "ResourceGroupItemDetailsData": return ResourceGroupCarbonEmissionItemDetail.DeserializeResourceGroupCarbonEmissionItemDetail(element, options); + case "ResourceGroupTopItemsMonthlySummaryData": return ResourceGroupCarbonEmissionTopItemMonthlySummary.DeserializeResourceGroupCarbonEmissionTopItemMonthlySummary(element, options); + case "ResourceGroupTopItemsSummaryData": return ResourceGroupCarbonEmissionTopItemsSummary.DeserializeResourceGroupCarbonEmissionTopItemsSummary(element, options); + case "ResourceItemDetailsData": return ResourceCarbonEmissionItemDetail.DeserializeResourceCarbonEmissionItemDetail(element, options); + case "ResourceTopItemsMonthlySummaryData": return ResourceCarbonEmissionTopItemMonthlySummary.DeserializeResourceCarbonEmissionTopItemMonthlySummary(element, options); + case "ResourceTopItemsSummaryData": return ResourceCarbonEmissionTopItemsSummary.DeserializeResourceCarbonEmissionTopItemsSummary(element, options); + case "TopItemsMonthlySummaryData": return CarbonEmissionTopItemMonthlySummary.DeserializeCarbonEmissionTopItemMonthlySummary(element, options); + case "TopItemsSummaryData": return CarbonEmissionTopItemsSummary.DeserializeCarbonEmissionTopItemsSummary(element, options); + } + } + return UnknownCarbonEmission.DeserializeUnknownCarbonEmission(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(CarbonEmission)} does not support writing '{options.Format}' format."); + } + } + + CarbonEmission IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCarbonEmission(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CarbonEmission)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmission.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmission.cs new file mode 100644 index 000000000000..e1ec9f969e5e --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmission.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.CarbonOptimization.Models +{ + /// + /// The basic response for different query report, all query report result will have these information + /// 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 CarbonEmission + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + protected CarbonEmission(double latestMonthEmissions, double previousMonthEmissions) + { + LatestMonthEmissions = latestMonthEmissions; + PreviousMonthEmissions = previousMonthEmissions; + } + + /// Initializes a new instance of . + /// The data type of the query result, indicating the format of the returned response. + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Keeps track of any properties unknown to the library. + internal CarbonEmission(ResponseDataTypeEnum dataType, double latestMonthEmissions, double previousMonthEmissions, double? monthOverMonthEmissionsChangeRatio, double? monthlyEmissionsChangeValue, IDictionary serializedAdditionalRawData) + { + DataType = dataType; + LatestMonthEmissions = latestMonthEmissions; + PreviousMonthEmissions = previousMonthEmissions; + MonthOverMonthEmissionsChangeRatio = monthOverMonthEmissionsChangeRatio; + MonthlyEmissionsChangeValue = monthlyEmissionsChangeValue; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CarbonEmission() + { + } + + /// The data type of the query result, indicating the format of the returned response. + internal ResponseDataTypeEnum DataType { get; set; } + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + public double LatestMonthEmissions { get; } + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + public double PreviousMonthEmissions { get; } + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + public double? MonthOverMonthEmissionsChangeRatio { get; } + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + public double? MonthlyEmissionsChangeValue { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataAvailableDateRange.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataAvailableDateRange.Serialization.cs new file mode 100644 index 000000000000..e831f8ccd32d --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataAvailableDateRange.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.CarbonOptimization.Models +{ + public partial class CarbonEmissionDataAvailableDateRange : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CarbonEmissionDataAvailableDateRange)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("startDate"u8); + writer.WriteStringValue(StartDate); + writer.WritePropertyName("endDate"u8); + writer.WriteStringValue(EndDate); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CarbonEmissionDataAvailableDateRange IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CarbonEmissionDataAvailableDateRange)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCarbonEmissionDataAvailableDateRange(document.RootElement, options); + } + + internal static CarbonEmissionDataAvailableDateRange DeserializeCarbonEmissionDataAvailableDateRange(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string startDate = default; + string endDate = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startDate"u8)) + { + startDate = property.Value.GetString(); + continue; + } + if (property.NameEquals("endDate"u8)) + { + endDate = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CarbonEmissionDataAvailableDateRange(startDate, endDate, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CarbonEmissionDataAvailableDateRange)} does not support writing '{options.Format}' format."); + } + } + + CarbonEmissionDataAvailableDateRange IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCarbonEmissionDataAvailableDateRange(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CarbonEmissionDataAvailableDateRange)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataAvailableDateRange.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataAvailableDateRange.cs new file mode 100644 index 000000000000..d14113cf885e --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataAvailableDateRange.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.CarbonOptimization.Models +{ + /// Response for available date range of carbon emission data. + public partial class CarbonEmissionDataAvailableDateRange + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Start date parameter, format is yyyy-MM-dd. + /// End date parameter, format is yyyy-MM-dd. + /// or is null. + internal CarbonEmissionDataAvailableDateRange(string startDate, string endDate) + { + Argument.AssertNotNull(startDate, nameof(startDate)); + Argument.AssertNotNull(endDate, nameof(endDate)); + + StartDate = startDate; + EndDate = endDate; + } + + /// Initializes a new instance of . + /// Start date parameter, format is yyyy-MM-dd. + /// End date parameter, format is yyyy-MM-dd. + /// Keeps track of any properties unknown to the library. + internal CarbonEmissionDataAvailableDateRange(string startDate, string endDate, IDictionary serializedAdditionalRawData) + { + StartDate = startDate; + EndDate = endDate; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CarbonEmissionDataAvailableDateRange() + { + } + + /// Start date parameter, format is yyyy-MM-dd. + public string StartDate { get; } + /// End date parameter, format is yyyy-MM-dd. + public string EndDate { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataListResult.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataListResult.Serialization.cs new file mode 100644 index 000000000000..0c6629043786 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataListResult.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.CarbonOptimization.Models +{ + internal partial class CarbonEmissionDataListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CarbonEmissionDataListResult)} 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(SkipToken)) + { + writer.WritePropertyName("skipToken"u8); + writer.WriteStringValue(SkipToken); + } + if (Optional.IsCollectionDefined(SubscriptionAccessDecisionList)) + { + writer.WritePropertyName("subscriptionAccessDecisionList"u8); + writer.WriteStartArray(); + foreach (var item in SubscriptionAccessDecisionList) + { + 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 + } + } + } + + CarbonEmissionDataListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CarbonEmissionDataListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCarbonEmissionDataListResult(document.RootElement, options); + } + + internal static CarbonEmissionDataListResult DeserializeCarbonEmissionDataListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string skipToken = default; + IReadOnlyList subscriptionAccessDecisionList = 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(CarbonEmission.DeserializeCarbonEmission(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("skipToken"u8)) + { + skipToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("subscriptionAccessDecisionList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SubscriptionAccessDecision.DeserializeSubscriptionAccessDecision(item, options)); + } + subscriptionAccessDecisionList = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CarbonEmissionDataListResult(value, skipToken, subscriptionAccessDecisionList ?? 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(CarbonEmissionDataListResult)} does not support writing '{options.Format}' format."); + } + } + + CarbonEmissionDataListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCarbonEmissionDataListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CarbonEmissionDataListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataListResult.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataListResult.cs new file mode 100644 index 000000000000..27430a0575af --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionDataListResult.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.CarbonOptimization.Models +{ + /// List of carbon emission results. + internal partial class CarbonEmissionDataListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 CarbonEmissionData items on this page + /// 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 CarbonEmissionDataListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + SubscriptionAccessDecisionList = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The CarbonEmissionData items on this page + /// 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 pagination token to fetch next page data, it's null or empty if it doesn't have next page data. + /// The access decision list for each input subscription. + /// Keeps track of any properties unknown to the library. + internal CarbonEmissionDataListResult(IReadOnlyList value, string skipToken, IReadOnlyList subscriptionAccessDecisionList, IDictionary serializedAdditionalRawData) + { + Value = value; + SkipToken = skipToken; + SubscriptionAccessDecisionList = subscriptionAccessDecisionList; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CarbonEmissionDataListResult() + { + } + + /// + /// The CarbonEmissionData items on this page + /// 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 IReadOnlyList Value { get; } + /// The pagination token to fetch next page data, it's null or empty if it doesn't have next page data. + public string SkipToken { get; } + /// The access decision list for each input subscription. + public IReadOnlyList SubscriptionAccessDecisionList { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionItemDetail.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionItemDetail.Serialization.cs new file mode 100644 index 000000000000..761eb5b46c51 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionItemDetail.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + public partial class CarbonEmissionItemDetail : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CarbonEmissionItemDetail)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("itemName"u8); + writer.WriteStringValue(ItemName); + writer.WritePropertyName("categoryType"u8); + writer.WriteStringValue(CategoryType.ToString()); + } + + CarbonEmissionItemDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CarbonEmissionItemDetail)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCarbonEmissionItemDetail(document.RootElement, options); + } + + internal static CarbonEmissionItemDetail DeserializeCarbonEmissionItemDetail(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string itemName = default; + CategoryTypeEnum categoryType = default; + ResponseDataTypeEnum dataType = default; + double latestMonthEmissions = default; + double previousMonthEmissions = default; + double? monthOverMonthEmissionsChangeRatio = default; + double? monthlyEmissionsChangeValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("itemName"u8)) + { + itemName = property.Value.GetString(); + continue; + } + if (property.NameEquals("categoryType"u8)) + { + categoryType = new CategoryTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("dataType"u8)) + { + dataType = new ResponseDataTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestMonthEmissions"u8)) + { + latestMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("previousMonthEmissions"u8)) + { + previousMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthOverMonthEmissionsChangeRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthOverMonthEmissionsChangeRatio = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyEmissionsChangeValue"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyEmissionsChangeValue = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CarbonEmissionItemDetail( + dataType, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData, + itemName, + categoryType); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CarbonEmissionItemDetail)} does not support writing '{options.Format}' format."); + } + } + + CarbonEmissionItemDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCarbonEmissionItemDetail(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CarbonEmissionItemDetail)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionItemDetail.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionItemDetail.cs new file mode 100644 index 000000000000..f29c47a7e02f --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionItemDetail.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + /// Response for detailed carbon emissions. + public partial class CarbonEmissionItemDetail : CarbonEmission + { + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// Item name, it can be resource name, resource type name, location, resource group name or subscriptionId. It depends on category type. + /// Item category, see supported type value defined in CategoryTypeEnum. + /// is null. + internal CarbonEmissionItemDetail(double latestMonthEmissions, double previousMonthEmissions, string itemName, CategoryTypeEnum categoryType) : base(latestMonthEmissions, previousMonthEmissions) + { + Argument.AssertNotNull(itemName, nameof(itemName)); + + ItemName = itemName; + CategoryType = categoryType; + DataType = ResponseDataTypeEnum.ItemDetailsData; + } + + /// Initializes a new instance of . + /// The data type of the query result, indicating the format of the returned response. + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Keeps track of any properties unknown to the library. + /// Item name, it can be resource name, resource type name, location, resource group name or subscriptionId. It depends on category type. + /// Item category, see supported type value defined in CategoryTypeEnum. + internal CarbonEmissionItemDetail(ResponseDataTypeEnum dataType, double latestMonthEmissions, double previousMonthEmissions, double? monthOverMonthEmissionsChangeRatio, double? monthlyEmissionsChangeValue, IDictionary serializedAdditionalRawData, string itemName, CategoryTypeEnum categoryType) : base(dataType, latestMonthEmissions, previousMonthEmissions, monthOverMonthEmissionsChangeRatio, monthlyEmissionsChangeValue, serializedAdditionalRawData) + { + ItemName = itemName; + CategoryType = categoryType; + DataType = dataType; + } + + /// Initializes a new instance of for deserialization. + internal CarbonEmissionItemDetail() + { + } + + /// Item name, it can be resource name, resource type name, location, resource group name or subscriptionId. It depends on category type. + public string ItemName { get; } + /// Item category, see supported type value defined in CategoryTypeEnum. + public CategoryTypeEnum CategoryType { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionMonthlySummary.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionMonthlySummary.Serialization.cs new file mode 100644 index 000000000000..efce95f98998 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionMonthlySummary.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + public partial class CarbonEmissionMonthlySummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CarbonEmissionMonthlySummary)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("date"u8); + writer.WriteStringValue(Date); + writer.WritePropertyName("carbonIntensity"u8); + writer.WriteNumberValue(CarbonIntensity); + } + + CarbonEmissionMonthlySummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CarbonEmissionMonthlySummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCarbonEmissionMonthlySummary(document.RootElement, options); + } + + internal static CarbonEmissionMonthlySummary DeserializeCarbonEmissionMonthlySummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string date = default; + double carbonIntensity = default; + ResponseDataTypeEnum dataType = default; + double latestMonthEmissions = default; + double previousMonthEmissions = default; + double? monthOverMonthEmissionsChangeRatio = default; + double? monthlyEmissionsChangeValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("date"u8)) + { + date = property.Value.GetString(); + continue; + } + if (property.NameEquals("carbonIntensity"u8)) + { + carbonIntensity = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("dataType"u8)) + { + dataType = new ResponseDataTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestMonthEmissions"u8)) + { + latestMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("previousMonthEmissions"u8)) + { + previousMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthOverMonthEmissionsChangeRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthOverMonthEmissionsChangeRatio = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyEmissionsChangeValue"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyEmissionsChangeValue = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CarbonEmissionMonthlySummary( + dataType, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData, + date, + carbonIntensity); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CarbonEmissionMonthlySummary)} does not support writing '{options.Format}' format."); + } + } + + CarbonEmissionMonthlySummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCarbonEmissionMonthlySummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CarbonEmissionMonthlySummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionMonthlySummary.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionMonthlySummary.cs new file mode 100644 index 000000000000..348ca9bf1f14 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionMonthlySummary.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + /// Response for Monthly Carbon Emissions Summary. + public partial class CarbonEmissionMonthlySummary : CarbonEmission + { + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The date, representing the month, for which the emissions data is reported, formatted as yyyy-MM-dd (e.g., 2024-03-01). + /// Carbon intensity for the specified month, typically in units of kgCO2E per unit of normalized usage. + /// is null. + internal CarbonEmissionMonthlySummary(double latestMonthEmissions, double previousMonthEmissions, string date, double carbonIntensity) : base(latestMonthEmissions, previousMonthEmissions) + { + Argument.AssertNotNull(date, nameof(date)); + + Date = date; + CarbonIntensity = carbonIntensity; + DataType = ResponseDataTypeEnum.MonthlySummaryData; + } + + /// Initializes a new instance of . + /// The data type of the query result, indicating the format of the returned response. + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Keeps track of any properties unknown to the library. + /// The date, representing the month, for which the emissions data is reported, formatted as yyyy-MM-dd (e.g., 2024-03-01). + /// Carbon intensity for the specified month, typically in units of kgCO2E per unit of normalized usage. + internal CarbonEmissionMonthlySummary(ResponseDataTypeEnum dataType, double latestMonthEmissions, double previousMonthEmissions, double? monthOverMonthEmissionsChangeRatio, double? monthlyEmissionsChangeValue, IDictionary serializedAdditionalRawData, string date, double carbonIntensity) : base(dataType, latestMonthEmissions, previousMonthEmissions, monthOverMonthEmissionsChangeRatio, monthlyEmissionsChangeValue, serializedAdditionalRawData) + { + Date = date; + CarbonIntensity = carbonIntensity; + DataType = dataType; + } + + /// Initializes a new instance of for deserialization. + internal CarbonEmissionMonthlySummary() + { + } + + /// The date, representing the month, for which the emissions data is reported, formatted as yyyy-MM-dd (e.g., 2024-03-01). + public string Date { get; } + /// Carbon intensity for the specified month, typically in units of kgCO2E per unit of normalized usage. + public double CarbonIntensity { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionOverallSummary.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionOverallSummary.Serialization.cs new file mode 100644 index 000000000000..dbc2988336fe --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionOverallSummary.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.CarbonOptimization.Models +{ + public partial class CarbonEmissionOverallSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CarbonEmissionOverallSummary)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + CarbonEmissionOverallSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CarbonEmissionOverallSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCarbonEmissionOverallSummary(document.RootElement, options); + } + + internal static CarbonEmissionOverallSummary DeserializeCarbonEmissionOverallSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResponseDataTypeEnum dataType = default; + double latestMonthEmissions = default; + double previousMonthEmissions = default; + double? monthOverMonthEmissionsChangeRatio = default; + double? monthlyEmissionsChangeValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dataType"u8)) + { + dataType = new ResponseDataTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestMonthEmissions"u8)) + { + latestMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("previousMonthEmissions"u8)) + { + previousMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthOverMonthEmissionsChangeRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthOverMonthEmissionsChangeRatio = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyEmissionsChangeValue"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyEmissionsChangeValue = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CarbonEmissionOverallSummary( + dataType, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CarbonEmissionOverallSummary)} does not support writing '{options.Format}' format."); + } + } + + CarbonEmissionOverallSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCarbonEmissionOverallSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CarbonEmissionOverallSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionOverallSummary.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionOverallSummary.cs new file mode 100644 index 000000000000..f18a439bb061 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionOverallSummary.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + /// Response for Overall Carbon Emissions Summary. + public partial class CarbonEmissionOverallSummary : CarbonEmission + { + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + internal CarbonEmissionOverallSummary(double latestMonthEmissions, double previousMonthEmissions) : base(latestMonthEmissions, previousMonthEmissions) + { + DataType = ResponseDataTypeEnum.OverallSummaryData; + } + + /// Initializes a new instance of . + /// The data type of the query result, indicating the format of the returned response. + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Keeps track of any properties unknown to the library. + internal CarbonEmissionOverallSummary(ResponseDataTypeEnum dataType, double latestMonthEmissions, double previousMonthEmissions, double? monthOverMonthEmissionsChangeRatio, double? monthlyEmissionsChangeValue, IDictionary serializedAdditionalRawData) : base(dataType, latestMonthEmissions, previousMonthEmissions, monthOverMonthEmissionsChangeRatio, monthlyEmissionsChangeValue, serializedAdditionalRawData) + { + DataType = dataType; + } + + /// Initializes a new instance of for deserialization. + internal CarbonEmissionOverallSummary() + { + } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemMonthlySummary.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemMonthlySummary.Serialization.cs new file mode 100644 index 000000000000..8bd874977850 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemMonthlySummary.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + public partial class CarbonEmissionTopItemMonthlySummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CarbonEmissionTopItemMonthlySummary)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("itemName"u8); + writer.WriteStringValue(ItemName); + writer.WritePropertyName("categoryType"u8); + writer.WriteStringValue(CategoryType.ToString()); + writer.WritePropertyName("date"u8); + writer.WriteStringValue(Date); + } + + CarbonEmissionTopItemMonthlySummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CarbonEmissionTopItemMonthlySummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCarbonEmissionTopItemMonthlySummary(document.RootElement, options); + } + + internal static CarbonEmissionTopItemMonthlySummary DeserializeCarbonEmissionTopItemMonthlySummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string itemName = default; + CategoryTypeEnum categoryType = default; + string date = default; + ResponseDataTypeEnum dataType = default; + double latestMonthEmissions = default; + double previousMonthEmissions = default; + double? monthOverMonthEmissionsChangeRatio = default; + double? monthlyEmissionsChangeValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("itemName"u8)) + { + itemName = property.Value.GetString(); + continue; + } + if (property.NameEquals("categoryType"u8)) + { + categoryType = new CategoryTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("date"u8)) + { + date = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataType"u8)) + { + dataType = new ResponseDataTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestMonthEmissions"u8)) + { + latestMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("previousMonthEmissions"u8)) + { + previousMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthOverMonthEmissionsChangeRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthOverMonthEmissionsChangeRatio = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyEmissionsChangeValue"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyEmissionsChangeValue = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CarbonEmissionTopItemMonthlySummary( + dataType, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData, + itemName, + categoryType, + date); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CarbonEmissionTopItemMonthlySummary)} does not support writing '{options.Format}' format."); + } + } + + CarbonEmissionTopItemMonthlySummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCarbonEmissionTopItemMonthlySummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CarbonEmissionTopItemMonthlySummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemMonthlySummary.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemMonthlySummary.cs new file mode 100644 index 000000000000..5ab314c93c23 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemMonthlySummary.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + /// Response for Top Items Carbon Emissions by Month. + public partial class CarbonEmissionTopItemMonthlySummary : CarbonEmission + { + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// Item name, it can be resource name, resource type name, location, resource group name or subscriptionId. It depends on category type. + /// Item category, see supported type value defined in CategoryTypeEnum. + /// The date, representing the month, for which the emissions data is reported, formatted as yyyy-MM-dd (e.g., 2024-03-01). + /// or is null. + internal CarbonEmissionTopItemMonthlySummary(double latestMonthEmissions, double previousMonthEmissions, string itemName, CategoryTypeEnum categoryType, string date) : base(latestMonthEmissions, previousMonthEmissions) + { + Argument.AssertNotNull(itemName, nameof(itemName)); + Argument.AssertNotNull(date, nameof(date)); + + ItemName = itemName; + CategoryType = categoryType; + Date = date; + DataType = ResponseDataTypeEnum.TopItemsMonthlySummaryData; + } + + /// Initializes a new instance of . + /// The data type of the query result, indicating the format of the returned response. + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Keeps track of any properties unknown to the library. + /// Item name, it can be resource name, resource type name, location, resource group name or subscriptionId. It depends on category type. + /// Item category, see supported type value defined in CategoryTypeEnum. + /// The date, representing the month, for which the emissions data is reported, formatted as yyyy-MM-dd (e.g., 2024-03-01). + internal CarbonEmissionTopItemMonthlySummary(ResponseDataTypeEnum dataType, double latestMonthEmissions, double previousMonthEmissions, double? monthOverMonthEmissionsChangeRatio, double? monthlyEmissionsChangeValue, IDictionary serializedAdditionalRawData, string itemName, CategoryTypeEnum categoryType, string date) : base(dataType, latestMonthEmissions, previousMonthEmissions, monthOverMonthEmissionsChangeRatio, monthlyEmissionsChangeValue, serializedAdditionalRawData) + { + ItemName = itemName; + CategoryType = categoryType; + Date = date; + DataType = dataType; + } + + /// Initializes a new instance of for deserialization. + internal CarbonEmissionTopItemMonthlySummary() + { + } + + /// Item name, it can be resource name, resource type name, location, resource group name or subscriptionId. It depends on category type. + public string ItemName { get; } + /// Item category, see supported type value defined in CategoryTypeEnum. + public CategoryTypeEnum CategoryType { get; } + /// The date, representing the month, for which the emissions data is reported, formatted as yyyy-MM-dd (e.g., 2024-03-01). + public string Date { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemsSummary.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemsSummary.Serialization.cs new file mode 100644 index 000000000000..b046233c2558 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemsSummary.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + public partial class CarbonEmissionTopItemsSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CarbonEmissionTopItemsSummary)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("itemName"u8); + writer.WriteStringValue(ItemName); + writer.WritePropertyName("categoryType"u8); + writer.WriteStringValue(CategoryType.ToString()); + } + + CarbonEmissionTopItemsSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CarbonEmissionTopItemsSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCarbonEmissionTopItemsSummary(document.RootElement, options); + } + + internal static CarbonEmissionTopItemsSummary DeserializeCarbonEmissionTopItemsSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string itemName = default; + CategoryTypeEnum categoryType = default; + ResponseDataTypeEnum dataType = default; + double latestMonthEmissions = default; + double previousMonthEmissions = default; + double? monthOverMonthEmissionsChangeRatio = default; + double? monthlyEmissionsChangeValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("itemName"u8)) + { + itemName = property.Value.GetString(); + continue; + } + if (property.NameEquals("categoryType"u8)) + { + categoryType = new CategoryTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("dataType"u8)) + { + dataType = new ResponseDataTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestMonthEmissions"u8)) + { + latestMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("previousMonthEmissions"u8)) + { + previousMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthOverMonthEmissionsChangeRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthOverMonthEmissionsChangeRatio = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyEmissionsChangeValue"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyEmissionsChangeValue = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CarbonEmissionTopItemsSummary( + dataType, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData, + itemName, + categoryType); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CarbonEmissionTopItemsSummary)} does not support writing '{options.Format}' format."); + } + } + + CarbonEmissionTopItemsSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCarbonEmissionTopItemsSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CarbonEmissionTopItemsSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemsSummary.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemsSummary.cs new file mode 100644 index 000000000000..df6b1a3dc429 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CarbonEmissionTopItemsSummary.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + /// Response for Top Items by Category Type. + public partial class CarbonEmissionTopItemsSummary : CarbonEmission + { + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The identifier of the item being reported on, which could refer to the resource name, resource type name, location, resource group name, or subscription ID, depending on the specified category type. + /// The category type of the item. This defines which dimension the emissions are aggregated by, and the supported values are defined in CategoryTypeEnum (e.g., Subscription, ResourceGroup, Resource, etc.). + /// is null. + internal CarbonEmissionTopItemsSummary(double latestMonthEmissions, double previousMonthEmissions, string itemName, CategoryTypeEnum categoryType) : base(latestMonthEmissions, previousMonthEmissions) + { + Argument.AssertNotNull(itemName, nameof(itemName)); + + ItemName = itemName; + CategoryType = categoryType; + DataType = ResponseDataTypeEnum.TopItemsSummaryData; + } + + /// Initializes a new instance of . + /// The data type of the query result, indicating the format of the returned response. + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Keeps track of any properties unknown to the library. + /// The identifier of the item being reported on, which could refer to the resource name, resource type name, location, resource group name, or subscription ID, depending on the specified category type. + /// The category type of the item. This defines which dimension the emissions are aggregated by, and the supported values are defined in CategoryTypeEnum (e.g., Subscription, ResourceGroup, Resource, etc.). + internal CarbonEmissionTopItemsSummary(ResponseDataTypeEnum dataType, double latestMonthEmissions, double previousMonthEmissions, double? monthOverMonthEmissionsChangeRatio, double? monthlyEmissionsChangeValue, IDictionary serializedAdditionalRawData, string itemName, CategoryTypeEnum categoryType) : base(dataType, latestMonthEmissions, previousMonthEmissions, monthOverMonthEmissionsChangeRatio, monthlyEmissionsChangeValue, serializedAdditionalRawData) + { + ItemName = itemName; + CategoryType = categoryType; + DataType = dataType; + } + + /// Initializes a new instance of for deserialization. + internal CarbonEmissionTopItemsSummary() + { + } + + /// The identifier of the item being reported on, which could refer to the resource name, resource type name, location, resource group name, or subscription ID, depending on the specified category type. + public string ItemName { get; } + /// The category type of the item. This defines which dimension the emissions are aggregated by, and the supported values are defined in CategoryTypeEnum (e.g., Subscription, ResourceGroup, Resource, etc.). + public CategoryTypeEnum CategoryType { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CategoryTypeEnum.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CategoryTypeEnum.cs new file mode 100644 index 000000000000..f042892313ac --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/CategoryTypeEnum.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.CarbonOptimization.Models +{ + /// Supported category types to be used with QueryParameter. Each type represents a different level of emissions data aggregation. + public readonly partial struct CategoryTypeEnum : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CategoryTypeEnum(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SubscriptionValue = "Subscription"; + private const string ResourceGroupValue = "ResourceGroup"; + private const string LocationValue = "Location"; + private const string ResourceValue = "Resource"; + private const string ResourceTypeValue = "ResourceType"; + + /// Emissions aggregated at the subscription level. + public static CategoryTypeEnum Subscription { get; } = new CategoryTypeEnum(SubscriptionValue); + /// Emissions aggregated at the resource group level. + public static CategoryTypeEnum ResourceGroup { get; } = new CategoryTypeEnum(ResourceGroupValue); + /// Emissions aggregated at the location level. + public static CategoryTypeEnum Location { get; } = new CategoryTypeEnum(LocationValue); + /// Emissions aggregated at the resource level. + public static CategoryTypeEnum Resource { get; } = new CategoryTypeEnum(ResourceValue); + /// Emissions aggregated at the resource type level. + public static CategoryTypeEnum ResourceType { get; } = new CategoryTypeEnum(ResourceTypeValue); + /// Determines if two values are the same. + public static bool operator ==(CategoryTypeEnum left, CategoryTypeEnum right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CategoryTypeEnum left, CategoryTypeEnum right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CategoryTypeEnum(string value) => new CategoryTypeEnum(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CategoryTypeEnum other && Equals(other); + /// + public bool Equals(CategoryTypeEnum 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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/DateRange.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/DateRange.Serialization.cs new file mode 100644 index 000000000000..cbcdc2f386b9 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/DateRange.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.CarbonOptimization.Models +{ + public partial class DateRange : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DateRange)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("start"u8); + writer.WriteStringValue(Start, "D"); + writer.WritePropertyName("end"u8); + writer.WriteStringValue(End, "D"); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DateRange IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DateRange)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDateRange(document.RootElement, options); + } + + internal static DateRange DeserializeDateRange(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset start = default; + DateTimeOffset end = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("start"u8)) + { + start = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("end"u8)) + { + end = property.Value.GetDateTimeOffset("D"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DateRange(start, end, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DateRange)} does not support writing '{options.Format}' format."); + } + } + + DateRange IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDateRange(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DateRange)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/DateRange.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/DateRange.cs new file mode 100644 index 000000000000..5ec796f89d27 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/DateRange.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.CarbonOptimization.Models +{ + /// Date range to be used with QueryParameter, it should be within 12 months between start and end date. In certain cases, start and end dates must be the same date. + public partial class DateRange + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Start date parameter in yyyy-MM-01 format. Only the first day of each month is accepted. + /// End date parameter in yyyy-MM-01 format. Only the first day of each month is accepted. + public DateRange(DateTimeOffset start, DateTimeOffset end) + { + Start = start; + End = end; + } + + /// Initializes a new instance of . + /// Start date parameter in yyyy-MM-01 format. Only the first day of each month is accepted. + /// End date parameter in yyyy-MM-01 format. Only the first day of each month is accepted. + /// Keeps track of any properties unknown to the library. + internal DateRange(DateTimeOffset start, DateTimeOffset end, IDictionary serializedAdditionalRawData) + { + Start = start; + End = end; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DateRange() + { + } + + /// Start date parameter in yyyy-MM-01 format. Only the first day of each month is accepted. + public DateTimeOffset Start { get; } + /// End date parameter in yyyy-MM-01 format. Only the first day of each month is accepted. + public DateTimeOffset End { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/EmissionScopeEnum.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/EmissionScopeEnum.cs new file mode 100644 index 000000000000..ac500e6ef905 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/EmissionScopeEnum.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.CarbonOptimization.Models +{ + /// Supported carbon emission scopes to be used with QueryParameter, as defined by the GHG Protocol. At least one scope must be specified. The output will return a total of all specified scopes. + public readonly partial struct EmissionScopeEnum : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EmissionScopeEnum(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Scope1Value = "Scope1"; + private const string Scope2Value = "Scope2"; + private const string Scope3Value = "Scope3"; + + /// Scope1 carbon emission. + public static EmissionScopeEnum Scope1 { get; } = new EmissionScopeEnum(Scope1Value); + /// Scope2 carbon emission. + public static EmissionScopeEnum Scope2 { get; } = new EmissionScopeEnum(Scope2Value); + /// Scope3 carbon emission. + public static EmissionScopeEnum Scope3 { get; } = new EmissionScopeEnum(Scope3Value); + /// Determines if two values are the same. + public static bool operator ==(EmissionScopeEnum left, EmissionScopeEnum right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EmissionScopeEnum left, EmissionScopeEnum right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EmissionScopeEnum(string value) => new EmissionScopeEnum(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EmissionScopeEnum other && Equals(other); + /// + public bool Equals(EmissionScopeEnum 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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ItemDetailsQueryFilter.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ItemDetailsQueryFilter.Serialization.cs new file mode 100644 index 000000000000..405231b3984f --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ItemDetailsQueryFilter.Serialization.cs @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + public partial class ItemDetailsQueryFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ItemDetailsQueryFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("categoryType"u8); + writer.WriteStringValue(CategoryType.ToString()); + writer.WritePropertyName("orderBy"u8); + writer.WriteStringValue(OrderBy.ToString()); + writer.WritePropertyName("sortDirection"u8); + writer.WriteStringValue(SortDirection.ToString()); + writer.WritePropertyName("pageSize"u8); + writer.WriteNumberValue(PageSize); + if (Optional.IsDefined(SkipToken)) + { + writer.WritePropertyName("skipToken"u8); + writer.WriteStringValue(SkipToken); + } + } + + ItemDetailsQueryFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ItemDetailsQueryFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeItemDetailsQueryFilter(document.RootElement, options); + } + + internal static ItemDetailsQueryFilter DeserializeItemDetailsQueryFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CategoryTypeEnum categoryType = default; + OrderByColumnEnum orderBy = default; + SortDirectionEnum sortDirection = default; + int pageSize = default; + string skipToken = default; + ReportTypeEnum reportType = default; + DateRange dateRange = default; + IList subscriptionList = default; + IList resourceGroupUrlList = default; + IList resourceTypeList = default; + IList locationList = default; + IList carbonScopeList = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("categoryType"u8)) + { + categoryType = new CategoryTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("orderBy"u8)) + { + orderBy = new OrderByColumnEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("sortDirection"u8)) + { + sortDirection = new SortDirectionEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("pageSize"u8)) + { + pageSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("skipToken"u8)) + { + skipToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("reportType"u8)) + { + reportType = new ReportTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("dateRange"u8)) + { + dateRange = DateRange.DeserializeDateRange(property.Value, options); + continue; + } + if (property.NameEquals("subscriptionList"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + subscriptionList = array; + continue; + } + if (property.NameEquals("resourceGroupUrlList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceGroupUrlList = array; + continue; + } + if (property.NameEquals("resourceTypeList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceTypeList = array; + continue; + } + if (property.NameEquals("locationList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + locationList = array; + continue; + } + if (property.NameEquals("carbonScopeList"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new EmissionScopeEnum(item.GetString())); + } + carbonScopeList = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ItemDetailsQueryFilter( + reportType, + dateRange, + subscriptionList, + resourceGroupUrlList ?? new ChangeTrackingList(), + resourceTypeList ?? new ChangeTrackingList(), + locationList ?? new ChangeTrackingList(), + carbonScopeList, + serializedAdditionalRawData, + categoryType, + orderBy, + sortDirection, + pageSize, + skipToken); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ItemDetailsQueryFilter)} does not support writing '{options.Format}' format."); + } + } + + ItemDetailsQueryFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeItemDetailsQueryFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ItemDetailsQueryFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ItemDetailsQueryFilter.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ItemDetailsQueryFilter.cs new file mode 100644 index 000000000000..c398a596fb88 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ItemDetailsQueryFilter.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.CarbonOptimization.Models +{ + /// Query Parameters for ItemDetailsReport. + public partial class ItemDetailsQueryFilter : QueryFilter + { + /// Initializes a new instance of . + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// Specifies the category type for detailed emissions data, such as Resource, ResourceGroup, ResourceType, Location, or Subscription. See supported types in CategoryTypeEnum. + /// The column name to order the results by. See supported values in OrderByColumnEnum. + /// Direction for sorting results. See supported values in SortDirectionEnum. + /// Number of items to return in one request, max value is 5000. + /// , or is null. + public ItemDetailsQueryFilter(DateRange dateRange, IEnumerable subscriptionList, IEnumerable carbonScopeList, CategoryTypeEnum categoryType, OrderByColumnEnum orderBy, SortDirectionEnum sortDirection, int pageSize) : base(dateRange, subscriptionList, carbonScopeList) + { + Argument.AssertNotNull(dateRange, nameof(dateRange)); + Argument.AssertNotNull(subscriptionList, nameof(subscriptionList)); + Argument.AssertNotNull(carbonScopeList, nameof(carbonScopeList)); + + CategoryType = categoryType; + OrderBy = orderBy; + SortDirection = sortDirection; + PageSize = pageSize; + ReportType = ReportTypeEnum.ItemDetailsReport; + } + + /// Initializes a new instance of . + /// The ReportType requested for carbon emissions data. Required. Specifies how data is aggregated and displayed in the output, as explained in the ReportTypeEnum. + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase. + /// List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'. + /// List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// Keeps track of any properties unknown to the library. + /// Specifies the category type for detailed emissions data, such as Resource, ResourceGroup, ResourceType, Location, or Subscription. See supported types in CategoryTypeEnum. + /// The column name to order the results by. See supported values in OrderByColumnEnum. + /// Direction for sorting results. See supported values in SortDirectionEnum. + /// Number of items to return in one request, max value is 5000. + /// Pagination token for fetching the next page of data. This token is nullable and will be returned in the previous response if additional data pages are available. + internal ItemDetailsQueryFilter(ReportTypeEnum reportType, DateRange dateRange, IList subscriptionList, IList resourceGroupUrlList, IList resourceTypeList, IList locationList, IList carbonScopeList, IDictionary serializedAdditionalRawData, CategoryTypeEnum categoryType, OrderByColumnEnum orderBy, SortDirectionEnum sortDirection, int pageSize, string skipToken) : base(reportType, dateRange, subscriptionList, resourceGroupUrlList, resourceTypeList, locationList, carbonScopeList, serializedAdditionalRawData) + { + CategoryType = categoryType; + OrderBy = orderBy; + SortDirection = sortDirection; + PageSize = pageSize; + SkipToken = skipToken; + ReportType = reportType; + } + + /// Initializes a new instance of for deserialization. + internal ItemDetailsQueryFilter() + { + } + + /// Specifies the category type for detailed emissions data, such as Resource, ResourceGroup, ResourceType, Location, or Subscription. See supported types in CategoryTypeEnum. + public CategoryTypeEnum CategoryType { get; } + /// The column name to order the results by. See supported values in OrderByColumnEnum. + public OrderByColumnEnum OrderBy { get; } + /// Direction for sorting results. See supported values in SortDirectionEnum. + public SortDirectionEnum SortDirection { get; } + /// Number of items to return in one request, max value is 5000. + public int PageSize { get; } + /// Pagination token for fetching the next page of data. This token is nullable and will be returned in the previous response if additional data pages are available. + public string SkipToken { get; set; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/MonthlySummaryReportQueryFilter.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/MonthlySummaryReportQueryFilter.Serialization.cs new file mode 100644 index 000000000000..daa700a0cdea --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/MonthlySummaryReportQueryFilter.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + public partial class MonthlySummaryReportQueryFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(MonthlySummaryReportQueryFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + MonthlySummaryReportQueryFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonthlySummaryReportQueryFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonthlySummaryReportQueryFilter(document.RootElement, options); + } + + internal static MonthlySummaryReportQueryFilter DeserializeMonthlySummaryReportQueryFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ReportTypeEnum reportType = default; + DateRange dateRange = default; + IList subscriptionList = default; + IList resourceGroupUrlList = default; + IList resourceTypeList = default; + IList locationList = default; + IList carbonScopeList = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("reportType"u8)) + { + reportType = new ReportTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("dateRange"u8)) + { + dateRange = DateRange.DeserializeDateRange(property.Value, options); + continue; + } + if (property.NameEquals("subscriptionList"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + subscriptionList = array; + continue; + } + if (property.NameEquals("resourceGroupUrlList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceGroupUrlList = array; + continue; + } + if (property.NameEquals("resourceTypeList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceTypeList = array; + continue; + } + if (property.NameEquals("locationList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + locationList = array; + continue; + } + if (property.NameEquals("carbonScopeList"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new EmissionScopeEnum(item.GetString())); + } + carbonScopeList = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonthlySummaryReportQueryFilter( + reportType, + dateRange, + subscriptionList, + resourceGroupUrlList ?? new ChangeTrackingList(), + resourceTypeList ?? new ChangeTrackingList(), + locationList ?? new ChangeTrackingList(), + carbonScopeList, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonthlySummaryReportQueryFilter)} does not support writing '{options.Format}' format."); + } + } + + MonthlySummaryReportQueryFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMonthlySummaryReportQueryFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonthlySummaryReportQueryFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/MonthlySummaryReportQueryFilter.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/MonthlySummaryReportQueryFilter.cs new file mode 100644 index 000000000000..7a92441df6f1 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/MonthlySummaryReportQueryFilter.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + /// Query filter parameter to configure MonthlySummaryReport queries. + public partial class MonthlySummaryReportQueryFilter : QueryFilter + { + /// Initializes a new instance of . + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// , or is null. + public MonthlySummaryReportQueryFilter(DateRange dateRange, IEnumerable subscriptionList, IEnumerable carbonScopeList) : base(dateRange, subscriptionList, carbonScopeList) + { + Argument.AssertNotNull(dateRange, nameof(dateRange)); + Argument.AssertNotNull(subscriptionList, nameof(subscriptionList)); + Argument.AssertNotNull(carbonScopeList, nameof(carbonScopeList)); + + ReportType = ReportTypeEnum.MonthlySummaryReport; + } + + /// Initializes a new instance of . + /// The ReportType requested for carbon emissions data. Required. Specifies how data is aggregated and displayed in the output, as explained in the ReportTypeEnum. + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase. + /// List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'. + /// List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// Keeps track of any properties unknown to the library. + internal MonthlySummaryReportQueryFilter(ReportTypeEnum reportType, DateRange dateRange, IList subscriptionList, IList resourceGroupUrlList, IList resourceTypeList, IList locationList, IList carbonScopeList, IDictionary serializedAdditionalRawData) : base(reportType, dateRange, subscriptionList, resourceGroupUrlList, resourceTypeList, locationList, carbonScopeList, serializedAdditionalRawData) + { + ReportType = reportType; + } + + /// Initializes a new instance of for deserialization. + internal MonthlySummaryReportQueryFilter() + { + } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/OrderByColumnEnum.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/OrderByColumnEnum.cs new file mode 100644 index 000000000000..d7c2ebf7b049 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/OrderByColumnEnum.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.CarbonOptimization.Models +{ + /// Sorting is supported for columns in ItemDetailsReport. This object includes the column names that sorting is allowed for. Select one of these supported values. + public readonly partial struct OrderByColumnEnum : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OrderByColumnEnum(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ItemNameValue = "ItemName"; + private const string LatestMonthEmissionsValue = "LatestMonthEmissions"; + private const string PreviousMonthEmissionsValue = "PreviousMonthEmissions"; + private const string MonthOverMonthEmissionsChangeRatioValue = "MonthOverMonthEmissionsChangeRatio"; + private const string MonthlyEmissionsChangeValueValue = "MonthlyEmissionsChangeValue"; + private const string ResourceGroupValue = "ResourceGroup"; + + /// The itemName filed in ItemDetailsReport result, see CarbonEmissionItemDetailData for more information. + public static OrderByColumnEnum ItemName { get; } = new OrderByColumnEnum(ItemNameValue); + /// The latestMonthEmissions filed in ItemDetailsReport result, see CarbonEmissionItemDetailData for more information. + public static OrderByColumnEnum LatestMonthEmissions { get; } = new OrderByColumnEnum(LatestMonthEmissionsValue); + /// The previousMonthEmissions filed in ItemDetailsReport result, see CarbonEmissionItemDetailData for more information. + public static OrderByColumnEnum PreviousMonthEmissions { get; } = new OrderByColumnEnum(PreviousMonthEmissionsValue); + /// The monthOverMonthEmissionsChangeRatio filed in ItemDetailsReport result, see CarbonEmissionItemDetailData for more information. + public static OrderByColumnEnum MonthOverMonthEmissionsChangeRatio { get; } = new OrderByColumnEnum(MonthOverMonthEmissionsChangeRatioValue); + /// The monthlyEmissionsChangeValue filed in ItemDetailsReport result, see CarbonEmissionItemDetailData for more information. + public static OrderByColumnEnum MonthlyEmissionsChangeValue { get; } = new OrderByColumnEnum(MonthlyEmissionsChangeValueValue); + /// The resourceGroup filed in ResourceCarbonEmissionItemDetailData result, see ResourceCarbonEmissionItemDetailData for more information. + public static OrderByColumnEnum ResourceGroup { get; } = new OrderByColumnEnum(ResourceGroupValue); + /// Determines if two values are the same. + public static bool operator ==(OrderByColumnEnum left, OrderByColumnEnum right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OrderByColumnEnum left, OrderByColumnEnum right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OrderByColumnEnum(string value) => new OrderByColumnEnum(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OrderByColumnEnum other && Equals(other); + /// + public bool Equals(OrderByColumnEnum 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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/OverallSummaryReportQueryFilter.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/OverallSummaryReportQueryFilter.Serialization.cs new file mode 100644 index 000000000000..49b819c42d52 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/OverallSummaryReportQueryFilter.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + public partial class OverallSummaryReportQueryFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(OverallSummaryReportQueryFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + OverallSummaryReportQueryFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OverallSummaryReportQueryFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOverallSummaryReportQueryFilter(document.RootElement, options); + } + + internal static OverallSummaryReportQueryFilter DeserializeOverallSummaryReportQueryFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ReportTypeEnum reportType = default; + DateRange dateRange = default; + IList subscriptionList = default; + IList resourceGroupUrlList = default; + IList resourceTypeList = default; + IList locationList = default; + IList carbonScopeList = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("reportType"u8)) + { + reportType = new ReportTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("dateRange"u8)) + { + dateRange = DateRange.DeserializeDateRange(property.Value, options); + continue; + } + if (property.NameEquals("subscriptionList"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + subscriptionList = array; + continue; + } + if (property.NameEquals("resourceGroupUrlList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceGroupUrlList = array; + continue; + } + if (property.NameEquals("resourceTypeList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceTypeList = array; + continue; + } + if (property.NameEquals("locationList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + locationList = array; + continue; + } + if (property.NameEquals("carbonScopeList"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new EmissionScopeEnum(item.GetString())); + } + carbonScopeList = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OverallSummaryReportQueryFilter( + reportType, + dateRange, + subscriptionList, + resourceGroupUrlList ?? new ChangeTrackingList(), + resourceTypeList ?? new ChangeTrackingList(), + locationList ?? new ChangeTrackingList(), + carbonScopeList, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OverallSummaryReportQueryFilter)} does not support writing '{options.Format}' format."); + } + } + + OverallSummaryReportQueryFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOverallSummaryReportQueryFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OverallSummaryReportQueryFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/OverallSummaryReportQueryFilter.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/OverallSummaryReportQueryFilter.cs new file mode 100644 index 000000000000..55b46a23d466 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/OverallSummaryReportQueryFilter.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + /// Query filter parameter to configure OverallSummaryReport queries. + public partial class OverallSummaryReportQueryFilter : QueryFilter + { + /// Initializes a new instance of . + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// , or is null. + public OverallSummaryReportQueryFilter(DateRange dateRange, IEnumerable subscriptionList, IEnumerable carbonScopeList) : base(dateRange, subscriptionList, carbonScopeList) + { + Argument.AssertNotNull(dateRange, nameof(dateRange)); + Argument.AssertNotNull(subscriptionList, nameof(subscriptionList)); + Argument.AssertNotNull(carbonScopeList, nameof(carbonScopeList)); + + ReportType = ReportTypeEnum.OverallSummaryReport; + } + + /// Initializes a new instance of . + /// The ReportType requested for carbon emissions data. Required. Specifies how data is aggregated and displayed in the output, as explained in the ReportTypeEnum. + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase. + /// List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'. + /// List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// Keeps track of any properties unknown to the library. + internal OverallSummaryReportQueryFilter(ReportTypeEnum reportType, DateRange dateRange, IList subscriptionList, IList resourceGroupUrlList, IList resourceTypeList, IList locationList, IList carbonScopeList, IDictionary serializedAdditionalRawData) : base(reportType, dateRange, subscriptionList, resourceGroupUrlList, resourceTypeList, locationList, carbonScopeList, serializedAdditionalRawData) + { + ReportType = reportType; + } + + /// Initializes a new instance of for deserialization. + internal OverallSummaryReportQueryFilter() + { + } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/QueryFilter.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/QueryFilter.Serialization.cs new file mode 100644 index 000000000000..e815a5b94bff --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/QueryFilter.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.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + [PersistableModelProxy(typeof(UnknownQueryFilter))] + public partial class QueryFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QueryFilter)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("reportType"u8); + writer.WriteStringValue(ReportType.ToString()); + writer.WritePropertyName("dateRange"u8); + writer.WriteObjectValue(DateRange, options); + writer.WritePropertyName("subscriptionList"u8); + writer.WriteStartArray(); + foreach (var item in SubscriptionList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsCollectionDefined(ResourceGroupUrlList)) + { + writer.WritePropertyName("resourceGroupUrlList"u8); + writer.WriteStartArray(); + foreach (var item in ResourceGroupUrlList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ResourceTypeList)) + { + writer.WritePropertyName("resourceTypeList"u8); + writer.WriteStartArray(); + foreach (var item in ResourceTypeList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(LocationList)) + { + writer.WritePropertyName("locationList"u8); + writer.WriteStartArray(); + foreach (var item in LocationList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("carbonScopeList"u8); + writer.WriteStartArray(); + foreach (var item in CarbonScopeList) + { + writer.WriteStringValue(item.ToString()); + } + 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 + } + } + } + + QueryFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QueryFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeQueryFilter(document.RootElement, options); + } + + internal static QueryFilter DeserializeQueryFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("reportType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "ItemDetailsReport": return ItemDetailsQueryFilter.DeserializeItemDetailsQueryFilter(element, options); + case "MonthlySummaryReport": return MonthlySummaryReportQueryFilter.DeserializeMonthlySummaryReportQueryFilter(element, options); + case "OverallSummaryReport": return OverallSummaryReportQueryFilter.DeserializeOverallSummaryReportQueryFilter(element, options); + case "TopItemsMonthlySummaryReport": return TopItemsMonthlySummaryReportQueryFilter.DeserializeTopItemsMonthlySummaryReportQueryFilter(element, options); + case "TopItemsSummaryReport": return TopItemsSummaryReportQueryFilter.DeserializeTopItemsSummaryReportQueryFilter(element, options); + } + } + return UnknownQueryFilter.DeserializeUnknownQueryFilter(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(QueryFilter)} does not support writing '{options.Format}' format."); + } + } + + QueryFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeQueryFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(QueryFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/QueryFilter.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/QueryFilter.cs new file mode 100644 index 000000000000..0f7414e8dcb0 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/QueryFilter.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; +using System.Linq; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + /// + /// Shared query filter parameter to configure carbon emissions data queries for all different report type defined in ReportTypeEnum. + /// 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 QueryFilter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// , or is null. + protected QueryFilter(DateRange dateRange, IEnumerable subscriptionList, IEnumerable carbonScopeList) + { + Argument.AssertNotNull(dateRange, nameof(dateRange)); + Argument.AssertNotNull(subscriptionList, nameof(subscriptionList)); + Argument.AssertNotNull(carbonScopeList, nameof(carbonScopeList)); + + DateRange = dateRange; + SubscriptionList = subscriptionList.ToList(); + ResourceGroupUrlList = new ChangeTrackingList(); + ResourceTypeList = new ChangeTrackingList(); + LocationList = new ChangeTrackingList(); + CarbonScopeList = carbonScopeList.ToList(); + } + + /// Initializes a new instance of . + /// The ReportType requested for carbon emissions data. Required. Specifies how data is aggregated and displayed in the output, as explained in the ReportTypeEnum. + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase. + /// List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'. + /// List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// Keeps track of any properties unknown to the library. + internal QueryFilter(ReportTypeEnum reportType, DateRange dateRange, IList subscriptionList, IList resourceGroupUrlList, IList resourceTypeList, IList locationList, IList carbonScopeList, IDictionary serializedAdditionalRawData) + { + ReportType = reportType; + DateRange = dateRange; + SubscriptionList = subscriptionList; + ResourceGroupUrlList = resourceGroupUrlList; + ResourceTypeList = resourceTypeList; + LocationList = locationList; + CarbonScopeList = carbonScopeList; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal QueryFilter() + { + } + + /// The ReportType requested for carbon emissions data. Required. Specifies how data is aggregated and displayed in the output, as explained in the ReportTypeEnum. + internal ReportTypeEnum ReportType { get; set; } + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + public DateRange DateRange { get; } + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + public IList SubscriptionList { get; } + /// List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase. + public IList ResourceGroupUrlList { get; } + /// List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'. + public IList ResourceTypeList { get; } + /// List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names. + public IList LocationList { get; } + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + public IList CarbonScopeList { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ReportTypeEnum.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ReportTypeEnum.cs new file mode 100644 index 000000000000..9764afb66121 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ReportTypeEnum.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.CarbonOptimization.Models +{ + /// Enum for Report Type, specifying different report formats for carbon emissions data. Each report type returns different aggregations of carbon emissions across various categories, date range, emissions scope, and other parameters. + internal readonly partial struct ReportTypeEnum : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ReportTypeEnum(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OverallSummaryReportValue = "OverallSummaryReport"; + private const string MonthlySummaryReportValue = "MonthlySummaryReport"; + private const string TopItemsSummaryReportValue = "TopItemsSummaryReport"; + private const string TopItemsMonthlySummaryReportValue = "TopItemsMonthlySummaryReport"; + private const string ItemDetailsReportValue = "ItemDetailsReport"; + + /// Overall summary report provides total carbon emissions for the specified date range and query parameters, as well as comparative values for a high-level overview. This report type can accept different values in the start and end fields within DateRange (e.g., start: 2024-03-01 and end: 2024-06-01). + public static ReportTypeEnum OverallSummaryReport { get; } = new ReportTypeEnum(OverallSummaryReportValue); + /// MonthlySummaryReport provides carbon emissions data by month for the specified query parameters. This report type can accept different values in the start and end fields within DateRange (e.g., start: 2024-03-01 and end: 2024-06-01). + public static ReportTypeEnum MonthlySummaryReport { get; } = new ReportTypeEnum(MonthlySummaryReportValue); + /// TopItemsSummaryReport provides the N highest-emitting items for the specified query filters. This report returns data for a single month at a time, so it requires the same values for the start and end fields within DateRange. A maximum of N=10 items can be returned at a time. + public static ReportTypeEnum TopItemsSummaryReport { get; } = new ReportTypeEnum(TopItemsSummaryReportValue); + /// TopItemsMonthlyReport provides the N highest-emitting items by month for the specified query filter. Returns emissions data for the top N items by month within the given date range. A maximum of N=10 items can be returned at a time. + public static ReportTypeEnum TopItemsMonthlySummaryReport { get; } = new ReportTypeEnum(TopItemsMonthlySummaryReportValue); + /// ItemDetailsReport provides a granular list of items based on the specified CategoryType (e.g., Resource, ResourceGroup, ResourceType, Location, or Subscription) for the query filter. This report can be queried for only one month at a time, requiring the same values in the start and end fields within DateRange. + public static ReportTypeEnum ItemDetailsReport { get; } = new ReportTypeEnum(ItemDetailsReportValue); + /// Determines if two values are the same. + public static bool operator ==(ReportTypeEnum left, ReportTypeEnum right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ReportTypeEnum left, ReportTypeEnum right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ReportTypeEnum(string value) => new ReportTypeEnum(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ReportTypeEnum other && Equals(other); + /// + public bool Equals(ReportTypeEnum 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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionItemDetail.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionItemDetail.Serialization.cs new file mode 100644 index 000000000000..cdc83feb0856 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionItemDetail.Serialization.cs @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + public partial class ResourceCarbonEmissionItemDetail : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ResourceCarbonEmissionItemDetail)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("itemName"u8); + writer.WriteStringValue(ItemName); + writer.WritePropertyName("categoryType"u8); + writer.WriteStringValue(CategoryType.ToString()); + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + writer.WritePropertyName("resourceGroup"u8); + writer.WriteStringValue(ResourceGroup); + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(ResourceType)) + { + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType); + } + } + + ResourceCarbonEmissionItemDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceCarbonEmissionItemDetail)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceCarbonEmissionItemDetail(document.RootElement, options); + } + + internal static ResourceCarbonEmissionItemDetail DeserializeResourceCarbonEmissionItemDetail(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string itemName = default; + CategoryTypeEnum categoryType = default; + string subscriptionId = default; + string resourceGroup = default; + string resourceId = default; + string location = default; + string resourceType = default; + ResponseDataTypeEnum dataType = default; + double latestMonthEmissions = default; + double previousMonthEmissions = default; + double? monthOverMonthEmissionsChangeRatio = default; + double? monthlyEmissionsChangeValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("itemName"u8)) + { + itemName = property.Value.GetString(); + continue; + } + if (property.NameEquals("categoryType"u8)) + { + categoryType = new CategoryTypeEnum(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("resourceId"u8)) + { + resourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceType"u8)) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataType"u8)) + { + dataType = new ResponseDataTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestMonthEmissions"u8)) + { + latestMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("previousMonthEmissions"u8)) + { + previousMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthOverMonthEmissionsChangeRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthOverMonthEmissionsChangeRatio = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyEmissionsChangeValue"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyEmissionsChangeValue = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceCarbonEmissionItemDetail( + dataType, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData, + itemName, + categoryType, + subscriptionId, + resourceGroup, + resourceId, + location, + resourceType); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResourceCarbonEmissionItemDetail)} does not support writing '{options.Format}' format."); + } + } + + ResourceCarbonEmissionItemDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeResourceCarbonEmissionItemDetail(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceCarbonEmissionItemDetail)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionItemDetail.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionItemDetail.cs new file mode 100644 index 000000000000..a61bce11feb8 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionItemDetail.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.CarbonOptimization.Models +{ + /// Response for Resource detailed carbon emissions. + public partial class ResourceCarbonEmissionItemDetail : CarbonEmission + { + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// It's resource name. + /// Resource Item category, see supported value defined in CategoryTypeEnum. + /// Subscription Id. + /// Resource Group. + /// The fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// , , or is null. + internal ResourceCarbonEmissionItemDetail(double latestMonthEmissions, double previousMonthEmissions, string itemName, CategoryTypeEnum categoryType, string subscriptionId, string resourceGroup, string resourceId) : base(latestMonthEmissions, previousMonthEmissions) + { + Argument.AssertNotNull(itemName, nameof(itemName)); + Argument.AssertNotNull(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(resourceGroup, nameof(resourceGroup)); + Argument.AssertNotNull(resourceId, nameof(resourceId)); + + ItemName = itemName; + CategoryType = categoryType; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + ResourceId = resourceId; + DataType = ResponseDataTypeEnum.ResourceItemDetailsData; + } + + /// Initializes a new instance of . + /// The data type of the query result, indicating the format of the returned response. + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Keeps track of any properties unknown to the library. + /// It's resource name. + /// Resource Item category, see supported value defined in CategoryTypeEnum. + /// Subscription Id. + /// Resource Group. + /// The fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// Resource Location (e.g., 'east us'). + /// The type of resource, for example: microsoft.storage/storageaccounts. + internal ResourceCarbonEmissionItemDetail(ResponseDataTypeEnum dataType, double latestMonthEmissions, double previousMonthEmissions, double? monthOverMonthEmissionsChangeRatio, double? monthlyEmissionsChangeValue, IDictionary serializedAdditionalRawData, string itemName, CategoryTypeEnum categoryType, string subscriptionId, string resourceGroup, string resourceId, string location, string resourceType) : base(dataType, latestMonthEmissions, previousMonthEmissions, monthOverMonthEmissionsChangeRatio, monthlyEmissionsChangeValue, serializedAdditionalRawData) + { + ItemName = itemName; + CategoryType = categoryType; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + ResourceId = resourceId; + Location = location; + ResourceType = resourceType; + DataType = dataType; + } + + /// Initializes a new instance of for deserialization. + internal ResourceCarbonEmissionItemDetail() + { + } + + /// It's resource name. + public string ItemName { get; } + /// Resource Item category, see supported value defined in CategoryTypeEnum. + public CategoryTypeEnum CategoryType { get; } + /// Subscription Id. + public string SubscriptionId { get; } + /// Resource Group. + public string ResourceGroup { get; } + /// The fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + public string ResourceId { get; } + /// Resource Location (e.g., 'east us'). + public string Location { get; } + /// The type of resource, for example: microsoft.storage/storageaccounts. + public string ResourceType { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemMonthlySummary.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemMonthlySummary.Serialization.cs new file mode 100644 index 000000000000..6496a21a95e8 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemMonthlySummary.Serialization.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + public partial class ResourceCarbonEmissionTopItemMonthlySummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ResourceCarbonEmissionTopItemMonthlySummary)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("itemName"u8); + writer.WriteStringValue(ItemName); + writer.WritePropertyName("categoryType"u8); + writer.WriteStringValue(CategoryType.ToString()); + writer.WritePropertyName("date"u8); + writer.WriteStringValue(Date); + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + writer.WritePropertyName("resourceGroup"u8); + writer.WriteStringValue(ResourceGroup); + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + + ResourceCarbonEmissionTopItemMonthlySummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceCarbonEmissionTopItemMonthlySummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceCarbonEmissionTopItemMonthlySummary(document.RootElement, options); + } + + internal static ResourceCarbonEmissionTopItemMonthlySummary DeserializeResourceCarbonEmissionTopItemMonthlySummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string itemName = default; + CategoryTypeEnum categoryType = default; + string date = default; + string subscriptionId = default; + string resourceGroup = default; + string resourceId = default; + ResponseDataTypeEnum dataType = default; + double latestMonthEmissions = default; + double previousMonthEmissions = default; + double? monthOverMonthEmissionsChangeRatio = default; + double? monthlyEmissionsChangeValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("itemName"u8)) + { + itemName = property.Value.GetString(); + continue; + } + if (property.NameEquals("categoryType"u8)) + { + categoryType = new CategoryTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("date"u8)) + { + date = 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("resourceId"u8)) + { + resourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataType"u8)) + { + dataType = new ResponseDataTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestMonthEmissions"u8)) + { + latestMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("previousMonthEmissions"u8)) + { + previousMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthOverMonthEmissionsChangeRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthOverMonthEmissionsChangeRatio = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyEmissionsChangeValue"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyEmissionsChangeValue = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceCarbonEmissionTopItemMonthlySummary( + dataType, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData, + itemName, + categoryType, + date, + subscriptionId, + resourceGroup, + resourceId); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResourceCarbonEmissionTopItemMonthlySummary)} does not support writing '{options.Format}' format."); + } + } + + ResourceCarbonEmissionTopItemMonthlySummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeResourceCarbonEmissionTopItemMonthlySummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceCarbonEmissionTopItemMonthlySummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemMonthlySummary.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemMonthlySummary.cs new file mode 100644 index 000000000000..a9d1a01a5dc4 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemMonthlySummary.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.CarbonOptimization.Models +{ + /// Response for top items carbon emissions by month for resource. + public partial class ResourceCarbonEmissionTopItemMonthlySummary : CarbonEmission + { + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The resource name of resource for Resource Category. + /// Resource Item category. + /// Monthly date string, format is yyyy-MM-dd. + /// Subscription Id. + /// Resource Group. + /// The fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// , , , or is null. + internal ResourceCarbonEmissionTopItemMonthlySummary(double latestMonthEmissions, double previousMonthEmissions, string itemName, CategoryTypeEnum categoryType, string date, string subscriptionId, string resourceGroup, string resourceId) : base(latestMonthEmissions, previousMonthEmissions) + { + Argument.AssertNotNull(itemName, nameof(itemName)); + Argument.AssertNotNull(date, nameof(date)); + Argument.AssertNotNull(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(resourceGroup, nameof(resourceGroup)); + Argument.AssertNotNull(resourceId, nameof(resourceId)); + + ItemName = itemName; + CategoryType = categoryType; + Date = date; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + ResourceId = resourceId; + DataType = ResponseDataTypeEnum.ResourceTopItemsMonthlySummaryData; + } + + /// Initializes a new instance of . + /// The data type of the query result, indicating the format of the returned response. + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Keeps track of any properties unknown to the library. + /// The resource name of resource for Resource Category. + /// Resource Item category. + /// Monthly date string, format is yyyy-MM-dd. + /// Subscription Id. + /// Resource Group. + /// The fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + internal ResourceCarbonEmissionTopItemMonthlySummary(ResponseDataTypeEnum dataType, double latestMonthEmissions, double previousMonthEmissions, double? monthOverMonthEmissionsChangeRatio, double? monthlyEmissionsChangeValue, IDictionary serializedAdditionalRawData, string itemName, CategoryTypeEnum categoryType, string date, string subscriptionId, string resourceGroup, string resourceId) : base(dataType, latestMonthEmissions, previousMonthEmissions, monthOverMonthEmissionsChangeRatio, monthlyEmissionsChangeValue, serializedAdditionalRawData) + { + ItemName = itemName; + CategoryType = categoryType; + Date = date; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + ResourceId = resourceId; + DataType = dataType; + } + + /// Initializes a new instance of for deserialization. + internal ResourceCarbonEmissionTopItemMonthlySummary() + { + } + + /// The resource name of resource for Resource Category. + public string ItemName { get; } + /// Resource Item category. + public CategoryTypeEnum CategoryType { get; } + /// Monthly date string, format is yyyy-MM-dd. + public string Date { get; } + /// Subscription Id. + public string SubscriptionId { get; } + /// Resource Group. + public string ResourceGroup { get; } + /// The fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + public string ResourceId { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemsSummary.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemsSummary.Serialization.cs new file mode 100644 index 000000000000..8b5691dac8a3 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemsSummary.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.CarbonOptimization.Models +{ + public partial class ResourceCarbonEmissionTopItemsSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ResourceCarbonEmissionTopItemsSummary)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("itemName"u8); + writer.WriteStringValue(ItemName); + writer.WritePropertyName("categoryType"u8); + writer.WriteStringValue(CategoryType.ToString()); + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + writer.WritePropertyName("resourceGroup"u8); + writer.WriteStringValue(ResourceGroup); + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + + ResourceCarbonEmissionTopItemsSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceCarbonEmissionTopItemsSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceCarbonEmissionTopItemsSummary(document.RootElement, options); + } + + internal static ResourceCarbonEmissionTopItemsSummary DeserializeResourceCarbonEmissionTopItemsSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string itemName = default; + CategoryTypeEnum categoryType = default; + string subscriptionId = default; + string resourceGroup = default; + string resourceId = default; + ResponseDataTypeEnum dataType = default; + double latestMonthEmissions = default; + double previousMonthEmissions = default; + double? monthOverMonthEmissionsChangeRatio = default; + double? monthlyEmissionsChangeValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("itemName"u8)) + { + itemName = property.Value.GetString(); + continue; + } + if (property.NameEquals("categoryType"u8)) + { + categoryType = new CategoryTypeEnum(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("resourceId"u8)) + { + resourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataType"u8)) + { + dataType = new ResponseDataTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestMonthEmissions"u8)) + { + latestMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("previousMonthEmissions"u8)) + { + previousMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthOverMonthEmissionsChangeRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthOverMonthEmissionsChangeRatio = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyEmissionsChangeValue"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyEmissionsChangeValue = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceCarbonEmissionTopItemsSummary( + dataType, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData, + itemName, + categoryType, + subscriptionId, + resourceGroup, + resourceId); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResourceCarbonEmissionTopItemsSummary)} does not support writing '{options.Format}' format."); + } + } + + ResourceCarbonEmissionTopItemsSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeResourceCarbonEmissionTopItemsSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceCarbonEmissionTopItemsSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemsSummary.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemsSummary.cs new file mode 100644 index 000000000000..758bc2495d75 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceCarbonEmissionTopItemsSummary.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.CarbonOptimization.Models +{ + /// Response for Top Items For Resource Category. + public partial class ResourceCarbonEmissionTopItemsSummary : CarbonEmission + { + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The resource name of the resource for the Resource Category. + /// The category type of the item. This defines which dimension the emissions are aggregated by, and the supported values are defined in CategoryTypeEnum (e.g., Subscription, ResourceGroup, Resource, etc.). + /// Subscription Id. + /// Resource group name. + /// Resource Id, The URI of the resource for the Resource Category. This identifies the resource being reported. + /// , , or is null. + internal ResourceCarbonEmissionTopItemsSummary(double latestMonthEmissions, double previousMonthEmissions, string itemName, CategoryTypeEnum categoryType, string subscriptionId, string resourceGroup, string resourceId) : base(latestMonthEmissions, previousMonthEmissions) + { + Argument.AssertNotNull(itemName, nameof(itemName)); + Argument.AssertNotNull(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(resourceGroup, nameof(resourceGroup)); + Argument.AssertNotNull(resourceId, nameof(resourceId)); + + ItemName = itemName; + CategoryType = categoryType; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + ResourceId = resourceId; + DataType = ResponseDataTypeEnum.ResourceTopItemsSummaryData; + } + + /// Initializes a new instance of . + /// The data type of the query result, indicating the format of the returned response. + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Keeps track of any properties unknown to the library. + /// The resource name of the resource for the Resource Category. + /// The category type of the item. This defines which dimension the emissions are aggregated by, and the supported values are defined in CategoryTypeEnum (e.g., Subscription, ResourceGroup, Resource, etc.). + /// Subscription Id. + /// Resource group name. + /// Resource Id, The URI of the resource for the Resource Category. This identifies the resource being reported. + internal ResourceCarbonEmissionTopItemsSummary(ResponseDataTypeEnum dataType, double latestMonthEmissions, double previousMonthEmissions, double? monthOverMonthEmissionsChangeRatio, double? monthlyEmissionsChangeValue, IDictionary serializedAdditionalRawData, string itemName, CategoryTypeEnum categoryType, string subscriptionId, string resourceGroup, string resourceId) : base(dataType, latestMonthEmissions, previousMonthEmissions, monthOverMonthEmissionsChangeRatio, monthlyEmissionsChangeValue, serializedAdditionalRawData) + { + ItemName = itemName; + CategoryType = categoryType; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + ResourceId = resourceId; + DataType = dataType; + } + + /// Initializes a new instance of for deserialization. + internal ResourceCarbonEmissionTopItemsSummary() + { + } + + /// The resource name of the resource for the Resource Category. + public string ItemName { get; } + /// The category type of the item. This defines which dimension the emissions are aggregated by, and the supported values are defined in CategoryTypeEnum (e.g., Subscription, ResourceGroup, Resource, etc.). + public CategoryTypeEnum CategoryType { get; } + /// Subscription Id. + public string SubscriptionId { get; } + /// Resource group name. + public string ResourceGroup { get; } + /// Resource Id, The URI of the resource for the Resource Category. This identifies the resource being reported. + public string ResourceId { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionItemDetail.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionItemDetail.Serialization.cs new file mode 100644 index 000000000000..9ee7a85fb43f --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionItemDetail.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.CarbonOptimization.Models +{ + public partial class ResourceGroupCarbonEmissionItemDetail : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ResourceGroupCarbonEmissionItemDetail)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("itemName"u8); + writer.WriteStringValue(ItemName); + writer.WritePropertyName("categoryType"u8); + writer.WriteStringValue(CategoryType.ToString()); + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + writer.WritePropertyName("resourceGroupUrl"u8); + writer.WriteStringValue(ResourceGroupUri); + } + + ResourceGroupCarbonEmissionItemDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceGroupCarbonEmissionItemDetail)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceGroupCarbonEmissionItemDetail(document.RootElement, options); + } + + internal static ResourceGroupCarbonEmissionItemDetail DeserializeResourceGroupCarbonEmissionItemDetail(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string itemName = default; + CategoryTypeEnum categoryType = default; + string subscriptionId = default; + string resourceGroupUrl = default; + ResponseDataTypeEnum dataType = default; + double latestMonthEmissions = default; + double previousMonthEmissions = default; + double? monthOverMonthEmissionsChangeRatio = default; + double? monthlyEmissionsChangeValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("itemName"u8)) + { + itemName = property.Value.GetString(); + continue; + } + if (property.NameEquals("categoryType"u8)) + { + categoryType = new CategoryTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceGroupUrl"u8)) + { + resourceGroupUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataType"u8)) + { + dataType = new ResponseDataTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestMonthEmissions"u8)) + { + latestMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("previousMonthEmissions"u8)) + { + previousMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthOverMonthEmissionsChangeRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthOverMonthEmissionsChangeRatio = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyEmissionsChangeValue"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyEmissionsChangeValue = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceGroupCarbonEmissionItemDetail( + dataType, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData, + itemName, + categoryType, + subscriptionId, + resourceGroupUrl); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResourceGroupCarbonEmissionItemDetail)} does not support writing '{options.Format}' format."); + } + } + + ResourceGroupCarbonEmissionItemDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeResourceGroupCarbonEmissionItemDetail(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceGroupCarbonEmissionItemDetail)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionItemDetail.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionItemDetail.cs new file mode 100644 index 000000000000..70f2bf6b9e10 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionItemDetail.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + /// Response for Resource Group detailed carbon emissions. + public partial class ResourceGroupCarbonEmissionItemDetail : CarbonEmission + { + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// It's resource group name. + /// ResourceGroup Item category. + /// Subscription Id. + /// Resource Group url, value format is '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}'. + /// , or is null. + internal ResourceGroupCarbonEmissionItemDetail(double latestMonthEmissions, double previousMonthEmissions, string itemName, CategoryTypeEnum categoryType, string subscriptionId, string resourceGroupUri) : base(latestMonthEmissions, previousMonthEmissions) + { + Argument.AssertNotNull(itemName, nameof(itemName)); + Argument.AssertNotNull(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(resourceGroupUri, nameof(resourceGroupUri)); + + ItemName = itemName; + CategoryType = categoryType; + SubscriptionId = subscriptionId; + ResourceGroupUri = resourceGroupUri; + DataType = ResponseDataTypeEnum.ResourceGroupItemDetailsData; + } + + /// Initializes a new instance of . + /// The data type of the query result, indicating the format of the returned response. + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Keeps track of any properties unknown to the library. + /// It's resource group name. + /// ResourceGroup Item category. + /// Subscription Id. + /// Resource Group url, value format is '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}'. + internal ResourceGroupCarbonEmissionItemDetail(ResponseDataTypeEnum dataType, double latestMonthEmissions, double previousMonthEmissions, double? monthOverMonthEmissionsChangeRatio, double? monthlyEmissionsChangeValue, IDictionary serializedAdditionalRawData, string itemName, CategoryTypeEnum categoryType, string subscriptionId, string resourceGroupUri) : base(dataType, latestMonthEmissions, previousMonthEmissions, monthOverMonthEmissionsChangeRatio, monthlyEmissionsChangeValue, serializedAdditionalRawData) + { + ItemName = itemName; + CategoryType = categoryType; + SubscriptionId = subscriptionId; + ResourceGroupUri = resourceGroupUri; + DataType = dataType; + } + + /// Initializes a new instance of for deserialization. + internal ResourceGroupCarbonEmissionItemDetail() + { + } + + /// It's resource group name. + public string ItemName { get; } + /// ResourceGroup Item category. + public CategoryTypeEnum CategoryType { get; } + /// Subscription Id. + public string SubscriptionId { get; } + /// Resource Group url, value format is '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}'. + public string ResourceGroupUri { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemMonthlySummary.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemMonthlySummary.Serialization.cs new file mode 100644 index 000000000000..e19e0e3a85f4 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemMonthlySummary.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.CarbonOptimization.Models +{ + public partial class ResourceGroupCarbonEmissionTopItemMonthlySummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ResourceGroupCarbonEmissionTopItemMonthlySummary)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("itemName"u8); + writer.WriteStringValue(ItemName); + writer.WritePropertyName("categoryType"u8); + writer.WriteStringValue(CategoryType.ToString()); + writer.WritePropertyName("date"u8); + writer.WriteStringValue(Date); + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + writer.WritePropertyName("resourceGroupUrl"u8); + writer.WriteStringValue(ResourceGroupUri); + } + + ResourceGroupCarbonEmissionTopItemMonthlySummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceGroupCarbonEmissionTopItemMonthlySummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceGroupCarbonEmissionTopItemMonthlySummary(document.RootElement, options); + } + + internal static ResourceGroupCarbonEmissionTopItemMonthlySummary DeserializeResourceGroupCarbonEmissionTopItemMonthlySummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string itemName = default; + CategoryTypeEnum categoryType = default; + string date = default; + string subscriptionId = default; + string resourceGroupUrl = default; + ResponseDataTypeEnum dataType = default; + double latestMonthEmissions = default; + double previousMonthEmissions = default; + double? monthOverMonthEmissionsChangeRatio = default; + double? monthlyEmissionsChangeValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("itemName"u8)) + { + itemName = property.Value.GetString(); + continue; + } + if (property.NameEquals("categoryType"u8)) + { + categoryType = new CategoryTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("date"u8)) + { + date = property.Value.GetString(); + continue; + } + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceGroupUrl"u8)) + { + resourceGroupUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataType"u8)) + { + dataType = new ResponseDataTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestMonthEmissions"u8)) + { + latestMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("previousMonthEmissions"u8)) + { + previousMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthOverMonthEmissionsChangeRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthOverMonthEmissionsChangeRatio = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyEmissionsChangeValue"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyEmissionsChangeValue = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceGroupCarbonEmissionTopItemMonthlySummary( + dataType, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData, + itemName, + categoryType, + date, + subscriptionId, + resourceGroupUrl); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResourceGroupCarbonEmissionTopItemMonthlySummary)} does not support writing '{options.Format}' format."); + } + } + + ResourceGroupCarbonEmissionTopItemMonthlySummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeResourceGroupCarbonEmissionTopItemMonthlySummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceGroupCarbonEmissionTopItemMonthlySummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemMonthlySummary.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemMonthlySummary.cs new file mode 100644 index 000000000000..eaa8f90e2928 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemMonthlySummary.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.CarbonOptimization.Models +{ + /// Response for top items carbon emissions by month for resource group. + public partial class ResourceGroupCarbonEmissionTopItemMonthlySummary : CarbonEmission + { + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// It's resource group name for ResourceGroup category. + /// ResourceGroup Item category. + /// Monthly date string, format is yyyy-MM-dd. + /// Subscription Id. + /// Resource Group url, the format is '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}'. + /// , , or is null. + internal ResourceGroupCarbonEmissionTopItemMonthlySummary(double latestMonthEmissions, double previousMonthEmissions, string itemName, CategoryTypeEnum categoryType, string date, string subscriptionId, string resourceGroupUri) : base(latestMonthEmissions, previousMonthEmissions) + { + Argument.AssertNotNull(itemName, nameof(itemName)); + Argument.AssertNotNull(date, nameof(date)); + Argument.AssertNotNull(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(resourceGroupUri, nameof(resourceGroupUri)); + + ItemName = itemName; + CategoryType = categoryType; + Date = date; + SubscriptionId = subscriptionId; + ResourceGroupUri = resourceGroupUri; + DataType = ResponseDataTypeEnum.ResourceGroupTopItemsMonthlySummaryData; + } + + /// Initializes a new instance of . + /// The data type of the query result, indicating the format of the returned response. + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Keeps track of any properties unknown to the library. + /// It's resource group name for ResourceGroup category. + /// ResourceGroup Item category. + /// Monthly date string, format is yyyy-MM-dd. + /// Subscription Id. + /// Resource Group url, the format is '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}'. + internal ResourceGroupCarbonEmissionTopItemMonthlySummary(ResponseDataTypeEnum dataType, double latestMonthEmissions, double previousMonthEmissions, double? monthOverMonthEmissionsChangeRatio, double? monthlyEmissionsChangeValue, IDictionary serializedAdditionalRawData, string itemName, CategoryTypeEnum categoryType, string date, string subscriptionId, string resourceGroupUri) : base(dataType, latestMonthEmissions, previousMonthEmissions, monthOverMonthEmissionsChangeRatio, monthlyEmissionsChangeValue, serializedAdditionalRawData) + { + ItemName = itemName; + CategoryType = categoryType; + Date = date; + SubscriptionId = subscriptionId; + ResourceGroupUri = resourceGroupUri; + DataType = dataType; + } + + /// Initializes a new instance of for deserialization. + internal ResourceGroupCarbonEmissionTopItemMonthlySummary() + { + } + + /// It's resource group name for ResourceGroup category. + public string ItemName { get; } + /// ResourceGroup Item category. + public CategoryTypeEnum CategoryType { get; } + /// Monthly date string, format is yyyy-MM-dd. + public string Date { get; } + /// Subscription Id. + public string SubscriptionId { get; } + /// Resource Group url, the format is '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}'. + public string ResourceGroupUri { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemsSummary.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemsSummary.Serialization.cs new file mode 100644 index 000000000000..9e050c5b3bed --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemsSummary.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.CarbonOptimization.Models +{ + public partial class ResourceGroupCarbonEmissionTopItemsSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ResourceGroupCarbonEmissionTopItemsSummary)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("itemName"u8); + writer.WriteStringValue(ItemName); + writer.WritePropertyName("categoryType"u8); + writer.WriteStringValue(CategoryType.ToString()); + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + writer.WritePropertyName("resourceGroupUrl"u8); + writer.WriteStringValue(ResourceGroupUri); + } + + ResourceGroupCarbonEmissionTopItemsSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceGroupCarbonEmissionTopItemsSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceGroupCarbonEmissionTopItemsSummary(document.RootElement, options); + } + + internal static ResourceGroupCarbonEmissionTopItemsSummary DeserializeResourceGroupCarbonEmissionTopItemsSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string itemName = default; + CategoryTypeEnum categoryType = default; + string subscriptionId = default; + string resourceGroupUrl = default; + ResponseDataTypeEnum dataType = default; + double latestMonthEmissions = default; + double previousMonthEmissions = default; + double? monthOverMonthEmissionsChangeRatio = default; + double? monthlyEmissionsChangeValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("itemName"u8)) + { + itemName = property.Value.GetString(); + continue; + } + if (property.NameEquals("categoryType"u8)) + { + categoryType = new CategoryTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceGroupUrl"u8)) + { + resourceGroupUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataType"u8)) + { + dataType = new ResponseDataTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestMonthEmissions"u8)) + { + latestMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("previousMonthEmissions"u8)) + { + previousMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthOverMonthEmissionsChangeRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthOverMonthEmissionsChangeRatio = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyEmissionsChangeValue"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyEmissionsChangeValue = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceGroupCarbonEmissionTopItemsSummary( + dataType, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData, + itemName, + categoryType, + subscriptionId, + resourceGroupUrl); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResourceGroupCarbonEmissionTopItemsSummary)} does not support writing '{options.Format}' format."); + } + } + + ResourceGroupCarbonEmissionTopItemsSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeResourceGroupCarbonEmissionTopItemsSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceGroupCarbonEmissionTopItemsSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemsSummary.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemsSummary.cs new file mode 100644 index 000000000000..73ac19fee923 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResourceGroupCarbonEmissionTopItemsSummary.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + /// Response for Top Items For ResourceGroup. + public partial class ResourceGroupCarbonEmissionTopItemsSummary : CarbonEmission + { + /// Initializes a new instance of . + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The resourceGroup name of the resource for ResourceGroup Category. + /// ResourceGroup Item category. + /// Subscription Id. + /// Resource Group url, value format is '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}'. + /// , or is null. + internal ResourceGroupCarbonEmissionTopItemsSummary(double latestMonthEmissions, double previousMonthEmissions, string itemName, CategoryTypeEnum categoryType, string subscriptionId, string resourceGroupUri) : base(latestMonthEmissions, previousMonthEmissions) + { + Argument.AssertNotNull(itemName, nameof(itemName)); + Argument.AssertNotNull(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(resourceGroupUri, nameof(resourceGroupUri)); + + ItemName = itemName; + CategoryType = categoryType; + SubscriptionId = subscriptionId; + ResourceGroupUri = resourceGroupUri; + DataType = ResponseDataTypeEnum.ResourceGroupTopItemsSummaryData; + } + + /// Initializes a new instance of . + /// The data type of the query result, indicating the format of the returned response. + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Keeps track of any properties unknown to the library. + /// The resourceGroup name of the resource for ResourceGroup Category. + /// ResourceGroup Item category. + /// Subscription Id. + /// Resource Group url, value format is '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}'. + internal ResourceGroupCarbonEmissionTopItemsSummary(ResponseDataTypeEnum dataType, double latestMonthEmissions, double previousMonthEmissions, double? monthOverMonthEmissionsChangeRatio, double? monthlyEmissionsChangeValue, IDictionary serializedAdditionalRawData, string itemName, CategoryTypeEnum categoryType, string subscriptionId, string resourceGroupUri) : base(dataType, latestMonthEmissions, previousMonthEmissions, monthOverMonthEmissionsChangeRatio, monthlyEmissionsChangeValue, serializedAdditionalRawData) + { + ItemName = itemName; + CategoryType = categoryType; + SubscriptionId = subscriptionId; + ResourceGroupUri = resourceGroupUri; + DataType = dataType; + } + + /// Initializes a new instance of for deserialization. + internal ResourceGroupCarbonEmissionTopItemsSummary() + { + } + + /// The resourceGroup name of the resource for ResourceGroup Category. + public string ItemName { get; } + /// ResourceGroup Item category. + public CategoryTypeEnum CategoryType { get; } + /// Subscription Id. + public string SubscriptionId { get; } + /// Resource Group url, value format is '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}'. + public string ResourceGroupUri { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResponseDataTypeEnum.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResponseDataTypeEnum.cs new file mode 100644 index 000000000000..55576ca7630b --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/ResponseDataTypeEnum.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + /// The response data type of Carbon emission data. + internal readonly partial struct ResponseDataTypeEnum : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResponseDataTypeEnum(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OverallSummaryDataValue = "OverallSummaryData"; + private const string MonthlySummaryDataValue = "MonthlySummaryData"; + private const string TopItemsSummaryDataValue = "TopItemsSummaryData"; + private const string ResourceTopItemsSummaryDataValue = "ResourceTopItemsSummaryData"; + private const string ResourceGroupTopItemsSummaryDataValue = "ResourceGroupTopItemsSummaryData"; + private const string TopItemsMonthlySummaryDataValue = "TopItemsMonthlySummaryData"; + private const string ResourceTopItemsMonthlySummaryDataValue = "ResourceTopItemsMonthlySummaryData"; + private const string ResourceGroupTopItemsMonthlySummaryDataValue = "ResourceGroupTopItemsMonthlySummaryData"; + private const string ItemDetailsDataValue = "ItemDetailsData"; + private const string ResourceItemDetailsDataValue = "ResourceItemDetailsData"; + private const string ResourceGroupItemDetailsDataValue = "ResourceGroupItemDetailsData"; + + /// The response data type for OverallSummaryReport. + public static ResponseDataTypeEnum OverallSummaryData { get; } = new ResponseDataTypeEnum(OverallSummaryDataValue); + /// The response data type for MonthlySummaryReport. + public static ResponseDataTypeEnum MonthlySummaryData { get; } = new ResponseDataTypeEnum(MonthlySummaryDataValue); + /// The response data type for TopItemsSummaryReport. + public static ResponseDataTypeEnum TopItemsSummaryData { get; } = new ResponseDataTypeEnum(TopItemsSummaryDataValue); + /// The response data type for Resource's TopItemsSummaryReport. + public static ResponseDataTypeEnum ResourceTopItemsSummaryData { get; } = new ResponseDataTypeEnum(ResourceTopItemsSummaryDataValue); + /// The response data type for ResourceGroup's TopItemsSummaryReport. + public static ResponseDataTypeEnum ResourceGroupTopItemsSummaryData { get; } = new ResponseDataTypeEnum(ResourceGroupTopItemsSummaryDataValue); + /// The response data type for TopItemsMonthlySummaryReport. + public static ResponseDataTypeEnum TopItemsMonthlySummaryData { get; } = new ResponseDataTypeEnum(TopItemsMonthlySummaryDataValue); + /// The response data type for Resource's TopItemsMonthlySummaryReport. + public static ResponseDataTypeEnum ResourceTopItemsMonthlySummaryData { get; } = new ResponseDataTypeEnum(ResourceTopItemsMonthlySummaryDataValue); + /// The response data type for ResourceGroup's TopItemsMonthlySummaryReport. + public static ResponseDataTypeEnum ResourceGroupTopItemsMonthlySummaryData { get; } = new ResponseDataTypeEnum(ResourceGroupTopItemsMonthlySummaryDataValue); + /// The response data type for ItemDetailsReport. + public static ResponseDataTypeEnum ItemDetailsData { get; } = new ResponseDataTypeEnum(ItemDetailsDataValue); + /// The response data type for Resource's ItemDetailsReport. + public static ResponseDataTypeEnum ResourceItemDetailsData { get; } = new ResponseDataTypeEnum(ResourceItemDetailsDataValue); + /// The response data type for ResourceGroup's ItemDetailsReport. + public static ResponseDataTypeEnum ResourceGroupItemDetailsData { get; } = new ResponseDataTypeEnum(ResourceGroupItemDetailsDataValue); + /// Determines if two values are the same. + public static bool operator ==(ResponseDataTypeEnum left, ResponseDataTypeEnum right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResponseDataTypeEnum left, ResponseDataTypeEnum right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ResponseDataTypeEnum(string value) => new ResponseDataTypeEnum(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResponseDataTypeEnum other && Equals(other); + /// + public bool Equals(ResponseDataTypeEnum 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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/SortDirectionEnum.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/SortDirectionEnum.cs new file mode 100644 index 000000000000..8177ceba8068 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/SortDirectionEnum.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.CarbonOptimization.Models +{ + /// Sorting is supported for columns in ItemDetailsReport. This object define sorting direction. + public readonly partial struct SortDirectionEnum : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SortDirectionEnum(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DescValue = "Desc"; + private const string AscValue = "Asc"; + + /// Descending order for query result. + public static SortDirectionEnum Desc { get; } = new SortDirectionEnum(DescValue); + /// Ascending order for query result. + public static SortDirectionEnum Asc { get; } = new SortDirectionEnum(AscValue); + /// Determines if two values are the same. + public static bool operator ==(SortDirectionEnum left, SortDirectionEnum right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SortDirectionEnum left, SortDirectionEnum right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SortDirectionEnum(string value) => new SortDirectionEnum(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SortDirectionEnum other && Equals(other); + /// + public bool Equals(SortDirectionEnum 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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/SubscriptionAccessDecision.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/SubscriptionAccessDecision.Serialization.cs new file mode 100644 index 000000000000..389546fce51f --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/SubscriptionAccessDecision.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.CarbonOptimization.Models +{ + internal partial class SubscriptionAccessDecision : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubscriptionAccessDecision)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + writer.WritePropertyName("decision"u8); + writer.WriteStringValue(Decision.ToString()); + if (Optional.IsDefined(DenialReason)) + { + writer.WritePropertyName("denialReason"u8); + writer.WriteStringValue(DenialReason); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SubscriptionAccessDecision IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubscriptionAccessDecision)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSubscriptionAccessDecision(document.RootElement, options); + } + + internal static SubscriptionAccessDecision DeserializeSubscriptionAccessDecision(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string subscriptionId = default; + AccessDecisionEnum decision = default; + string denialReason = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("decision"u8)) + { + decision = new AccessDecisionEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("denialReason"u8)) + { + denialReason = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SubscriptionAccessDecision(subscriptionId, decision, denialReason, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SubscriptionAccessDecision)} does not support writing '{options.Format}' format."); + } + } + + SubscriptionAccessDecision IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSubscriptionAccessDecision(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SubscriptionAccessDecision)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/SubscriptionAccessDecision.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/SubscriptionAccessDecision.cs new file mode 100644 index 000000000000..d91438f51611 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/SubscriptionAccessDecision.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.CarbonOptimization.Models +{ + /// Access Decision for each Subscription. + internal partial class SubscriptionAccessDecision + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Id of Subscription. + /// Access decision to subscription. + /// is null. + internal SubscriptionAccessDecision(string subscriptionId, AccessDecisionEnum decision) + { + Argument.AssertNotNull(subscriptionId, nameof(subscriptionId)); + + SubscriptionId = subscriptionId; + Decision = decision; + } + + /// Initializes a new instance of . + /// Id of Subscription. + /// Access decision to subscription. + /// The reason why access request got denied. + /// Keeps track of any properties unknown to the library. + internal SubscriptionAccessDecision(string subscriptionId, AccessDecisionEnum decision, string denialReason, IDictionary serializedAdditionalRawData) + { + SubscriptionId = subscriptionId; + Decision = decision; + DenialReason = denialReason; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SubscriptionAccessDecision() + { + } + + /// Id of Subscription. + public string SubscriptionId { get; } + /// Access decision to subscription. + public AccessDecisionEnum Decision { get; } + /// The reason why access request got denied. + public string DenialReason { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsMonthlySummaryReportQueryFilter.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsMonthlySummaryReportQueryFilter.Serialization.cs new file mode 100644 index 000000000000..46ad9a684834 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsMonthlySummaryReportQueryFilter.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.CarbonOptimization.Models +{ + public partial class TopItemsMonthlySummaryReportQueryFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(TopItemsMonthlySummaryReportQueryFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("categoryType"u8); + writer.WriteStringValue(CategoryType.ToString()); + writer.WritePropertyName("topItems"u8); + writer.WriteNumberValue(TopItems); + } + + TopItemsMonthlySummaryReportQueryFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TopItemsMonthlySummaryReportQueryFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTopItemsMonthlySummaryReportQueryFilter(document.RootElement, options); + } + + internal static TopItemsMonthlySummaryReportQueryFilter DeserializeTopItemsMonthlySummaryReportQueryFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CategoryTypeEnum categoryType = default; + int topItems = default; + ReportTypeEnum reportType = default; + DateRange dateRange = default; + IList subscriptionList = default; + IList resourceGroupUrlList = default; + IList resourceTypeList = default; + IList locationList = default; + IList carbonScopeList = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("categoryType"u8)) + { + categoryType = new CategoryTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("topItems"u8)) + { + topItems = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("reportType"u8)) + { + reportType = new ReportTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("dateRange"u8)) + { + dateRange = DateRange.DeserializeDateRange(property.Value, options); + continue; + } + if (property.NameEquals("subscriptionList"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + subscriptionList = array; + continue; + } + if (property.NameEquals("resourceGroupUrlList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceGroupUrlList = array; + continue; + } + if (property.NameEquals("resourceTypeList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceTypeList = array; + continue; + } + if (property.NameEquals("locationList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + locationList = array; + continue; + } + if (property.NameEquals("carbonScopeList"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new EmissionScopeEnum(item.GetString())); + } + carbonScopeList = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TopItemsMonthlySummaryReportQueryFilter( + reportType, + dateRange, + subscriptionList, + resourceGroupUrlList ?? new ChangeTrackingList(), + resourceTypeList ?? new ChangeTrackingList(), + locationList ?? new ChangeTrackingList(), + carbonScopeList, + serializedAdditionalRawData, + categoryType, + topItems); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TopItemsMonthlySummaryReportQueryFilter)} does not support writing '{options.Format}' format."); + } + } + + TopItemsMonthlySummaryReportQueryFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTopItemsMonthlySummaryReportQueryFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TopItemsMonthlySummaryReportQueryFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsMonthlySummaryReportQueryFilter.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsMonthlySummaryReportQueryFilter.cs new file mode 100644 index 000000000000..dc51f6bed259 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsMonthlySummaryReportQueryFilter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + /// Query filter parameter to configure TopItemsMonthlySummaryReport queries. + public partial class TopItemsMonthlySummaryReportQueryFilter : QueryFilter + { + /// Initializes a new instance of . + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// Specifies the category type to retrieve top-emitting items, aggregated by month. See supported types in CategoryTypeEnum. + /// The number of top items to return, based on emissions. Must be between 1 and 10. + /// , or is null. + public TopItemsMonthlySummaryReportQueryFilter(DateRange dateRange, IEnumerable subscriptionList, IEnumerable carbonScopeList, CategoryTypeEnum categoryType, int topItems) : base(dateRange, subscriptionList, carbonScopeList) + { + Argument.AssertNotNull(dateRange, nameof(dateRange)); + Argument.AssertNotNull(subscriptionList, nameof(subscriptionList)); + Argument.AssertNotNull(carbonScopeList, nameof(carbonScopeList)); + + CategoryType = categoryType; + TopItems = topItems; + ReportType = ReportTypeEnum.TopItemsMonthlySummaryReport; + } + + /// Initializes a new instance of . + /// The ReportType requested for carbon emissions data. Required. Specifies how data is aggregated and displayed in the output, as explained in the ReportTypeEnum. + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase. + /// List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'. + /// List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// Keeps track of any properties unknown to the library. + /// Specifies the category type to retrieve top-emitting items, aggregated by month. See supported types in CategoryTypeEnum. + /// The number of top items to return, based on emissions. Must be between 1 and 10. + internal TopItemsMonthlySummaryReportQueryFilter(ReportTypeEnum reportType, DateRange dateRange, IList subscriptionList, IList resourceGroupUrlList, IList resourceTypeList, IList locationList, IList carbonScopeList, IDictionary serializedAdditionalRawData, CategoryTypeEnum categoryType, int topItems) : base(reportType, dateRange, subscriptionList, resourceGroupUrlList, resourceTypeList, locationList, carbonScopeList, serializedAdditionalRawData) + { + CategoryType = categoryType; + TopItems = topItems; + ReportType = reportType; + } + + /// Initializes a new instance of for deserialization. + internal TopItemsMonthlySummaryReportQueryFilter() + { + } + + /// Specifies the category type to retrieve top-emitting items, aggregated by month. See supported types in CategoryTypeEnum. + public CategoryTypeEnum CategoryType { get; } + /// The number of top items to return, based on emissions. Must be between 1 and 10. + public int TopItems { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsSummaryReportQueryFilter.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsSummaryReportQueryFilter.Serialization.cs new file mode 100644 index 000000000000..5dc1a570aca8 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsSummaryReportQueryFilter.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.CarbonOptimization.Models +{ + public partial class TopItemsSummaryReportQueryFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(TopItemsSummaryReportQueryFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("categoryType"u8); + writer.WriteStringValue(CategoryType.ToString()); + writer.WritePropertyName("topItems"u8); + writer.WriteNumberValue(TopItems); + } + + TopItemsSummaryReportQueryFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TopItemsSummaryReportQueryFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTopItemsSummaryReportQueryFilter(document.RootElement, options); + } + + internal static TopItemsSummaryReportQueryFilter DeserializeTopItemsSummaryReportQueryFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CategoryTypeEnum categoryType = default; + int topItems = default; + ReportTypeEnum reportType = default; + DateRange dateRange = default; + IList subscriptionList = default; + IList resourceGroupUrlList = default; + IList resourceTypeList = default; + IList locationList = default; + IList carbonScopeList = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("categoryType"u8)) + { + categoryType = new CategoryTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("topItems"u8)) + { + topItems = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("reportType"u8)) + { + reportType = new ReportTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("dateRange"u8)) + { + dateRange = DateRange.DeserializeDateRange(property.Value, options); + continue; + } + if (property.NameEquals("subscriptionList"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + subscriptionList = array; + continue; + } + if (property.NameEquals("resourceGroupUrlList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceGroupUrlList = array; + continue; + } + if (property.NameEquals("resourceTypeList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceTypeList = array; + continue; + } + if (property.NameEquals("locationList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + locationList = array; + continue; + } + if (property.NameEquals("carbonScopeList"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new EmissionScopeEnum(item.GetString())); + } + carbonScopeList = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TopItemsSummaryReportQueryFilter( + reportType, + dateRange, + subscriptionList, + resourceGroupUrlList ?? new ChangeTrackingList(), + resourceTypeList ?? new ChangeTrackingList(), + locationList ?? new ChangeTrackingList(), + carbonScopeList, + serializedAdditionalRawData, + categoryType, + topItems); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TopItemsSummaryReportQueryFilter)} does not support writing '{options.Format}' format."); + } + } + + TopItemsSummaryReportQueryFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTopItemsSummaryReportQueryFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TopItemsSummaryReportQueryFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsSummaryReportQueryFilter.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsSummaryReportQueryFilter.cs new file mode 100644 index 000000000000..86d6b7204455 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/TopItemsSummaryReportQueryFilter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + /// Query filter parameter to configure TopItemsSummaryReport queries. + public partial class TopItemsSummaryReportQueryFilter : QueryFilter + { + /// Initializes a new instance of . + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// Specifies the category type for which to retrieve top-emitting items. See supported values defined in CategoryTypeEnum. + /// The number of top items to return, based on emissions. This value must be between 1 and 10. + /// , or is null. + public TopItemsSummaryReportQueryFilter(DateRange dateRange, IEnumerable subscriptionList, IEnumerable carbonScopeList, CategoryTypeEnum categoryType, int topItems) : base(dateRange, subscriptionList, carbonScopeList) + { + Argument.AssertNotNull(dateRange, nameof(dateRange)); + Argument.AssertNotNull(subscriptionList, nameof(subscriptionList)); + Argument.AssertNotNull(carbonScopeList, nameof(carbonScopeList)); + + CategoryType = categoryType; + TopItems = topItems; + ReportType = ReportTypeEnum.TopItemsSummaryReport; + } + + /// Initializes a new instance of . + /// The ReportType requested for carbon emissions data. Required. Specifies how data is aggregated and displayed in the output, as explained in the ReportTypeEnum. + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase. + /// List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'. + /// List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// Keeps track of any properties unknown to the library. + /// Specifies the category type for which to retrieve top-emitting items. See supported values defined in CategoryTypeEnum. + /// The number of top items to return, based on emissions. This value must be between 1 and 10. + internal TopItemsSummaryReportQueryFilter(ReportTypeEnum reportType, DateRange dateRange, IList subscriptionList, IList resourceGroupUrlList, IList resourceTypeList, IList locationList, IList carbonScopeList, IDictionary serializedAdditionalRawData, CategoryTypeEnum categoryType, int topItems) : base(reportType, dateRange, subscriptionList, resourceGroupUrlList, resourceTypeList, locationList, carbonScopeList, serializedAdditionalRawData) + { + CategoryType = categoryType; + TopItems = topItems; + ReportType = reportType; + } + + /// Initializes a new instance of for deserialization. + internal TopItemsSummaryReportQueryFilter() + { + } + + /// Specifies the category type for which to retrieve top-emitting items. See supported values defined in CategoryTypeEnum. + public CategoryTypeEnum CategoryType { get; } + /// The number of top items to return, based on emissions. This value must be between 1 and 10. + public int TopItems { get; } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownCarbonEmission.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownCarbonEmission.Serialization.cs new file mode 100644 index 000000000000..750a2b874dc7 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownCarbonEmission.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.CarbonOptimization.Models +{ + internal partial class UnknownCarbonEmission : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CarbonEmission)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + CarbonEmission IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CarbonEmission)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCarbonEmission(document.RootElement, options); + } + + internal static UnknownCarbonEmission DeserializeUnknownCarbonEmission(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResponseDataTypeEnum dataType = "Unknown"; + double latestMonthEmissions = default; + double previousMonthEmissions = default; + double? monthOverMonthEmissionsChangeRatio = default; + double? monthlyEmissionsChangeValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dataType"u8)) + { + dataType = new ResponseDataTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestMonthEmissions"u8)) + { + latestMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("previousMonthEmissions"u8)) + { + previousMonthEmissions = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthOverMonthEmissionsChangeRatio"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthOverMonthEmissionsChangeRatio = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyEmissionsChangeValue"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyEmissionsChangeValue = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownCarbonEmission( + dataType, + latestMonthEmissions, + previousMonthEmissions, + monthOverMonthEmissionsChangeRatio, + monthlyEmissionsChangeValue, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CarbonEmission)} does not support writing '{options.Format}' format."); + } + } + + CarbonEmission IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCarbonEmission(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CarbonEmission)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownCarbonEmission.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownCarbonEmission.cs new file mode 100644 index 000000000000..ca2859ac146b --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownCarbonEmission.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + /// Unknown version of CarbonEmission. + internal partial class UnknownCarbonEmission : CarbonEmission + { + /// Initializes a new instance of . + /// The data type of the query result, indicating the format of the returned response. + /// Total carbon emissions for the specified query parameters, measured in kgCO2E. This value represents total emissions over the specified date range (e.g., March-June). + /// Total carbon emissions for the previous month’s date range, which is the same period as the specified date range but shifted left by one month (e.g., if the specified range is March - June, the previous month’s range will be Feb - May). The value is measured in kgCO2E. + /// The percentage change in carbon emissions between the current and previous DateRange. This is calculated as: (latestMonthEmissions - previousMonthEmissions) / previousMonthEmissions. + /// The change in carbon emissions between the current and previous period, calculated as: latestMonthEmissions - previousMonthEmissions. + /// Keeps track of any properties unknown to the library. + internal UnknownCarbonEmission(ResponseDataTypeEnum dataType, double latestMonthEmissions, double previousMonthEmissions, double? monthOverMonthEmissionsChangeRatio, double? monthlyEmissionsChangeValue, IDictionary serializedAdditionalRawData) : base(dataType, latestMonthEmissions, previousMonthEmissions, monthOverMonthEmissionsChangeRatio, monthlyEmissionsChangeValue, serializedAdditionalRawData) + { + DataType = dataType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownCarbonEmission() + { + } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownQueryFilter.Serialization.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownQueryFilter.Serialization.cs new file mode 100644 index 000000000000..a04028639e09 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownQueryFilter.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CarbonOptimization.Models +{ + internal partial class UnknownQueryFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(QueryFilter)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + QueryFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QueryFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeQueryFilter(document.RootElement, options); + } + + internal static UnknownQueryFilter DeserializeUnknownQueryFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ReportTypeEnum reportType = "Unknown"; + DateRange dateRange = default; + IList subscriptionList = default; + IList resourceGroupUrlList = default; + IList resourceTypeList = default; + IList locationList = default; + IList carbonScopeList = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("reportType"u8)) + { + reportType = new ReportTypeEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("dateRange"u8)) + { + dateRange = DateRange.DeserializeDateRange(property.Value, options); + continue; + } + if (property.NameEquals("subscriptionList"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + subscriptionList = array; + continue; + } + if (property.NameEquals("resourceGroupUrlList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceGroupUrlList = array; + continue; + } + if (property.NameEquals("resourceTypeList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceTypeList = array; + continue; + } + if (property.NameEquals("locationList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + locationList = array; + continue; + } + if (property.NameEquals("carbonScopeList"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new EmissionScopeEnum(item.GetString())); + } + carbonScopeList = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownQueryFilter( + reportType, + dateRange, + subscriptionList, + resourceGroupUrlList ?? new ChangeTrackingList(), + resourceTypeList ?? new ChangeTrackingList(), + locationList ?? new ChangeTrackingList(), + carbonScopeList, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(QueryFilter)} does not support writing '{options.Format}' format."); + } + } + + QueryFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeQueryFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(QueryFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownQueryFilter.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownQueryFilter.cs new file mode 100644 index 000000000000..b277e50e982b --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/Models/UnknownQueryFilter.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.CarbonOptimization.Models +{ + /// Unknown version of QueryFilter. + internal partial class UnknownQueryFilter : QueryFilter + { + /// Initializes a new instance of . + /// The ReportType requested for carbon emissions data. Required. Specifies how data is aggregated and displayed in the output, as explained in the ReportTypeEnum. + /// The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01). + /// List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100. + /// List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase. + /// List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'. + /// List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names. + /// List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes. + /// Keeps track of any properties unknown to the library. + internal UnknownQueryFilter(ReportTypeEnum reportType, DateRange dateRange, IList subscriptionList, IList resourceGroupUrlList, IList resourceTypeList, IList locationList, IList carbonScopeList, IDictionary serializedAdditionalRawData) : base(reportType, dateRange, subscriptionList, resourceGroupUrlList, resourceTypeList, locationList, carbonScopeList, serializedAdditionalRawData) + { + ReportType = reportType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownQueryFilter() + { + } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/ProviderConstants.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..08f60e70a709 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/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.CarbonOptimization +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/RestOperations/CarbonServiceRestOperations.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/RestOperations/CarbonServiceRestOperations.cs new file mode 100644 index 000000000000..e88e3cfd43f8 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Generated/RestOperations/CarbonServiceRestOperations.cs @@ -0,0 +1,179 @@ +// 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.CarbonOptimization.Models; + +namespace Azure.ResourceManager.CarbonOptimization +{ + internal partial class CarbonServiceRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CarbonServiceRestOperations. + /// 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 CarbonServiceRestOperations(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-04-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateQueryCarbonEmissionReportsRequestUri(QueryFilter queryParameters) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.Carbon/carbonEmissionReports", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateQueryCarbonEmissionReportsRequest(QueryFilter queryParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.Carbon/carbonEmissionReports", 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(queryParameters, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// API for Carbon Emissions Reports. + /// Query parameters. + /// The cancellation token to use. + /// is null. + public async Task> QueryCarbonEmissionReportsAsync(QueryFilter queryParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(queryParameters, nameof(queryParameters)); + + using var message = CreateQueryCarbonEmissionReportsRequest(queryParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CarbonEmissionDataListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CarbonEmissionDataListResult.DeserializeCarbonEmissionDataListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// API for Carbon Emissions Reports. + /// Query parameters. + /// The cancellation token to use. + /// is null. + public Response QueryCarbonEmissionReports(QueryFilter queryParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(queryParameters, nameof(queryParameters)); + + using var message = CreateQueryCarbonEmissionReportsRequest(queryParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CarbonEmissionDataListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CarbonEmissionDataListResult.DeserializeCarbonEmissionDataListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateQueryCarbonEmissionDataAvailableDateRangeRequestUri() + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.Carbon/queryCarbonEmissionDataAvailableDateRange", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateQueryCarbonEmissionDataAvailableDateRangeRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.Carbon/queryCarbonEmissionDataAvailableDateRange", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// API for query carbon emission data available date range. + /// The cancellation token to use. + public async Task> QueryCarbonEmissionDataAvailableDateRangeAsync(CancellationToken cancellationToken = default) + { + using var message = CreateQueryCarbonEmissionDataAvailableDateRangeRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CarbonEmissionDataAvailableDateRange value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CarbonEmissionDataAvailableDateRange.DeserializeCarbonEmissionDataAvailableDateRange(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// API for query carbon emission data available date range. + /// The cancellation token to use. + public Response QueryCarbonEmissionDataAvailableDateRange(CancellationToken cancellationToken = default) + { + using var message = CreateQueryCarbonEmissionDataAvailableDateRangeRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CarbonEmissionDataAvailableDateRange value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CarbonEmissionDataAvailableDateRange.DeserializeCarbonEmissionDataAvailableDateRange(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Properties/AssemblyInfo.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..5be33ff7976b --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/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.CarbonOptimization.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("CarbonOptimization")] diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tests/Azure.ResourceManager.CarbonOptimization.Tests.csproj b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tests/Azure.ResourceManager.CarbonOptimization.Tests.csproj new file mode 100644 index 000000000000..aadc4dc62ec2 --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tests/Azure.ResourceManager.CarbonOptimization.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tests/CarbonOptimizationManagementTestBase.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tests/CarbonOptimizationManagementTestBase.cs new file mode 100644 index 000000000000..dfb72f4e960f --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tests/CarbonOptimizationManagementTestBase.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.CarbonOptimization.Tests +{ + public class CarbonOptimizationManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected CarbonOptimizationManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected CarbonOptimizationManagementTestBase(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/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tests/CarbonOptimizationManagementTestEnvironment.cs b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tests/CarbonOptimizationManagementTestEnvironment.cs new file mode 100644 index 000000000000..0912e3fa9d1f --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tests/CarbonOptimizationManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.CarbonOptimization.Tests +{ + public class CarbonOptimizationManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tsp-location.yaml b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tsp-location.yaml new file mode 100644 index 000000000000..3adde31262cd --- /dev/null +++ b/sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/carbon/Carbon.Management +commit: 47fb75e55cbbcaf8d65602ad991885e7dfd49a1e +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/carbonoptimization/ci.mgmt.yml b/sdk/carbonoptimization/ci.mgmt.yml new file mode 100644 index 000000000000..4efe477bc075 --- /dev/null +++ b/sdk/carbonoptimization/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/carbonoptimization /ci.mgmt.yml + - sdk/carbonoptimization /Azure.ResourceManager.CarbonOptimization / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: carbonoptimization + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.CarbonOptimization + safeName: AzureResourceManagerCarbonOptimization diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/Azure.ResourceManager.DependencyMap.sln b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/Azure.ResourceManager.DependencyMap.sln new file mode 100644 index 000000000000..fedbc9737960 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/Azure.ResourceManager.DependencyMap.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.DependencyMap.Samples", "samples\Azure.ResourceManager.DependencyMap.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.DependencyMap", "src\Azure.ResourceManager.DependencyMap.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.DependencyMap.Tests", "tests\Azure.ResourceManager.DependencyMap.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/dependencymap/Azure.ResourceManager.DependencyMap/CHANGELOG.md b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/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/dependencymap/Azure.ResourceManager.DependencyMap/Directory.Build.props b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/README.md b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/README.md new file mode 100644 index 000000000000..810ba32e80f7 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure DependencyMap 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 DependencyMap management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.DependencyMap --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/dependencymap/Azure.ResourceManager.DependencyMap/api/Azure.ResourceManager.DependencyMap.net8.0.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/api/Azure.ResourceManager.DependencyMap.net8.0.cs new file mode 100644 index 000000000000..fa5adf2b4083 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/api/Azure.ResourceManager.DependencyMap.net8.0.cs @@ -0,0 +1,337 @@ +namespace Azure.ResourceManager.DependencyMap +{ + public static partial class DependencyMapExtensions + { + public static Azure.ResourceManager.DependencyMap.DiscoverySourceResource GetDiscoverySourceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DependencyMap.MapsResource GetMapsResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetMapsResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetMapsResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DependencyMap.MapsResourceCollection GetMapsResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetMapsResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetMapsResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DiscoverySourceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DiscoverySourceResource() { } + public virtual Azure.ResourceManager.DependencyMap.DiscoverySourceResourceData 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 mapName, string sourceName) { 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 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.DependencyMap.DiscoverySourceResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.DiscoverySourceResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.DependencyMap.Models.DiscoverySourceResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.DiscoverySourceResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DiscoverySourceResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DiscoverySourceResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string sourceName, Azure.ResourceManager.DependencyMap.DiscoverySourceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string sourceName, Azure.ResourceManager.DependencyMap.DiscoverySourceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string sourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string sourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string sourceName, 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 sourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string sourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string sourceName, 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 DiscoverySourceResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiscoverySourceResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.DependencyMap.Models.DiscoverySourceResourceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.DiscoverySourceResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.DiscoverySourceResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MapsResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MapsResource() { } + public virtual Azure.ResourceManager.DependencyMap.MapsResourceData 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 mapName) { 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 ExportDependencies(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.ExportDependenciesContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ExportDependenciesAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.ExportDependenciesContent 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.ArmOperation GetConnectionsForProcessOnFocusedMachine(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.GetConnectionsForProcessOnFocusedMachineContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetConnectionsForProcessOnFocusedMachineAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.GetConnectionsForProcessOnFocusedMachineContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation GetConnectionsWithConnectedMachineForFocusedMachine(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.GetConnectionsWithConnectedMachineForFocusedMachineContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetConnectionsWithConnectedMachineForFocusedMachineAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.GetConnectionsWithConnectedMachineForFocusedMachineContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation GetDependencyViewForFocusedMachine(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.GetDependencyViewForFocusedMachineContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetDependencyViewForFocusedMachineAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.GetDependencyViewForFocusedMachineContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDiscoverySourceResource(string sourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDiscoverySourceResourceAsync(string sourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DependencyMap.DiscoverySourceResourceCollection GetDiscoverySourceResources() { 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.DependencyMap.MapsResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.MapsResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.DependencyMap.Models.MapsResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.MapsResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MapsResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MapsResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string mapName, Azure.ResourceManager.DependencyMap.MapsResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string mapName, Azure.ResourceManager.DependencyMap.MapsResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string mapName, 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 mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string mapName, 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 MapsResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MapsResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.DependencyMap.Models.ProvisioningState? MapsResourceProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.MapsResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.MapsResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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.DependencyMap.Mocking +{ + public partial class MockableDependencyMapArmClient : Azure.ResourceManager.ArmResource + { + protected MockableDependencyMapArmClient() { } + public virtual Azure.ResourceManager.DependencyMap.DiscoverySourceResource GetDiscoverySourceResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DependencyMap.MapsResource GetMapsResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableDependencyMapResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableDependencyMapResourceGroupResource() { } + public virtual Azure.Response GetMapsResource(string mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMapsResourceAsync(string mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DependencyMap.MapsResourceCollection GetMapsResources() { throw null; } + } + public partial class MockableDependencyMapSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableDependencyMapSubscriptionResource() { } + public virtual Azure.Pageable GetMapsResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetMapsResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DependencyMap.Models +{ + public static partial class ArmDependencyMapModelFactory + { + public static Azure.ResourceManager.DependencyMap.DiscoverySourceResourceData DiscoverySourceResourceData(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.DependencyMap.Models.DiscoverySourceResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.DiscoverySourceResourceProperties DiscoverySourceResourceProperties(Azure.ResourceManager.DependencyMap.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.DependencyMap.Models.ProvisioningState?), string sourceType = null, string sourceId = null) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.ExportDependenciesContent ExportDependenciesContent(string focusedMachineId = null, Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter filters = null) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.GetConnectionsForProcessOnFocusedMachineContent GetConnectionsForProcessOnFocusedMachineContent(string focusedMachineId = null, string processIdOnFocusedMachine = null, Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter filters = null) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.GetConnectionsWithConnectedMachineForFocusedMachineContent GetConnectionsWithConnectedMachineForFocusedMachineContent(string focusedMachineId = null, string connectedMachineId = null, Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter filters = null) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.GetDependencyViewForFocusedMachineContent GetDependencyViewForFocusedMachineContent(string focusedMachineId = null, Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter filters = null) { throw null; } + public static Azure.ResourceManager.DependencyMap.MapsResourceData MapsResourceData(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.DependencyMap.Models.ProvisioningState? mapsResourceProvisioningState = default(Azure.ResourceManager.DependencyMap.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.OffAzureDiscoverySourceResourceProperties OffAzureDiscoverySourceResourceProperties(Azure.ResourceManager.DependencyMap.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.DependencyMap.Models.ProvisioningState?), string sourceId = null) { throw null; } + } + public partial class DateTimeFilter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DateTimeFilter() { } + public System.DateTimeOffset? EndDateTimeUtc { get { throw null; } set { } } + public System.DateTimeOffset? StartDateTimeUtc { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.DateTimeFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.DateTimeFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DependencyMapVisualizationFilter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DependencyMapVisualizationFilter() { } + public Azure.ResourceManager.DependencyMap.Models.DateTimeFilter DateTime { get { throw null; } set { } } + public Azure.ResourceManager.DependencyMap.Models.ProcessNameFilter ProcessNameFilter { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DiscoverySourceResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiscoverySourceResourcePatch() { } + 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.DependencyMap.Models.DiscoverySourceResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.DiscoverySourceResourcePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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 DiscoverySourceResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DiscoverySourceResourceProperties(string sourceId) { } + public Azure.ResourceManager.DependencyMap.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string SourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.DiscoverySourceResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.DiscoverySourceResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportDependenciesContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportDependenciesContent(string focusedMachineId) { } + public Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter Filters { get { throw null; } set { } } + public string FocusedMachineId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.ExportDependenciesContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.ExportDependenciesContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GetConnectionsForProcessOnFocusedMachineContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GetConnectionsForProcessOnFocusedMachineContent(string focusedMachineId, string processIdOnFocusedMachine) { } + public Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter Filters { get { throw null; } set { } } + public string FocusedMachineId { get { throw null; } } + public string ProcessIdOnFocusedMachine { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.GetConnectionsForProcessOnFocusedMachineContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.GetConnectionsForProcessOnFocusedMachineContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GetConnectionsWithConnectedMachineForFocusedMachineContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GetConnectionsWithConnectedMachineForFocusedMachineContent(string focusedMachineId, string connectedMachineId) { } + public string ConnectedMachineId { get { throw null; } } + public Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter Filters { get { throw null; } set { } } + public string FocusedMachineId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.GetConnectionsWithConnectedMachineForFocusedMachineContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.GetConnectionsWithConnectedMachineForFocusedMachineContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GetDependencyViewForFocusedMachineContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GetDependencyViewForFocusedMachineContent(string focusedMachineId) { } + public Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter Filters { get { throw null; } set { } } + public string FocusedMachineId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.GetDependencyViewForFocusedMachineContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.GetDependencyViewForFocusedMachineContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MapsResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MapsResourcePatch() { } + 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.DependencyMap.Models.MapsResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.MapsResourcePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OffAzureDiscoverySourceResourceProperties : Azure.ResourceManager.DependencyMap.Models.DiscoverySourceResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OffAzureDiscoverySourceResourceProperties(string sourceId) : base (default(string)) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.OffAzureDiscoverySourceResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.OffAzureDiscoverySourceResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProcessNameFilter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProcessNameFilter(Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator @operator, System.Collections.Generic.IEnumerable processNames) { } + public Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator Operator { get { throw null; } } + public System.Collections.Generic.IList ProcessNames { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.ProcessNameFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.ProcessNameFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ProcessNameFilterOperator : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProcessNameFilterOperator(string value) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator Contains { get { throw null; } } + public static Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator NotContains { get { throw null; } } + public bool Equals(Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator 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.DependencyMap.Models.ProcessNameFilterOperator left, Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator right) { throw null; } + public static implicit operator Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator left, Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.DependencyMap.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.DependencyMap.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.DependencyMap.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.DependencyMap.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.DependencyMap.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.DependencyMap.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.DependencyMap.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.DependencyMap.Models.ProvisioningState left, Azure.ResourceManager.DependencyMap.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.DependencyMap.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DependencyMap.Models.ProvisioningState left, Azure.ResourceManager.DependencyMap.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/api/Azure.ResourceManager.DependencyMap.netstandard2.0.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/api/Azure.ResourceManager.DependencyMap.netstandard2.0.cs new file mode 100644 index 000000000000..fa5adf2b4083 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/api/Azure.ResourceManager.DependencyMap.netstandard2.0.cs @@ -0,0 +1,337 @@ +namespace Azure.ResourceManager.DependencyMap +{ + public static partial class DependencyMapExtensions + { + public static Azure.ResourceManager.DependencyMap.DiscoverySourceResource GetDiscoverySourceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DependencyMap.MapsResource GetMapsResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetMapsResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetMapsResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DependencyMap.MapsResourceCollection GetMapsResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetMapsResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetMapsResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DiscoverySourceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DiscoverySourceResource() { } + public virtual Azure.ResourceManager.DependencyMap.DiscoverySourceResourceData 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 mapName, string sourceName) { 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 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.DependencyMap.DiscoverySourceResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.DiscoverySourceResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.DependencyMap.Models.DiscoverySourceResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.DiscoverySourceResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DiscoverySourceResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DiscoverySourceResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string sourceName, Azure.ResourceManager.DependencyMap.DiscoverySourceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string sourceName, Azure.ResourceManager.DependencyMap.DiscoverySourceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string sourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string sourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string sourceName, 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 sourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string sourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string sourceName, 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 DiscoverySourceResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiscoverySourceResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.DependencyMap.Models.DiscoverySourceResourceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.DiscoverySourceResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.DiscoverySourceResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MapsResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MapsResource() { } + public virtual Azure.ResourceManager.DependencyMap.MapsResourceData 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 mapName) { 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 ExportDependencies(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.ExportDependenciesContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ExportDependenciesAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.ExportDependenciesContent 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.ArmOperation GetConnectionsForProcessOnFocusedMachine(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.GetConnectionsForProcessOnFocusedMachineContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetConnectionsForProcessOnFocusedMachineAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.GetConnectionsForProcessOnFocusedMachineContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation GetConnectionsWithConnectedMachineForFocusedMachine(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.GetConnectionsWithConnectedMachineForFocusedMachineContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetConnectionsWithConnectedMachineForFocusedMachineAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.GetConnectionsWithConnectedMachineForFocusedMachineContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation GetDependencyViewForFocusedMachine(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.GetDependencyViewForFocusedMachineContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetDependencyViewForFocusedMachineAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.GetDependencyViewForFocusedMachineContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDiscoverySourceResource(string sourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDiscoverySourceResourceAsync(string sourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DependencyMap.DiscoverySourceResourceCollection GetDiscoverySourceResources() { 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.DependencyMap.MapsResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.MapsResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.DependencyMap.Models.MapsResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DependencyMap.Models.MapsResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MapsResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MapsResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string mapName, Azure.ResourceManager.DependencyMap.MapsResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string mapName, Azure.ResourceManager.DependencyMap.MapsResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string mapName, 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 mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string mapName, 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 MapsResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MapsResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.DependencyMap.Models.ProvisioningState? MapsResourceProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.MapsResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.MapsResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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.DependencyMap.Mocking +{ + public partial class MockableDependencyMapArmClient : Azure.ResourceManager.ArmResource + { + protected MockableDependencyMapArmClient() { } + public virtual Azure.ResourceManager.DependencyMap.DiscoverySourceResource GetDiscoverySourceResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DependencyMap.MapsResource GetMapsResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableDependencyMapResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableDependencyMapResourceGroupResource() { } + public virtual Azure.Response GetMapsResource(string mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMapsResourceAsync(string mapName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DependencyMap.MapsResourceCollection GetMapsResources() { throw null; } + } + public partial class MockableDependencyMapSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableDependencyMapSubscriptionResource() { } + public virtual Azure.Pageable GetMapsResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetMapsResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DependencyMap.Models +{ + public static partial class ArmDependencyMapModelFactory + { + public static Azure.ResourceManager.DependencyMap.DiscoverySourceResourceData DiscoverySourceResourceData(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.DependencyMap.Models.DiscoverySourceResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.DiscoverySourceResourceProperties DiscoverySourceResourceProperties(Azure.ResourceManager.DependencyMap.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.DependencyMap.Models.ProvisioningState?), string sourceType = null, string sourceId = null) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.ExportDependenciesContent ExportDependenciesContent(string focusedMachineId = null, Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter filters = null) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.GetConnectionsForProcessOnFocusedMachineContent GetConnectionsForProcessOnFocusedMachineContent(string focusedMachineId = null, string processIdOnFocusedMachine = null, Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter filters = null) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.GetConnectionsWithConnectedMachineForFocusedMachineContent GetConnectionsWithConnectedMachineForFocusedMachineContent(string focusedMachineId = null, string connectedMachineId = null, Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter filters = null) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.GetDependencyViewForFocusedMachineContent GetDependencyViewForFocusedMachineContent(string focusedMachineId = null, Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter filters = null) { throw null; } + public static Azure.ResourceManager.DependencyMap.MapsResourceData MapsResourceData(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.DependencyMap.Models.ProvisioningState? mapsResourceProvisioningState = default(Azure.ResourceManager.DependencyMap.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.OffAzureDiscoverySourceResourceProperties OffAzureDiscoverySourceResourceProperties(Azure.ResourceManager.DependencyMap.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.DependencyMap.Models.ProvisioningState?), string sourceId = null) { throw null; } + } + public partial class DateTimeFilter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DateTimeFilter() { } + public System.DateTimeOffset? EndDateTimeUtc { get { throw null; } set { } } + public System.DateTimeOffset? StartDateTimeUtc { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.DateTimeFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.DateTimeFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DependencyMapVisualizationFilter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DependencyMapVisualizationFilter() { } + public Azure.ResourceManager.DependencyMap.Models.DateTimeFilter DateTime { get { throw null; } set { } } + public Azure.ResourceManager.DependencyMap.Models.ProcessNameFilter ProcessNameFilter { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DiscoverySourceResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiscoverySourceResourcePatch() { } + 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.DependencyMap.Models.DiscoverySourceResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.DiscoverySourceResourcePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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 DiscoverySourceResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DiscoverySourceResourceProperties(string sourceId) { } + public Azure.ResourceManager.DependencyMap.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string SourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.DiscoverySourceResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.DiscoverySourceResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ExportDependenciesContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ExportDependenciesContent(string focusedMachineId) { } + public Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter Filters { get { throw null; } set { } } + public string FocusedMachineId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.ExportDependenciesContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.ExportDependenciesContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GetConnectionsForProcessOnFocusedMachineContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GetConnectionsForProcessOnFocusedMachineContent(string focusedMachineId, string processIdOnFocusedMachine) { } + public Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter Filters { get { throw null; } set { } } + public string FocusedMachineId { get { throw null; } } + public string ProcessIdOnFocusedMachine { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.GetConnectionsForProcessOnFocusedMachineContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.GetConnectionsForProcessOnFocusedMachineContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GetConnectionsWithConnectedMachineForFocusedMachineContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GetConnectionsWithConnectedMachineForFocusedMachineContent(string focusedMachineId, string connectedMachineId) { } + public string ConnectedMachineId { get { throw null; } } + public Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter Filters { get { throw null; } set { } } + public string FocusedMachineId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.GetConnectionsWithConnectedMachineForFocusedMachineContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.GetConnectionsWithConnectedMachineForFocusedMachineContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GetDependencyViewForFocusedMachineContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GetDependencyViewForFocusedMachineContent(string focusedMachineId) { } + public Azure.ResourceManager.DependencyMap.Models.DependencyMapVisualizationFilter Filters { get { throw null; } set { } } + public string FocusedMachineId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.GetDependencyViewForFocusedMachineContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.GetDependencyViewForFocusedMachineContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MapsResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MapsResourcePatch() { } + 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.DependencyMap.Models.MapsResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.MapsResourcePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OffAzureDiscoverySourceResourceProperties : Azure.ResourceManager.DependencyMap.Models.DiscoverySourceResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OffAzureDiscoverySourceResourceProperties(string sourceId) : base (default(string)) { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.OffAzureDiscoverySourceResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.OffAzureDiscoverySourceResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProcessNameFilter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProcessNameFilter(Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator @operator, System.Collections.Generic.IEnumerable processNames) { } + public Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator Operator { get { throw null; } } + public System.Collections.Generic.IList ProcessNames { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.ProcessNameFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DependencyMap.Models.ProcessNameFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ProcessNameFilterOperator : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProcessNameFilterOperator(string value) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator Contains { get { throw null; } } + public static Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator NotContains { get { throw null; } } + public bool Equals(Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator 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.DependencyMap.Models.ProcessNameFilterOperator left, Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator right) { throw null; } + public static implicit operator Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator left, Azure.ResourceManager.DependencyMap.Models.ProcessNameFilterOperator right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.DependencyMap.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.DependencyMap.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.DependencyMap.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.DependencyMap.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.DependencyMap.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.DependencyMap.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.DependencyMap.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.DependencyMap.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.DependencyMap.Models.ProvisioningState left, Azure.ResourceManager.DependencyMap.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.DependencyMap.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DependencyMap.Models.ProvisioningState left, Azure.ResourceManager.DependencyMap.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/assets.json b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/assets.json new file mode 100644 index 000000000000..729d19b6092d --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/dependencymap/Azure.ResourceManager.DependencyMap", + "Tag": "" +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Azure.ResourceManager.DependencyMap.Samples.csproj b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Azure.ResourceManager.DependencyMap.Samples.csproj new file mode 100644 index 000000000000..3222b11d1d1d --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Azure.ResourceManager.DependencyMap.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_DiscoverySourceResource.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_DiscoverySourceResource.cs new file mode 100644 index 000000000000..621bbf8898fd --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_DiscoverySourceResource.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.DependencyMap.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DependencyMap.Samples +{ + public partial class Sample_DiscoverySourceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DiscoverySourcesGetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/DiscoverySources_Get.json + // this example is just showing the usage of "DiscoverySourceResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DiscoverySourceResource created on azure + // for more information of creating DiscoverySourceResource, please refer to the document of DiscoverySourceResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + string sourceName = "sourceTest1"; + ResourceIdentifier discoverySourceResourceId = DiscoverySourceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName, sourceName); + DiscoverySourceResource discoverySourceResource = client.GetDiscoverySourceResource(discoverySourceResourceId); + + // invoke the operation + DiscoverySourceResource result = await discoverySourceResource.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 + DiscoverySourceResourceData 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_DiscoverySourcesDeleteGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/DiscoverySources_Delete.json + // this example is just showing the usage of "DiscoverySourceResource_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 DiscoverySourceResource created on azure + // for more information of creating DiscoverySourceResource, please refer to the document of DiscoverySourceResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + string sourceName = "sourceTest1"; + ResourceIdentifier discoverySourceResourceId = DiscoverySourceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName, sourceName); + DiscoverySourceResource discoverySourceResource = client.GetDiscoverySourceResource(discoverySourceResourceId); + + // invoke the operation + await discoverySourceResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DiscoverySourcesUpdateGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/DiscoverySources_Update.json + // this example is just showing the usage of "DiscoverySourceResource_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 DiscoverySourceResource created on azure + // for more information of creating DiscoverySourceResource, please refer to the document of DiscoverySourceResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + string sourceName = "sourceTest1"; + ResourceIdentifier discoverySourceResourceId = DiscoverySourceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName, sourceName); + DiscoverySourceResource discoverySourceResource = client.GetDiscoverySourceResource(discoverySourceResourceId); + + // invoke the operation + DiscoverySourceResourcePatch patch = new DiscoverySourceResourcePatch + { + Tags = { }, + }; + ArmOperation lro = await discoverySourceResource.UpdateAsync(WaitUntil.Completed, patch); + DiscoverySourceResource 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 + DiscoverySourceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_DiscoverySourceResourceCollection.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_DiscoverySourceResourceCollection.cs new file mode 100644 index 000000000000..2f8f614fd834 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_DiscoverySourceResourceCollection.cs @@ -0,0 +1,199 @@ +// 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.DependencyMap.Samples +{ + public partial class Sample_DiscoverySourceResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DiscoverySourcesCreateOrUpdateGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/DiscoverySources_CreateOrUpdate.json + // this example is just showing the usage of "DiscoverySourceResource_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 MapsResource created on azure + // for more information of creating MapsResource, please refer to the document of MapsResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + ResourceIdentifier mapsResourceId = MapsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName); + MapsResource mapsResource = client.GetMapsResource(mapsResourceId); + + // get the collection of this DiscoverySourceResource + DiscoverySourceResourceCollection collection = mapsResource.GetDiscoverySourceResources(); + + // invoke the operation + string sourceName = "sourceTest1"; + DiscoverySourceResourceData data = new DiscoverySourceResourceData(new AzureLocation("y")) + { + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sourceName, data); + DiscoverySourceResource 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 + DiscoverySourceResourceData 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_DiscoverySourcesGetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/DiscoverySources_Get.json + // this example is just showing the usage of "DiscoverySourceResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MapsResource created on azure + // for more information of creating MapsResource, please refer to the document of MapsResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + ResourceIdentifier mapsResourceId = MapsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName); + MapsResource mapsResource = client.GetMapsResource(mapsResourceId); + + // get the collection of this DiscoverySourceResource + DiscoverySourceResourceCollection collection = mapsResource.GetDiscoverySourceResources(); + + // invoke the operation + string sourceName = "sourceTest1"; + DiscoverySourceResource result = await collection.GetAsync(sourceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DiscoverySourceResourceData 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_DiscoverySourcesListByMapsResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/DiscoverySources_ListByMapsResource.json + // this example is just showing the usage of "DiscoverySourceResource_ListByMapsResource" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MapsResource created on azure + // for more information of creating MapsResource, please refer to the document of MapsResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + ResourceIdentifier mapsResourceId = MapsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName); + MapsResource mapsResource = client.GetMapsResource(mapsResourceId); + + // get the collection of this DiscoverySourceResource + DiscoverySourceResourceCollection collection = mapsResource.GetDiscoverySourceResources(); + + // invoke the operation and iterate over the result + await foreach (DiscoverySourceResource 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 + DiscoverySourceResourceData 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_DiscoverySourcesGetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/DiscoverySources_Get.json + // this example is just showing the usage of "DiscoverySourceResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MapsResource created on azure + // for more information of creating MapsResource, please refer to the document of MapsResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + ResourceIdentifier mapsResourceId = MapsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName); + MapsResource mapsResource = client.GetMapsResource(mapsResourceId); + + // get the collection of this DiscoverySourceResource + DiscoverySourceResourceCollection collection = mapsResource.GetDiscoverySourceResources(); + + // invoke the operation + string sourceName = "sourceTest1"; + bool result = await collection.ExistsAsync(sourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_DiscoverySourcesGetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/DiscoverySources_Get.json + // this example is just showing the usage of "DiscoverySourceResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MapsResource created on azure + // for more information of creating MapsResource, please refer to the document of MapsResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + ResourceIdentifier mapsResourceId = MapsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName); + MapsResource mapsResource = client.GetMapsResource(mapsResourceId); + + // get the collection of this DiscoverySourceResource + DiscoverySourceResourceCollection collection = mapsResource.GetDiscoverySourceResources(); + + // invoke the operation + string sourceName = "sourceTest1"; + NullableResponse response = await collection.GetIfExistsAsync(sourceName); + DiscoverySourceResource 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 + DiscoverySourceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_MapsResource.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_MapsResource.cs new file mode 100644 index 000000000000..0f2d298c1a2b --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_MapsResource.cs @@ -0,0 +1,262 @@ +// 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.DependencyMap.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DependencyMap.Samples +{ + public partial class Sample_MapsResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MapsGetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/Maps_Get.json + // this example is just showing the usage of "MapsResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MapsResource created on azure + // for more information of creating MapsResource, please refer to the document of MapsResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + ResourceIdentifier mapsResourceId = MapsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName); + MapsResource mapsResource = client.GetMapsResource(mapsResourceId); + + // invoke the operation + MapsResource result = await mapsResource.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 + MapsResourceData 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_MapsDeleteGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/Maps_Delete.json + // this example is just showing the usage of "MapsResource_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 MapsResource created on azure + // for more information of creating MapsResource, please refer to the document of MapsResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + ResourceIdentifier mapsResourceId = MapsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName); + MapsResource mapsResource = client.GetMapsResource(mapsResourceId); + + // invoke the operation + await mapsResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_MapsUpdateGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/Maps_Update.json + // this example is just showing the usage of "MapsResource_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 MapsResource created on azure + // for more information of creating MapsResource, please refer to the document of MapsResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + ResourceIdentifier mapsResourceId = MapsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName); + MapsResource mapsResource = client.GetMapsResource(mapsResourceId); + + // invoke the operation + MapsResourcePatch patch = new MapsResourcePatch + { + Tags = { }, + }; + ArmOperation lro = await mapsResource.UpdateAsync(WaitUntil.Completed, patch); + MapsResource 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 + MapsResourceData 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 GetDependencyViewForFocusedMachine_MapsGetDependencyViewForFocusedMachineGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/Maps_GetDependencyViewForFocusedMachine.json + // this example is just showing the usage of "Maps_GetDependencyViewForFocusedMachine" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MapsResource created on azure + // for more information of creating MapsResource, please refer to the document of MapsResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + ResourceIdentifier mapsResourceId = MapsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName); + MapsResource mapsResource = client.GetMapsResource(mapsResourceId); + + // invoke the operation + GetDependencyViewForFocusedMachineContent content = new GetDependencyViewForFocusedMachineContent("imzykeisagngrnfinbqtu") + { + Filters = new DependencyMapVisualizationFilter + { + DateTime = new DateTimeFilter + { + StartDateTimeUtc = DateTimeOffset.Parse("2024-03-29T07:35:15.336Z"), + EndDateTimeUtc = DateTimeOffset.Parse("2024-03-29T07:35:15.336Z"), + }, + ProcessNameFilter = new ProcessNameFilter(ProcessNameFilterOperator.Contains, new string[] { "mnqtvduwzemjcvvmnnoqvcuemwhnz" }), + }, + }; + await mapsResource.GetDependencyViewForFocusedMachineAsync(WaitUntil.Completed, content); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetConnectionsWithConnectedMachineForFocusedMachine_MapsGetConnectionsWithConnectedMachineForFocusedMachineGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/Maps_GetConnectionsWithConnectedMachineForFocusedMachine.json + // this example is just showing the usage of "Maps_GetConnectionsWithConnectedMachineForFocusedMachine" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MapsResource created on azure + // for more information of creating MapsResource, please refer to the document of MapsResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + ResourceIdentifier mapsResourceId = MapsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName); + MapsResource mapsResource = client.GetMapsResource(mapsResourceId); + + // invoke the operation + GetConnectionsWithConnectedMachineForFocusedMachineContent content = new GetConnectionsWithConnectedMachineForFocusedMachineContent("gagovctcfgocievqwq", "enaieiloylabljxzvmyrshp") + { + Filters = new DependencyMapVisualizationFilter + { + DateTime = new DateTimeFilter + { + StartDateTimeUtc = DateTimeOffset.Parse("2024-03-29T07:35:15.336Z"), + EndDateTimeUtc = DateTimeOffset.Parse("2024-03-29T07:35:15.336Z"), + }, + ProcessNameFilter = new ProcessNameFilter(ProcessNameFilterOperator.Contains, new string[] { "mnqtvduwzemjcvvmnnoqvcuemwhnz" }), + }, + }; + await mapsResource.GetConnectionsWithConnectedMachineForFocusedMachineAsync(WaitUntil.Completed, content); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetConnectionsForProcessOnFocusedMachine_MapsGetConnectionsForProcessOnFocusedMachineGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/Maps_GetConnectionsForProcessOnFocusedMachine.json + // this example is just showing the usage of "Maps_GetConnectionsForProcessOnFocusedMachine" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MapsResource created on azure + // for more information of creating MapsResource, please refer to the document of MapsResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + ResourceIdentifier mapsResourceId = MapsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName); + MapsResource mapsResource = client.GetMapsResource(mapsResourceId); + + // invoke the operation + GetConnectionsForProcessOnFocusedMachineContent content = new GetConnectionsForProcessOnFocusedMachineContent("abjy", "yzldgsfupsfvzlztqoqpiv") + { + Filters = new DependencyMapVisualizationFilter + { + DateTime = new DateTimeFilter + { + StartDateTimeUtc = DateTimeOffset.Parse("2024-03-29T07:35:15.336Z"), + EndDateTimeUtc = DateTimeOffset.Parse("2024-03-29T07:35:15.336Z"), + }, + ProcessNameFilter = new ProcessNameFilter(ProcessNameFilterOperator.Contains, new string[] { "mnqtvduwzemjcvvmnnoqvcuemwhnz" }), + }, + }; + await mapsResource.GetConnectionsForProcessOnFocusedMachineAsync(WaitUntil.Completed, content); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task ExportDependencies_MapsExportDependenciesGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/Maps_ExportDependencies.json + // this example is just showing the usage of "Maps_ExportDependencies" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MapsResource created on azure + // for more information of creating MapsResource, please refer to the document of MapsResource + string subscriptionId = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + string mapName = "mapsTest1"; + ResourceIdentifier mapsResourceId = MapsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mapName); + MapsResource mapsResource = client.GetMapsResource(mapsResourceId); + + // invoke the operation + ExportDependenciesContent content = new ExportDependenciesContent("qzjpilzxpurauwfwwanpiiafvz") + { + Filters = new DependencyMapVisualizationFilter + { + DateTime = new DateTimeFilter + { + StartDateTimeUtc = DateTimeOffset.Parse("2024-03-29T07:35:15.336Z"), + EndDateTimeUtc = DateTimeOffset.Parse("2024-03-29T07:35:15.336Z"), + }, + ProcessNameFilter = new ProcessNameFilter(ProcessNameFilterOperator.Contains, new string[] { "mnqtvduwzemjcvvmnnoqvcuemwhnz" }), + }, + }; + await mapsResource.ExportDependenciesAsync(WaitUntil.Completed, content); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_MapsResourceCollection.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_MapsResourceCollection.cs new file mode 100644 index 000000000000..7f65001445da --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_MapsResourceCollection.cs @@ -0,0 +1,195 @@ +// 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.DependencyMap.Samples +{ + public partial class Sample_MapsResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_MapsCreateOrUpdateGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/Maps_CreateOrUpdate.json + // this example is just showing the usage of "MapsResource_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 = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MapsResource + MapsResourceCollection collection = resourceGroupResource.GetMapsResources(); + + // invoke the operation + string mapName = "mapsTest1"; + MapsResourceData data = new MapsResourceData(new AzureLocation("wjtzelgfcmswfeflfltwxqveo")) + { + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, mapName, data); + MapsResource 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 + MapsResourceData 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_MapsGetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/Maps_Get.json + // this example is just showing the usage of "MapsResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MapsResource + MapsResourceCollection collection = resourceGroupResource.GetMapsResources(); + + // invoke the operation + string mapName = "mapsTest1"; + MapsResource result = await collection.GetAsync(mapName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MapsResourceData 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_MapsListByResourceGroupGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/Maps_ListByResourceGroup.json + // this example is just showing the usage of "MapsResource_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 = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MapsResource + MapsResourceCollection collection = resourceGroupResource.GetMapsResources(); + + // invoke the operation and iterate over the result + await foreach (MapsResource 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 + MapsResourceData 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_MapsGetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/Maps_Get.json + // this example is just showing the usage of "MapsResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MapsResource + MapsResourceCollection collection = resourceGroupResource.GetMapsResources(); + + // invoke the operation + string mapName = "mapsTest1"; + bool result = await collection.ExistsAsync(mapName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_MapsGetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/Maps_Get.json + // this example is just showing the usage of "MapsResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + string resourceGroupName = "rgdependencyMap"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MapsResource + MapsResourceCollection collection = resourceGroupResource.GetMapsResources(); + + // invoke the operation + string mapName = "mapsTest1"; + NullableResponse response = await collection.GetIfExistsAsync(mapName); + MapsResource 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 + MapsResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..57785e453b0a --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/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.DependencyMap.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetMapsResources_MapsListBySubscriptionGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-01-31-preview/Maps_ListBySubscription.json + // this example is just showing the usage of "MapsResource_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 = "D6E58BDB-45F1-41EC-A884-1FC945058848"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (MapsResource item in subscriptionResource.GetMapsResourcesAsync()) + { + // 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 + MapsResourceData 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/dependencymap/Azure.ResourceManager.DependencyMap/src/Azure.ResourceManager.DependencyMap.csproj b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Azure.ResourceManager.DependencyMap.csproj new file mode 100644 index 000000000000..1101056c65ac --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Azure.ResourceManager.DependencyMap.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider DependencyMap. + 1.0.0-beta.1 + azure;management;arm;resource manager;dependencymap + Azure.ResourceManager.DependencyMap + + diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/ArmDependencyMapModelFactory.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/ArmDependencyMapModelFactory.cs new file mode 100644 index 000000000000..281b39254ed6 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/ArmDependencyMapModelFactory.cs @@ -0,0 +1,128 @@ +// 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.DependencyMap.Models +{ + /// Model factory for models. + public static partial class ArmDependencyMapModelFactory + { + /// 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 MapsResourceData MapsResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ProvisioningState? mapsResourceProvisioningState = null) + { + tags ??= new Dictionary(); + + return new MapsResourceData( + id, + name, + resourceType, + systemData, + tags, + location, + mapsResourceProvisioningState != null ? new MapsResourceProperties(mapsResourceProvisioningState, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Machine arm id. + /// Filters for GetSingleMachineDependencyView. + /// A new instance for mocking. + public static GetDependencyViewForFocusedMachineContent GetDependencyViewForFocusedMachineContent(string focusedMachineId = null, DependencyMapVisualizationFilter filters = null) + { + return new GetDependencyViewForFocusedMachineContent(focusedMachineId, filters, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Source machine arm id. + /// Destination machine arm id. + /// Filters for GetNetworkConnectionsBetweenMachines. + /// A new instance for mocking. + public static GetConnectionsWithConnectedMachineForFocusedMachineContent GetConnectionsWithConnectedMachineForFocusedMachineContent(string focusedMachineId = null, string connectedMachineId = null, DependencyMapVisualizationFilter filters = null) + { + return new GetConnectionsWithConnectedMachineForFocusedMachineContent(focusedMachineId, connectedMachineId, filters, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Machine arm id. + /// Process id. + /// Filters for GetProcessNetworkConnections. + /// A new instance for mocking. + public static GetConnectionsForProcessOnFocusedMachineContent GetConnectionsForProcessOnFocusedMachineContent(string focusedMachineId = null, string processIdOnFocusedMachine = null, DependencyMapVisualizationFilter filters = null) + { + return new GetConnectionsForProcessOnFocusedMachineContent(focusedMachineId, processIdOnFocusedMachine, filters, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Machine arm id. + /// Filters for ExportDependencies. + /// A new instance for mocking. + public static ExportDependenciesContent ExportDependenciesContent(string focusedMachineId = null, DependencyMapVisualizationFilter filters = null) + { + return new ExportDependenciesContent(focusedMachineId, filters, 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 . + /// + /// A new instance for mocking. + public static DiscoverySourceResourceData DiscoverySourceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DiscoverySourceResourceProperties properties = null) + { + tags ??= new Dictionary(); + + return new DiscoverySourceResourceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Provisioning state of Discovery Source resource. + /// Source type of Discovery Source resource. + /// Source ArmId of Discovery Source resource. + /// A new instance for mocking. + public static DiscoverySourceResourceProperties DiscoverySourceResourceProperties(ProvisioningState? provisioningState = null, string sourceType = null, string sourceId = null) + { + return new UnknownDiscoverySourceResourceProperties(provisioningState, sourceType == null ? default : new SourceType(sourceType), sourceId, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Provisioning state of Discovery Source resource. + /// Source ArmId of Discovery Source resource. + /// A new instance for mocking. + public static OffAzureDiscoverySourceResourceProperties OffAzureDiscoverySourceResourceProperties(ProvisioningState? provisioningState = null, string sourceId = null) + { + return new OffAzureDiscoverySourceResourceProperties(provisioningState, SourceType.OffAzure, sourceId, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResource.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResource.Serialization.cs new file mode 100644 index 000000000000..4c60b4c0579e --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResource.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.DependencyMap +{ + public partial class DiscoverySourceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DiscoverySourceResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DiscoverySourceResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResource.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResource.cs new file mode 100644 index 000000000000..bd8a50b64c51 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResource.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.DependencyMap.Models; + +namespace Azure.ResourceManager.DependencyMap +{ + /// + /// A Class representing a DiscoverySourceResource 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 GetDiscoverySourceResource method. + /// Otherwise you can get one from its parent resource using the GetDiscoverySourceResource method. + /// + public partial class DiscoverySourceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The mapName. + /// The sourceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string mapName, string sourceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _discoverySourceResourceDiscoverySourcesClientDiagnostics; + private readonly DiscoverySourcesRestOperations _discoverySourceResourceDiscoverySourcesRestClient; + private readonly DiscoverySourceResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DependencyMap/maps/discoverySources"; + + /// Initializes a new instance of the class for mocking. + protected DiscoverySourceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DiscoverySourceResource(ArmClient client, DiscoverySourceResourceData 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 DiscoverySourceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _discoverySourceResourceDiscoverySourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DependencyMap", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string discoverySourceResourceDiscoverySourcesApiVersion); + _discoverySourceResourceDiscoverySourcesRestClient = new DiscoverySourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, discoverySourceResourceDiscoverySourcesApiVersion); +#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 DiscoverySourceResourceData 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 DiscoverySourceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResource.Get"); + scope.Start(); + try + { + var response = await _discoverySourceResourceDiscoverySourcesRestClient.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 DiscoverySourceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DiscoverySourceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResource.Get"); + scope.Start(); + try + { + var response = _discoverySourceResourceDiscoverySourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DiscoverySourceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a DiscoverySourceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Delete + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResource.Delete"); + scope.Start(); + try + { + var response = await _discoverySourceResourceDiscoverySourcesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DependencyMapArmOperation(_discoverySourceResourceDiscoverySourcesClientDiagnostics, Pipeline, _discoverySourceResourceDiscoverySourcesRestClient.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 DiscoverySourceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Delete + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResource.Delete"); + scope.Start(); + try + { + var response = _discoverySourceResourceDiscoverySourcesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DependencyMapArmOperation(_discoverySourceResourceDiscoverySourcesClientDiagnostics, Pipeline, _discoverySourceResourceDiscoverySourcesRestClient.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 DiscoverySourceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Update + /// + /// + /// Default Api Version + /// 2025-01-31-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, DiscoverySourceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResource.Update"); + scope.Start(); + try + { + var response = await _discoverySourceResourceDiscoverySourcesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DependencyMapArmOperation(new DiscoverySourceResourceOperationSource(Client), _discoverySourceResourceDiscoverySourcesClientDiagnostics, Pipeline, _discoverySourceResourceDiscoverySourcesRestClient.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; + } + } + + /// + /// Update a DiscoverySourceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Update + /// + /// + /// Default Api Version + /// 2025-01-31-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, DiscoverySourceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResource.Update"); + scope.Start(); + try + { + var response = _discoverySourceResourceDiscoverySourcesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new DependencyMapArmOperation(new DiscoverySourceResourceOperationSource(Client), _discoverySourceResourceDiscoverySourcesClientDiagnostics, Pipeline, _discoverySourceResourceDiscoverySourcesRestClient.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; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResource.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 _discoverySourceResourceDiscoverySourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DiscoverySourceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DiscoverySourceResourcePatch(); + 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.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResource.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 = _discoverySourceResourceDiscoverySourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new DiscoverySourceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DiscoverySourceResourcePatch(); + 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.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResource.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 _discoverySourceResourceDiscoverySourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DiscoverySourceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DiscoverySourceResourcePatch(); + 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.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResource.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 = _discoverySourceResourceDiscoverySourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new DiscoverySourceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DiscoverySourceResourcePatch(); + 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.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResource.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 _discoverySourceResourceDiscoverySourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DiscoverySourceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DiscoverySourceResourcePatch(); + 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.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResource.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 = _discoverySourceResourceDiscoverySourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new DiscoverySourceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DiscoverySourceResourcePatch(); + 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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResourceCollection.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResourceCollection.cs new file mode 100644 index 000000000000..f9fe4bad6e83 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResourceCollection.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.DependencyMap +{ + /// + /// 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 GetDiscoverySourceResources method from an instance of . + /// + public partial class DiscoverySourceResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _discoverySourceResourceDiscoverySourcesClientDiagnostics; + private readonly DiscoverySourcesRestOperations _discoverySourceResourceDiscoverySourcesRestClient; + + /// Initializes a new instance of the class for mocking. + protected DiscoverySourceResourceCollection() + { + } + + /// 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 DiscoverySourceResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _discoverySourceResourceDiscoverySourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DependencyMap", DiscoverySourceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DiscoverySourceResource.ResourceType, out string discoverySourceResourceDiscoverySourcesApiVersion); + _discoverySourceResourceDiscoverySourcesRestClient = new DiscoverySourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, discoverySourceResourceDiscoverySourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MapsResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MapsResource.ResourceType), nameof(id)); + } + + /// + /// Create a DiscoverySourceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-31-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. + /// discovery source resource. + /// 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 sourceName, DiscoverySourceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _discoverySourceResourceDiscoverySourcesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceName, data, cancellationToken).ConfigureAwait(false); + var operation = new DependencyMapArmOperation(new DiscoverySourceResourceOperationSource(Client), _discoverySourceResourceDiscoverySourcesClientDiagnostics, Pipeline, _discoverySourceResourceDiscoverySourcesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceName, 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 DiscoverySourceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-31-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. + /// discovery source resource. + /// 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 sourceName, DiscoverySourceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _discoverySourceResourceDiscoverySourcesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceName, data, cancellationToken); + var operation = new DependencyMapArmOperation(new DiscoverySourceResourceOperationSource(Client), _discoverySourceResourceDiscoverySourcesClientDiagnostics, Pipeline, _discoverySourceResourceDiscoverySourcesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DiscoverySourceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// discovery source 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 sourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + + using var scope = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResourceCollection.Get"); + scope.Start(); + try + { + var response = await _discoverySourceResourceDiscoverySourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DiscoverySourceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DiscoverySourceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// discovery source resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string sourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + + using var scope = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResourceCollection.Get"); + scope.Start(); + try + { + var response = _discoverySourceResourceDiscoverySourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DiscoverySourceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List DiscoverySourceResource resources by MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources + /// + /// + /// Operation Id + /// DiscoverySourceResource_ListByMapsResource + /// + /// + /// Default Api Version + /// 2025-01-31-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) => _discoverySourceResourceDiscoverySourcesRestClient.CreateListByMapsResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _discoverySourceResourceDiscoverySourcesRestClient.CreateListByMapsResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DiscoverySourceResource(Client, DiscoverySourceResourceData.DeserializeDiscoverySourceResourceData(e)), _discoverySourceResourceDiscoverySourcesClientDiagnostics, Pipeline, "DiscoverySourceResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List DiscoverySourceResource resources by MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources + /// + /// + /// Operation Id + /// DiscoverySourceResource_ListByMapsResource + /// + /// + /// Default Api Version + /// 2025-01-31-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) => _discoverySourceResourceDiscoverySourcesRestClient.CreateListByMapsResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _discoverySourceResourceDiscoverySourcesRestClient.CreateListByMapsResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DiscoverySourceResource(Client, DiscoverySourceResourceData.DeserializeDiscoverySourceResourceData(e)), _discoverySourceResourceDiscoverySourcesClientDiagnostics, Pipeline, "DiscoverySourceResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// discovery source 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 sourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + + using var scope = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _discoverySourceResourceDiscoverySourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceName, 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.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// discovery source resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string sourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + + using var scope = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResourceCollection.Exists"); + scope.Start(); + try + { + var response = _discoverySourceResourceDiscoverySourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceName, 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.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// discovery source 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 sourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + + using var scope = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _discoverySourceResourceDiscoverySourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DiscoverySourceResource(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.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// discovery source resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string sourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + + using var scope = _discoverySourceResourceDiscoverySourcesClientDiagnostics.CreateScope("DiscoverySourceResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _discoverySourceResourceDiscoverySourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DiscoverySourceResource(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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResourceData.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResourceData.Serialization.cs new file mode 100644 index 000000000000..63860ef62163 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResourceData.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.DependencyMap.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DependencyMap +{ + public partial class DiscoverySourceResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DiscoverySourceResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DiscoverySourceResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoverySourceResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoverySourceResourceData(document.RootElement, options); + } + + internal static DiscoverySourceResourceData DeserializeDiscoverySourceResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DiscoverySourceResourceProperties 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 = DiscoverySourceResourceProperties.DeserializeDiscoverySourceResourceProperties(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 DiscoverySourceResourceData( + 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(DiscoverySourceResourceData)} does not support writing '{options.Format}' format."); + } + } + + DiscoverySourceResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiscoverySourceResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoverySourceResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResourceData.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResourceData.cs new file mode 100644 index 000000000000..09d306dc5427 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/DiscoverySourceResourceData.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.DependencyMap.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DependencyMap +{ + /// + /// A class representing the DiscoverySourceResource data model. + /// A Discovery Source resource + /// + public partial class DiscoverySourceResourceData : 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 DiscoverySourceResourceData(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 . + /// + /// Keeps track of any properties unknown to the library. + internal DiscoverySourceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DiscoverySourceResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DiscoverySourceResourceData() + { + } + + /// + /// 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 . + /// + public DiscoverySourceResourceProperties Properties { get; set; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/DependencyMapExtensions.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/DependencyMapExtensions.cs new file mode 100644 index 000000000000..8ca9a2ac6150 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/DependencyMapExtensions.cs @@ -0,0 +1,238 @@ +// 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.DependencyMap.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DependencyMap +{ + /// A class to add extension methods to Azure.ResourceManager.DependencyMap. + public static partial class DependencyMapExtensions + { + private static MockableDependencyMapArmClient GetMockableDependencyMapArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableDependencyMapArmClient(client0)); + } + + private static MockableDependencyMapResourceGroupResource GetMockableDependencyMapResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableDependencyMapResourceGroupResource(client, resource.Id)); + } + + private static MockableDependencyMapSubscriptionResource GetMockableDependencyMapSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableDependencyMapSubscriptionResource(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 MapsResource GetMapsResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDependencyMapArmClient(client).GetMapsResource(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 DiscoverySourceResource GetDiscoverySourceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDependencyMapArmClient(client).GetDiscoverySourceResource(id); + } + + /// + /// Gets a collection of MapsResources 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 MapsResources and their operations over a MapsResource. + public static MapsResourceCollection GetMapsResources(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDependencyMapResourceGroupResource(resourceGroupResource).GetMapsResources(); + } + + /// + /// Get a MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Maps resource 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> GetMapsResourceAsync(this ResourceGroupResource resourceGroupResource, string mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableDependencyMapResourceGroupResource(resourceGroupResource).GetMapsResourceAsync(mapName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Maps resource name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetMapsResource(this ResourceGroupResource resourceGroupResource, string mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDependencyMapResourceGroupResource(resourceGroupResource).GetMapsResource(mapName, cancellationToken); + } + + /// + /// List MapsResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DependencyMap/maps + /// + /// + /// Operation Id + /// MapsResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-01-31-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 GetMapsResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDependencyMapSubscriptionResource(subscriptionResource).GetMapsResourcesAsync(cancellationToken); + } + + /// + /// List MapsResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DependencyMap/maps + /// + /// + /// Operation Id + /// MapsResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-01-31-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 GetMapsResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDependencyMapSubscriptionResource(subscriptionResource).GetMapsResources(cancellationToken); + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/MockableDependencyMapArmClient.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/MockableDependencyMapArmClient.cs new file mode 100644 index 000000000000..c294211bb6a4 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/MockableDependencyMapArmClient.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.DependencyMap.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableDependencyMapArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableDependencyMapArmClient() + { + } + + /// 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 MockableDependencyMapArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableDependencyMapArmClient(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 MapsResource GetMapsResource(ResourceIdentifier id) + { + MapsResource.ValidateResourceId(id); + return new MapsResource(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 DiscoverySourceResource GetDiscoverySourceResource(ResourceIdentifier id) + { + DiscoverySourceResource.ValidateResourceId(id); + return new DiscoverySourceResource(Client, id); + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/MockableDependencyMapResourceGroupResource.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/MockableDependencyMapResourceGroupResource.cs new file mode 100644 index 000000000000..b87c26c0090b --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/MockableDependencyMapResourceGroupResource.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.DependencyMap.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableDependencyMapResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableDependencyMapResourceGroupResource() + { + } + + /// 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 MockableDependencyMapResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of MapsResources in the ResourceGroupResource. + /// An object representing collection of MapsResources and their operations over a MapsResource. + public virtual MapsResourceCollection GetMapsResources() + { + return GetCachedClient(client => new MapsResourceCollection(client, Id)); + } + + /// + /// Get a MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Maps resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMapsResourceAsync(string mapName, CancellationToken cancellationToken = default) + { + return await GetMapsResources().GetAsync(mapName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Maps resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMapsResource(string mapName, CancellationToken cancellationToken = default) + { + return GetMapsResources().Get(mapName, cancellationToken); + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/MockableDependencyMapSubscriptionResource.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/MockableDependencyMapSubscriptionResource.cs new file mode 100644 index 000000000000..cc9d1df84a21 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Extensions/MockableDependencyMapSubscriptionResource.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.DependencyMap.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableDependencyMapSubscriptionResource : ArmResource + { + private ClientDiagnostics _mapsResourceMapsClientDiagnostics; + private MapsRestOperations _mapsResourceMapsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableDependencyMapSubscriptionResource() + { + } + + /// 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 MockableDependencyMapSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics MapsResourceMapsClientDiagnostics => _mapsResourceMapsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DependencyMap", MapsResource.ResourceType.Namespace, Diagnostics); + private MapsRestOperations MapsResourceMapsRestClient => _mapsResourceMapsRestClient ??= new MapsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(MapsResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List MapsResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DependencyMap/maps + /// + /// + /// Operation Id + /// MapsResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetMapsResourcesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => MapsResourceMapsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MapsResourceMapsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MapsResource(Client, MapsResourceData.DeserializeMapsResourceData(e)), MapsResourceMapsClientDiagnostics, Pipeline, "MockableDependencyMapSubscriptionResource.GetMapsResources", "value", "nextLink", cancellationToken); + } + + /// + /// List MapsResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DependencyMap/maps + /// + /// + /// Operation Id + /// MapsResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetMapsResources(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => MapsResourceMapsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MapsResourceMapsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MapsResource(Client, MapsResourceData.DeserializeMapsResourceData(e)), MapsResourceMapsClientDiagnostics, Pipeline, "MockableDependencyMapSubscriptionResource.GetMapsResources", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/Argument.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..a9994a6d0534 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/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.DependencyMap +{ + 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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..9c7da1d4c95d --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/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.DependencyMap +{ + 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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/ChangeTrackingList.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..288d4d1bae98 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/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.DependencyMap +{ + 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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..684a04e8e4ea --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/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.DependencyMap +{ + 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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/Optional.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..d1f550245273 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/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.DependencyMap +{ + 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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..ba336e222cdc --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/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.DependencyMap +{ + 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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/DependencyMapArmOperation.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/DependencyMapArmOperation.cs new file mode 100644 index 000000000000..2c13585bc2d3 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/DependencyMapArmOperation.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.DependencyMap +{ +#pragma warning disable SA1649 // File name should match first type name + internal class DependencyMapArmOperation : 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 DependencyMapArmOperation for mocking. + protected DependencyMapArmOperation() + { + } + + internal DependencyMapArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal DependencyMapArmOperation(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, "DependencyMapArmOperation", 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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/DependencyMapArmOperationOfT.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/DependencyMapArmOperationOfT.cs new file mode 100644 index 000000000000..edb2ace2293c --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/DependencyMapArmOperationOfT.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.DependencyMap +{ +#pragma warning disable SA1649 // File name should match first type name + internal class DependencyMapArmOperation : 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 DependencyMapArmOperation for mocking. + protected DependencyMapArmOperation() + { + } + + internal DependencyMapArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal DependencyMapArmOperation(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, "DependencyMapArmOperation", 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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/DiscoverySourceResourceOperationSource.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/DiscoverySourceResourceOperationSource.cs new file mode 100644 index 000000000000..801dedad27f1 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/DiscoverySourceResourceOperationSource.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.DependencyMap +{ + internal class DiscoverySourceResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DiscoverySourceResourceOperationSource(ArmClient client) + { + _client = client; + } + + DiscoverySourceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new DiscoverySourceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new DiscoverySourceResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/MapsResourceOperationSource.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/MapsResourceOperationSource.cs new file mode 100644 index 000000000000..d77ea1badfce --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/LongRunningOperation/MapsResourceOperationSource.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.DependencyMap +{ + internal class MapsResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MapsResourceOperationSource(ArmClient client) + { + _client = client; + } + + MapsResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new MapsResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new MapsResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResource.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResource.Serialization.cs new file mode 100644 index 000000000000..7fb1777b6c17 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResource.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.DependencyMap +{ + public partial class MapsResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MapsResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MapsResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResource.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResource.cs new file mode 100644 index 000000000000..a89063002380 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResource.cs @@ -0,0 +1,1144 @@ +// 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.DependencyMap.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DependencyMap +{ + /// + /// A Class representing a MapsResource 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 GetMapsResource method. + /// Otherwise you can get one from its parent resource using the GetMapsResource method. + /// + public partial class MapsResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The mapName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string mapName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _mapsResourceMapsClientDiagnostics; + private readonly MapsRestOperations _mapsResourceMapsRestClient; + private readonly MapsResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DependencyMap/maps"; + + /// Initializes a new instance of the class for mocking. + protected MapsResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MapsResource(ArmClient client, MapsResourceData 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 MapsResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _mapsResourceMapsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DependencyMap", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string mapsResourceMapsApiVersion); + _mapsResourceMapsRestClient = new MapsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, mapsResourceMapsApiVersion); +#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 MapsResourceData 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 DiscoverySourceResources in the MapsResource. + /// An object representing collection of DiscoverySourceResources and their operations over a DiscoverySourceResource. + public virtual DiscoverySourceResourceCollection GetDiscoverySourceResources() + { + return GetCachedClient(client => new DiscoverySourceResourceCollection(client, Id)); + } + + /// + /// Get a DiscoverySourceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// discovery source resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDiscoverySourceResourceAsync(string sourceName, CancellationToken cancellationToken = default) + { + return await GetDiscoverySourceResources().GetAsync(sourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DiscoverySourceResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/discoverySources/{sourceName} + /// + /// + /// Operation Id + /// DiscoverySourceResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// discovery source resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDiscoverySourceResource(string sourceName, CancellationToken cancellationToken = default) + { + return GetDiscoverySourceResources().Get(sourceName, cancellationToken); + } + + /// + /// Get a MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.Get"); + scope.Start(); + try + { + var response = await _mapsResourceMapsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MapsResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.Get"); + scope.Start(); + try + { + var response = _mapsResourceMapsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MapsResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Delete + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.Delete"); + scope.Start(); + try + { + var response = await _mapsResourceMapsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DependencyMapArmOperation(_mapsResourceMapsClientDiagnostics, Pipeline, _mapsResourceMapsRestClient.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 MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Delete + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.Delete"); + scope.Start(); + try + { + var response = _mapsResourceMapsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new DependencyMapArmOperation(_mapsResourceMapsClientDiagnostics, Pipeline, _mapsResourceMapsRestClient.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 MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Update + /// + /// + /// Default Api Version + /// 2025-01-31-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, MapsResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.Update"); + scope.Start(); + try + { + var response = await _mapsResourceMapsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DependencyMapArmOperation(new MapsResourceOperationSource(Client), _mapsResourceMapsClientDiagnostics, Pipeline, _mapsResourceMapsRestClient.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 MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Update + /// + /// + /// Default Api Version + /// 2025-01-31-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, MapsResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.Update"); + scope.Start(); + try + { + var response = _mapsResourceMapsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new DependencyMapArmOperation(new MapsResourceOperationSource(Client), _mapsResourceMapsClientDiagnostics, Pipeline, _mapsResourceMapsRestClient.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; + } + } + + /// + /// Get dependency map of single machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/getDependencyViewForFocusedMachine + /// + /// + /// Operation Id + /// Maps_GetDependencyViewForFocusedMachine + /// + /// + /// Default Api Version + /// 2025-01-31-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 GetDependencyViewForFocusedMachineAsync(WaitUntil waitUntil, GetDependencyViewForFocusedMachineContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.GetDependencyViewForFocusedMachine"); + scope.Start(); + try + { + var response = await _mapsResourceMapsRestClient.GetDependencyViewForFocusedMachineAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new DependencyMapArmOperation(_mapsResourceMapsClientDiagnostics, Pipeline, _mapsResourceMapsRestClient.CreateGetDependencyViewForFocusedMachineRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Get dependency map of single machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/getDependencyViewForFocusedMachine + /// + /// + /// Operation Id + /// Maps_GetDependencyViewForFocusedMachine + /// + /// + /// Default Api Version + /// 2025-01-31-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 GetDependencyViewForFocusedMachine(WaitUntil waitUntil, GetDependencyViewForFocusedMachineContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.GetDependencyViewForFocusedMachine"); + scope.Start(); + try + { + var response = _mapsResourceMapsRestClient.GetDependencyViewForFocusedMachine(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new DependencyMapArmOperation(_mapsResourceMapsClientDiagnostics, Pipeline, _mapsResourceMapsRestClient.CreateGetDependencyViewForFocusedMachineRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get network connections between machines + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/getConnectionsWithConnectedMachineForFocusedMachine + /// + /// + /// Operation Id + /// Maps_GetConnectionsWithConnectedMachineForFocusedMachine + /// + /// + /// Default Api Version + /// 2025-01-31-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 GetConnectionsWithConnectedMachineForFocusedMachineAsync(WaitUntil waitUntil, GetConnectionsWithConnectedMachineForFocusedMachineContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.GetConnectionsWithConnectedMachineForFocusedMachine"); + scope.Start(); + try + { + var response = await _mapsResourceMapsRestClient.GetConnectionsWithConnectedMachineForFocusedMachineAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new DependencyMapArmOperation(_mapsResourceMapsClientDiagnostics, Pipeline, _mapsResourceMapsRestClient.CreateGetConnectionsWithConnectedMachineForFocusedMachineRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Get network connections between machines + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/getConnectionsWithConnectedMachineForFocusedMachine + /// + /// + /// Operation Id + /// Maps_GetConnectionsWithConnectedMachineForFocusedMachine + /// + /// + /// Default Api Version + /// 2025-01-31-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 GetConnectionsWithConnectedMachineForFocusedMachine(WaitUntil waitUntil, GetConnectionsWithConnectedMachineForFocusedMachineContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.GetConnectionsWithConnectedMachineForFocusedMachine"); + scope.Start(); + try + { + var response = _mapsResourceMapsRestClient.GetConnectionsWithConnectedMachineForFocusedMachine(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new DependencyMapArmOperation(_mapsResourceMapsClientDiagnostics, Pipeline, _mapsResourceMapsRestClient.CreateGetConnectionsWithConnectedMachineForFocusedMachineRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get network connections of a process + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/getConnectionsForProcessOnFocusedMachine + /// + /// + /// Operation Id + /// Maps_GetConnectionsForProcessOnFocusedMachine + /// + /// + /// Default Api Version + /// 2025-01-31-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 GetConnectionsForProcessOnFocusedMachineAsync(WaitUntil waitUntil, GetConnectionsForProcessOnFocusedMachineContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.GetConnectionsForProcessOnFocusedMachine"); + scope.Start(); + try + { + var response = await _mapsResourceMapsRestClient.GetConnectionsForProcessOnFocusedMachineAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new DependencyMapArmOperation(_mapsResourceMapsClientDiagnostics, Pipeline, _mapsResourceMapsRestClient.CreateGetConnectionsForProcessOnFocusedMachineRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Get network connections of a process + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/getConnectionsForProcessOnFocusedMachine + /// + /// + /// Operation Id + /// Maps_GetConnectionsForProcessOnFocusedMachine + /// + /// + /// Default Api Version + /// 2025-01-31-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 GetConnectionsForProcessOnFocusedMachine(WaitUntil waitUntil, GetConnectionsForProcessOnFocusedMachineContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.GetConnectionsForProcessOnFocusedMachine"); + scope.Start(); + try + { + var response = _mapsResourceMapsRestClient.GetConnectionsForProcessOnFocusedMachine(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new DependencyMapArmOperation(_mapsResourceMapsClientDiagnostics, Pipeline, _mapsResourceMapsRestClient.CreateGetConnectionsForProcessOnFocusedMachineRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Export dependencies + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/exportDependencies + /// + /// + /// Operation Id + /// Maps_ExportDependencies + /// + /// + /// Default Api Version + /// 2025-01-31-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 ExportDependenciesAsync(WaitUntil waitUntil, ExportDependenciesContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.ExportDependencies"); + scope.Start(); + try + { + var response = await _mapsResourceMapsRestClient.ExportDependenciesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new DependencyMapArmOperation(_mapsResourceMapsClientDiagnostics, Pipeline, _mapsResourceMapsRestClient.CreateExportDependenciesRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Export dependencies + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName}/exportDependencies + /// + /// + /// Operation Id + /// Maps_ExportDependencies + /// + /// + /// Default Api Version + /// 2025-01-31-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 ExportDependencies(WaitUntil waitUntil, ExportDependenciesContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.ExportDependencies"); + scope.Start(); + try + { + var response = _mapsResourceMapsRestClient.ExportDependencies(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new DependencyMapArmOperation(_mapsResourceMapsClientDiagnostics, Pipeline, _mapsResourceMapsRestClient.CreateExportDependenciesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(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.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.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 _mapsResourceMapsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new MapsResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new MapsResourcePatch(); + 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.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.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 = _mapsResourceMapsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new MapsResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new MapsResourcePatch(); + 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.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.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 _mapsResourceMapsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new MapsResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new MapsResourcePatch(); + 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.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.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 = _mapsResourceMapsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new MapsResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new MapsResourcePatch(); + 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.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.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 _mapsResourceMapsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new MapsResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new MapsResourcePatch(); + 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.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-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 = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResource.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 = _mapsResourceMapsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new MapsResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new MapsResourcePatch(); + 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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResourceCollection.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResourceCollection.cs new file mode 100644 index 000000000000..d690aa0d114f --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResourceCollection.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.DependencyMap +{ + /// + /// 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 GetMapsResources method from an instance of . + /// + public partial class MapsResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _mapsResourceMapsClientDiagnostics; + private readonly MapsRestOperations _mapsResourceMapsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MapsResourceCollection() + { + } + + /// 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 MapsResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _mapsResourceMapsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DependencyMap", MapsResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MapsResource.ResourceType, out string mapsResourceMapsApiVersion); + _mapsResourceMapsRestClient = new MapsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, mapsResourceMapsApiVersion); +#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 MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-31-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. + /// Maps resource 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 mapName, MapsResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _mapsResourceMapsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, mapName, data, cancellationToken).ConfigureAwait(false); + var operation = new DependencyMapArmOperation(new MapsResourceOperationSource(Client), _mapsResourceMapsClientDiagnostics, Pipeline, _mapsResourceMapsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, mapName, 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 MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-01-31-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. + /// Maps resource 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 mapName, MapsResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _mapsResourceMapsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, mapName, data, cancellationToken); + var operation = new DependencyMapArmOperation(new MapsResourceOperationSource(Client), _mapsResourceMapsClientDiagnostics, Pipeline, _mapsResourceMapsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, mapName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Maps resource 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 mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResourceCollection.Get"); + scope.Start(); + try + { + var response = await _mapsResourceMapsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, mapName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MapsResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a MapsResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Maps resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResourceCollection.Get"); + scope.Start(); + try + { + var response = _mapsResourceMapsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, mapName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MapsResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List MapsResource resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps + /// + /// + /// Operation Id + /// MapsResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-01-31-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) => _mapsResourceMapsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _mapsResourceMapsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MapsResource(Client, MapsResourceData.DeserializeMapsResourceData(e)), _mapsResourceMapsClientDiagnostics, Pipeline, "MapsResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List MapsResource resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps + /// + /// + /// Operation Id + /// MapsResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-01-31-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) => _mapsResourceMapsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _mapsResourceMapsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MapsResource(Client, MapsResourceData.DeserializeMapsResourceData(e)), _mapsResourceMapsClientDiagnostics, Pipeline, "MapsResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Maps resource 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 mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _mapsResourceMapsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, mapName, 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.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Maps resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResourceCollection.Exists"); + scope.Start(); + try + { + var response = _mapsResourceMapsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, mapName, 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.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Maps resource 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 mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _mapsResourceMapsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, mapName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MapsResource(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.DependencyMap/maps/{mapName} + /// + /// + /// Operation Id + /// MapsResource_Get + /// + /// + /// Default Api Version + /// 2025-01-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Maps resource name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + + using var scope = _mapsResourceMapsClientDiagnostics.CreateScope("MapsResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _mapsResourceMapsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, mapName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MapsResource(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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResourceData.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResourceData.Serialization.cs new file mode 100644 index 000000000000..a09a0c90bad7 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResourceData.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.DependencyMap.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DependencyMap +{ + public partial class MapsResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(MapsResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + MapsResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MapsResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMapsResourceData(document.RootElement, options); + } + + internal static MapsResourceData DeserializeMapsResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MapsResourceProperties 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 = MapsResourceProperties.DeserializeMapsResourceProperties(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 MapsResourceData( + 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(MapsResourceData)} does not support writing '{options.Format}' format."); + } + } + + MapsResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMapsResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MapsResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResourceData.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResourceData.cs new file mode 100644 index 000000000000..beafdfe4b15c --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/MapsResourceData.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.DependencyMap.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DependencyMap +{ + /// + /// A class representing the MapsResource data model. + /// A Maps resource + /// + public partial class MapsResourceData : 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 MapsResourceData(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 MapsResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MapsResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MapsResourceData() + { + } + + /// The resource-specific properties for this resource. + internal MapsResourceProperties Properties { get; set; } + /// Provisioning state of Maps resource. + public ProvisioningState? MapsResourceProvisioningState + { + get => Properties is null ? default : Properties.ProvisioningState; + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DateTimeFilter.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DateTimeFilter.Serialization.cs new file mode 100644 index 000000000000..37684fbe7c41 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DateTimeFilter.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.DependencyMap.Models +{ + public partial class DateTimeFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DateTimeFilter)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(StartDateTimeUtc)) + { + writer.WritePropertyName("startDateTimeUtc"u8); + writer.WriteStringValue(StartDateTimeUtc.Value, "O"); + } + if (Optional.IsDefined(EndDateTimeUtc)) + { + writer.WritePropertyName("endDateTimeUtc"u8); + writer.WriteStringValue(EndDateTimeUtc.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 + } + } + } + + DateTimeFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DateTimeFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDateTimeFilter(document.RootElement, options); + } + + internal static DateTimeFilter DeserializeDateTimeFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? startDateTimeUtc = default; + DateTimeOffset? endDateTimeUtc = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startDateTimeUtc"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startDateTimeUtc = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endDateTimeUtc"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endDateTimeUtc = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DateTimeFilter(startDateTimeUtc, endDateTimeUtc, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DateTimeFilter)} does not support writing '{options.Format}' format."); + } + } + + DateTimeFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDateTimeFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DateTimeFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DateTimeFilter.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DateTimeFilter.cs new file mode 100644 index 000000000000..b868c07edd8f --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DateTimeFilter.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.DependencyMap.Models +{ + /// UTC DateTime filter for dependency map visualization apis. + public partial class DateTimeFilter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DateTimeFilter() + { + } + + /// Initializes a new instance of . + /// Start date time for dependency map visualization query. + /// End date time for dependency map visualization query. + /// Keeps track of any properties unknown to the library. + internal DateTimeFilter(DateTimeOffset? startDateTimeUtc, DateTimeOffset? endDateTimeUtc, IDictionary serializedAdditionalRawData) + { + StartDateTimeUtc = startDateTimeUtc; + EndDateTimeUtc = endDateTimeUtc; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Start date time for dependency map visualization query. + public DateTimeOffset? StartDateTimeUtc { get; set; } + /// End date time for dependency map visualization query. + public DateTimeOffset? EndDateTimeUtc { get; set; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DependencyMapVisualizationFilter.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DependencyMapVisualizationFilter.Serialization.cs new file mode 100644 index 000000000000..33a328d50cf7 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DependencyMapVisualizationFilter.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.DependencyMap.Models +{ + public partial class DependencyMapVisualizationFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DependencyMapVisualizationFilter)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DateTime)) + { + writer.WritePropertyName("dateTime"u8); + writer.WriteObjectValue(DateTime, options); + } + if (Optional.IsDefined(ProcessNameFilter)) + { + writer.WritePropertyName("processNameFilter"u8); + writer.WriteObjectValue(ProcessNameFilter, 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 + } + } + } + + DependencyMapVisualizationFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DependencyMapVisualizationFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDependencyMapVisualizationFilter(document.RootElement, options); + } + + internal static DependencyMapVisualizationFilter DeserializeDependencyMapVisualizationFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeFilter dateTime = default; + ProcessNameFilter processNameFilter = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dateTime = DateTimeFilter.DeserializeDateTimeFilter(property.Value, options); + continue; + } + if (property.NameEquals("processNameFilter"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + processNameFilter = ProcessNameFilter.DeserializeProcessNameFilter(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DependencyMapVisualizationFilter(dateTime, processNameFilter, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DependencyMapVisualizationFilter)} does not support writing '{options.Format}' format."); + } + } + + DependencyMapVisualizationFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDependencyMapVisualizationFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DependencyMapVisualizationFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DependencyMapVisualizationFilter.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DependencyMapVisualizationFilter.cs new file mode 100644 index 000000000000..c2d1ddc2a0d6 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DependencyMapVisualizationFilter.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.DependencyMap.Models +{ + /// Filters for dependency map visualization apis. + public partial class DependencyMapVisualizationFilter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DependencyMapVisualizationFilter() + { + } + + /// Initializes a new instance of . + /// DateTime filter. + /// Process name filter. + /// Keeps track of any properties unknown to the library. + internal DependencyMapVisualizationFilter(DateTimeFilter dateTime, ProcessNameFilter processNameFilter, IDictionary serializedAdditionalRawData) + { + DateTime = dateTime; + ProcessNameFilter = processNameFilter; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// DateTime filter. + public DateTimeFilter DateTime { get; set; } + /// Process name filter. + public ProcessNameFilter ProcessNameFilter { get; set; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceListResult.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceListResult.Serialization.cs new file mode 100644 index 000000000000..52eafc8be135 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceListResult.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.DependencyMap.Models +{ + internal partial class DiscoverySourceResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoverySourceResourceListResult)} 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 + } + } + } + + DiscoverySourceResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoverySourceResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoverySourceResourceListResult(document.RootElement, options); + } + + internal static DiscoverySourceResourceListResult DeserializeDiscoverySourceResourceListResult(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(DiscoverySourceResourceData.DeserializeDiscoverySourceResourceData(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 DiscoverySourceResourceListResult(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(DiscoverySourceResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + DiscoverySourceResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiscoverySourceResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoverySourceResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceListResult.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceListResult.cs new file mode 100644 index 000000000000..dcfd6ebfb123 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceListResult.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.DependencyMap.Models +{ + /// The response of a DiscoverySourceResource list operation. + internal partial class DiscoverySourceResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DiscoverySourceResource items on this page. + /// is null. + internal DiscoverySourceResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The DiscoverySourceResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DiscoverySourceResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DiscoverySourceResourceListResult() + { + } + + /// The DiscoverySourceResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourcePatch.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourcePatch.Serialization.cs new file mode 100644 index 000000000000..1a85dcac3603 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourcePatch.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.DependencyMap.Models +{ + public partial class DiscoverySourceResourcePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoverySourceResourcePatch)} 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 + } + } + } + + DiscoverySourceResourcePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoverySourceResourcePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoverySourceResourcePatch(document.RootElement, options); + } + + internal static DiscoverySourceResourcePatch DeserializeDiscoverySourceResourcePatch(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 DiscoverySourceResourcePatch(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(DiscoverySourceResourcePatch)} does not support writing '{options.Format}' format."); + } + } + + DiscoverySourceResourcePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiscoverySourceResourcePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoverySourceResourcePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourcePatch.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourcePatch.cs new file mode 100644 index 000000000000..297fb82be416 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourcePatch.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.DependencyMap.Models +{ + /// The type used for updating tags in DiscoverySourceResource resources. + public partial class DiscoverySourceResourcePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DiscoverySourceResourcePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Keeps track of any properties unknown to the library. + internal DiscoverySourceResourcePatch(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceProperties.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceProperties.Serialization.cs new file mode 100644 index 000000000000..c5a7994fa01e --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceProperties.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.DependencyMap.Models +{ + [PersistableModelProxy(typeof(UnknownDiscoverySourceResourceProperties))] + public partial class DiscoverySourceResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoverySourceResourceProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("sourceType"u8); + writer.WriteStringValue(SourceType.ToString()); + writer.WritePropertyName("sourceId"u8); + writer.WriteStringValue(SourceId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiscoverySourceResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoverySourceResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoverySourceResourceProperties(document.RootElement, options); + } + + internal static DiscoverySourceResourceProperties DeserializeDiscoverySourceResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("sourceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "OffAzure": return OffAzureDiscoverySourceResourceProperties.DeserializeOffAzureDiscoverySourceResourceProperties(element, options); + } + } + return UnknownDiscoverySourceResourceProperties.DeserializeUnknownDiscoverySourceResourceProperties(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(DiscoverySourceResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + DiscoverySourceResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiscoverySourceResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoverySourceResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceProperties.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceProperties.cs new file mode 100644 index 000000000000..e7e871ce23af --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/DiscoverySourceResourceProperties.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.DependencyMap.Models +{ + /// + /// The properties of Discovery Source 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 . + /// + public abstract partial class DiscoverySourceResourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 . + /// Source ArmId of Discovery Source resource. + /// is null. + protected DiscoverySourceResourceProperties(string sourceId) + { + Argument.AssertNotNull(sourceId, nameof(sourceId)); + + SourceId = sourceId; + } + + /// Initializes a new instance of . + /// Provisioning state of Discovery Source resource. + /// Source type of Discovery Source resource. + /// Source ArmId of Discovery Source resource. + /// Keeps track of any properties unknown to the library. + internal DiscoverySourceResourceProperties(ProvisioningState? provisioningState, SourceType sourceType, string sourceId, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + SourceType = sourceType; + SourceId = sourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DiscoverySourceResourceProperties() + { + } + + /// Provisioning state of Discovery Source resource. + public ProvisioningState? ProvisioningState { get; } + /// Source type of Discovery Source resource. + internal SourceType SourceType { get; set; } + /// Source ArmId of Discovery Source resource. + public string SourceId { get; set; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ExportDependenciesContent.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ExportDependenciesContent.Serialization.cs new file mode 100644 index 000000000000..28b050194b23 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ExportDependenciesContent.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.DependencyMap.Models +{ + public partial class ExportDependenciesContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportDependenciesContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("focusedMachineId"u8); + writer.WriteStringValue(FocusedMachineId); + if (Optional.IsDefined(Filters)) + { + writer.WritePropertyName("filters"u8); + writer.WriteObjectValue(Filters, 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 + } + } + } + + ExportDependenciesContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportDependenciesContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportDependenciesContent(document.RootElement, options); + } + + internal static ExportDependenciesContent DeserializeExportDependenciesContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string focusedMachineId = default; + DependencyMapVisualizationFilter filters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("focusedMachineId"u8)) + { + focusedMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("filters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + filters = DependencyMapVisualizationFilter.DeserializeDependencyMapVisualizationFilter(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportDependenciesContent(focusedMachineId, filters, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportDependenciesContent)} does not support writing '{options.Format}' format."); + } + } + + ExportDependenciesContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExportDependenciesContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportDependenciesContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ExportDependenciesContent.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ExportDependenciesContent.cs new file mode 100644 index 000000000000..4459196293f2 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ExportDependenciesContent.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.DependencyMap.Models +{ + /// ExportDependencies request model. + public partial class ExportDependenciesContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Machine arm id. + /// is null. + public ExportDependenciesContent(string focusedMachineId) + { + Argument.AssertNotNull(focusedMachineId, nameof(focusedMachineId)); + + FocusedMachineId = focusedMachineId; + } + + /// Initializes a new instance of . + /// Machine arm id. + /// Filters for ExportDependencies. + /// Keeps track of any properties unknown to the library. + internal ExportDependenciesContent(string focusedMachineId, DependencyMapVisualizationFilter filters, IDictionary serializedAdditionalRawData) + { + FocusedMachineId = focusedMachineId; + Filters = filters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportDependenciesContent() + { + } + + /// Machine arm id. + public string FocusedMachineId { get; } + /// Filters for ExportDependencies. + public DependencyMapVisualizationFilter Filters { get; set; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsForProcessOnFocusedMachineContent.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsForProcessOnFocusedMachineContent.Serialization.cs new file mode 100644 index 000000000000..3f9603e9034d --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsForProcessOnFocusedMachineContent.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; + +namespace Azure.ResourceManager.DependencyMap.Models +{ + public partial class GetConnectionsForProcessOnFocusedMachineContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetConnectionsForProcessOnFocusedMachineContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("focusedMachineId"u8); + writer.WriteStringValue(FocusedMachineId); + writer.WritePropertyName("processIdOnFocusedMachine"u8); + writer.WriteStringValue(ProcessIdOnFocusedMachine); + if (Optional.IsDefined(Filters)) + { + writer.WritePropertyName("filters"u8); + writer.WriteObjectValue(Filters, 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 + } + } + } + + GetConnectionsForProcessOnFocusedMachineContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetConnectionsForProcessOnFocusedMachineContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetConnectionsForProcessOnFocusedMachineContent(document.RootElement, options); + } + + internal static GetConnectionsForProcessOnFocusedMachineContent DeserializeGetConnectionsForProcessOnFocusedMachineContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string focusedMachineId = default; + string processIdOnFocusedMachine = default; + DependencyMapVisualizationFilter filters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("focusedMachineId"u8)) + { + focusedMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("processIdOnFocusedMachine"u8)) + { + processIdOnFocusedMachine = property.Value.GetString(); + continue; + } + if (property.NameEquals("filters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + filters = DependencyMapVisualizationFilter.DeserializeDependencyMapVisualizationFilter(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetConnectionsForProcessOnFocusedMachineContent(focusedMachineId, processIdOnFocusedMachine, filters, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetConnectionsForProcessOnFocusedMachineContent)} does not support writing '{options.Format}' format."); + } + } + + GetConnectionsForProcessOnFocusedMachineContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGetConnectionsForProcessOnFocusedMachineContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetConnectionsForProcessOnFocusedMachineContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsForProcessOnFocusedMachineContent.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsForProcessOnFocusedMachineContent.cs new file mode 100644 index 000000000000..482940e9b8b8 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsForProcessOnFocusedMachineContent.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.DependencyMap.Models +{ + /// GetConnectionsForProcessOnFocusedMachine request model. + public partial class GetConnectionsForProcessOnFocusedMachineContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Machine arm id. + /// Process id. + /// or is null. + public GetConnectionsForProcessOnFocusedMachineContent(string focusedMachineId, string processIdOnFocusedMachine) + { + Argument.AssertNotNull(focusedMachineId, nameof(focusedMachineId)); + Argument.AssertNotNull(processIdOnFocusedMachine, nameof(processIdOnFocusedMachine)); + + FocusedMachineId = focusedMachineId; + ProcessIdOnFocusedMachine = processIdOnFocusedMachine; + } + + /// Initializes a new instance of . + /// Machine arm id. + /// Process id. + /// Filters for GetProcessNetworkConnections. + /// Keeps track of any properties unknown to the library. + internal GetConnectionsForProcessOnFocusedMachineContent(string focusedMachineId, string processIdOnFocusedMachine, DependencyMapVisualizationFilter filters, IDictionary serializedAdditionalRawData) + { + FocusedMachineId = focusedMachineId; + ProcessIdOnFocusedMachine = processIdOnFocusedMachine; + Filters = filters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetConnectionsForProcessOnFocusedMachineContent() + { + } + + /// Machine arm id. + public string FocusedMachineId { get; } + /// Process id. + public string ProcessIdOnFocusedMachine { get; } + /// Filters for GetProcessNetworkConnections. + public DependencyMapVisualizationFilter Filters { get; set; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsWithConnectedMachineForFocusedMachineContent.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsWithConnectedMachineForFocusedMachineContent.Serialization.cs new file mode 100644 index 000000000000..9872491b7b62 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsWithConnectedMachineForFocusedMachineContent.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; + +namespace Azure.ResourceManager.DependencyMap.Models +{ + public partial class GetConnectionsWithConnectedMachineForFocusedMachineContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetConnectionsWithConnectedMachineForFocusedMachineContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("focusedMachineId"u8); + writer.WriteStringValue(FocusedMachineId); + writer.WritePropertyName("connectedMachineId"u8); + writer.WriteStringValue(ConnectedMachineId); + if (Optional.IsDefined(Filters)) + { + writer.WritePropertyName("filters"u8); + writer.WriteObjectValue(Filters, 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 + } + } + } + + GetConnectionsWithConnectedMachineForFocusedMachineContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetConnectionsWithConnectedMachineForFocusedMachineContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetConnectionsWithConnectedMachineForFocusedMachineContent(document.RootElement, options); + } + + internal static GetConnectionsWithConnectedMachineForFocusedMachineContent DeserializeGetConnectionsWithConnectedMachineForFocusedMachineContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string focusedMachineId = default; + string connectedMachineId = default; + DependencyMapVisualizationFilter filters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("focusedMachineId"u8)) + { + focusedMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("connectedMachineId"u8)) + { + connectedMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("filters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + filters = DependencyMapVisualizationFilter.DeserializeDependencyMapVisualizationFilter(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetConnectionsWithConnectedMachineForFocusedMachineContent(focusedMachineId, connectedMachineId, filters, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetConnectionsWithConnectedMachineForFocusedMachineContent)} does not support writing '{options.Format}' format."); + } + } + + GetConnectionsWithConnectedMachineForFocusedMachineContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGetConnectionsWithConnectedMachineForFocusedMachineContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetConnectionsWithConnectedMachineForFocusedMachineContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsWithConnectedMachineForFocusedMachineContent.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsWithConnectedMachineForFocusedMachineContent.cs new file mode 100644 index 000000000000..1902d91c88a0 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetConnectionsWithConnectedMachineForFocusedMachineContent.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.DependencyMap.Models +{ + /// GetConnectionsWithConnectedMachineForFocusedMachine request model. + public partial class GetConnectionsWithConnectedMachineForFocusedMachineContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Source machine arm id. + /// Destination machine arm id. + /// or is null. + public GetConnectionsWithConnectedMachineForFocusedMachineContent(string focusedMachineId, string connectedMachineId) + { + Argument.AssertNotNull(focusedMachineId, nameof(focusedMachineId)); + Argument.AssertNotNull(connectedMachineId, nameof(connectedMachineId)); + + FocusedMachineId = focusedMachineId; + ConnectedMachineId = connectedMachineId; + } + + /// Initializes a new instance of . + /// Source machine arm id. + /// Destination machine arm id. + /// Filters for GetNetworkConnectionsBetweenMachines. + /// Keeps track of any properties unknown to the library. + internal GetConnectionsWithConnectedMachineForFocusedMachineContent(string focusedMachineId, string connectedMachineId, DependencyMapVisualizationFilter filters, IDictionary serializedAdditionalRawData) + { + FocusedMachineId = focusedMachineId; + ConnectedMachineId = connectedMachineId; + Filters = filters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetConnectionsWithConnectedMachineForFocusedMachineContent() + { + } + + /// Source machine arm id. + public string FocusedMachineId { get; } + /// Destination machine arm id. + public string ConnectedMachineId { get; } + /// Filters for GetNetworkConnectionsBetweenMachines. + public DependencyMapVisualizationFilter Filters { get; set; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetDependencyViewForFocusedMachineContent.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetDependencyViewForFocusedMachineContent.Serialization.cs new file mode 100644 index 000000000000..8deb73b3afbd --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetDependencyViewForFocusedMachineContent.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.DependencyMap.Models +{ + public partial class GetDependencyViewForFocusedMachineContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetDependencyViewForFocusedMachineContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("focusedMachineId"u8); + writer.WriteStringValue(FocusedMachineId); + if (Optional.IsDefined(Filters)) + { + writer.WritePropertyName("filters"u8); + writer.WriteObjectValue(Filters, 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 + } + } + } + + GetDependencyViewForFocusedMachineContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetDependencyViewForFocusedMachineContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetDependencyViewForFocusedMachineContent(document.RootElement, options); + } + + internal static GetDependencyViewForFocusedMachineContent DeserializeGetDependencyViewForFocusedMachineContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string focusedMachineId = default; + DependencyMapVisualizationFilter filters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("focusedMachineId"u8)) + { + focusedMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("filters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + filters = DependencyMapVisualizationFilter.DeserializeDependencyMapVisualizationFilter(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetDependencyViewForFocusedMachineContent(focusedMachineId, filters, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetDependencyViewForFocusedMachineContent)} does not support writing '{options.Format}' format."); + } + } + + GetDependencyViewForFocusedMachineContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGetDependencyViewForFocusedMachineContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetDependencyViewForFocusedMachineContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetDependencyViewForFocusedMachineContent.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetDependencyViewForFocusedMachineContent.cs new file mode 100644 index 000000000000..0460469f0b09 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/GetDependencyViewForFocusedMachineContent.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.DependencyMap.Models +{ + /// GetDependencyViewForFocusedMachine request model. + public partial class GetDependencyViewForFocusedMachineContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Machine arm id. + /// is null. + public GetDependencyViewForFocusedMachineContent(string focusedMachineId) + { + Argument.AssertNotNull(focusedMachineId, nameof(focusedMachineId)); + + FocusedMachineId = focusedMachineId; + } + + /// Initializes a new instance of . + /// Machine arm id. + /// Filters for GetSingleMachineDependencyView. + /// Keeps track of any properties unknown to the library. + internal GetDependencyViewForFocusedMachineContent(string focusedMachineId, DependencyMapVisualizationFilter filters, IDictionary serializedAdditionalRawData) + { + FocusedMachineId = focusedMachineId; + Filters = filters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetDependencyViewForFocusedMachineContent() + { + } + + /// Machine arm id. + public string FocusedMachineId { get; } + /// Filters for GetSingleMachineDependencyView. + public DependencyMapVisualizationFilter Filters { get; set; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceListResult.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceListResult.Serialization.cs new file mode 100644 index 000000000000..1e9362c8ab40 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceListResult.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.DependencyMap.Models +{ + internal partial class MapsResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MapsResourceListResult)} 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 + } + } + } + + MapsResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MapsResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMapsResourceListResult(document.RootElement, options); + } + + internal static MapsResourceListResult DeserializeMapsResourceListResult(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(MapsResourceData.DeserializeMapsResourceData(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 MapsResourceListResult(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(MapsResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + MapsResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMapsResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MapsResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceListResult.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceListResult.cs new file mode 100644 index 000000000000..1c7aa41f27b6 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceListResult.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.DependencyMap.Models +{ + /// The response of a MapsResource list operation. + internal partial class MapsResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 MapsResource items on this page. + /// is null. + internal MapsResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The MapsResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal MapsResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MapsResourceListResult() + { + } + + /// The MapsResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourcePatch.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourcePatch.Serialization.cs new file mode 100644 index 000000000000..7ad94da6c9cf --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourcePatch.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.DependencyMap.Models +{ + public partial class MapsResourcePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MapsResourcePatch)} 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 + } + } + } + + MapsResourcePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MapsResourcePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMapsResourcePatch(document.RootElement, options); + } + + internal static MapsResourcePatch DeserializeMapsResourcePatch(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 MapsResourcePatch(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(MapsResourcePatch)} does not support writing '{options.Format}' format."); + } + } + + MapsResourcePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMapsResourcePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MapsResourcePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourcePatch.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourcePatch.cs new file mode 100644 index 000000000000..2355f261e756 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourcePatch.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.DependencyMap.Models +{ + /// The type used for updating tags in MapsResource resources. + public partial class MapsResourcePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 MapsResourcePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Keeps track of any properties unknown to the library. + internal MapsResourcePatch(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceProperties.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceProperties.Serialization.cs new file mode 100644 index 000000000000..d98535d5779a --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceProperties.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.DependencyMap.Models +{ + internal partial class MapsResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MapsResourceProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MapsResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MapsResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMapsResourceProperties(document.RootElement, options); + } + + internal static MapsResourceProperties DeserializeMapsResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? 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 ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MapsResourceProperties(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(MapsResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + MapsResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMapsResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MapsResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceProperties.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceProperties.cs new file mode 100644 index 000000000000..d11433df6b96 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/MapsResourceProperties.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.DependencyMap.Models +{ + /// The properties of Maps resource. + internal partial class MapsResourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 MapsResourceProperties() + { + } + + /// Initializes a new instance of . + /// Provisioning state of Maps resource. + /// Keeps track of any properties unknown to the library. + internal MapsResourceProperties(ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Provisioning state of Maps resource. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/OffAzureDiscoverySourceResourceProperties.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/OffAzureDiscoverySourceResourceProperties.Serialization.cs new file mode 100644 index 000000000000..28b390566aec --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/OffAzureDiscoverySourceResourceProperties.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.DependencyMap.Models +{ + public partial class OffAzureDiscoverySourceResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(OffAzureDiscoverySourceResourceProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + OffAzureDiscoverySourceResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OffAzureDiscoverySourceResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOffAzureDiscoverySourceResourceProperties(document.RootElement, options); + } + + internal static OffAzureDiscoverySourceResourceProperties DeserializeOffAzureDiscoverySourceResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + SourceType sourceType = default; + string sourceId = 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("sourceType"u8)) + { + sourceType = new SourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceId"u8)) + { + sourceId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OffAzureDiscoverySourceResourceProperties(provisioningState, sourceType, sourceId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OffAzureDiscoverySourceResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + OffAzureDiscoverySourceResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOffAzureDiscoverySourceResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OffAzureDiscoverySourceResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/OffAzureDiscoverySourceResourceProperties.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/OffAzureDiscoverySourceResourceProperties.cs new file mode 100644 index 000000000000..61cb3d3925ef --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/OffAzureDiscoverySourceResourceProperties.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DependencyMap.Models +{ + /// OffAzure discovery source resource properties. + public partial class OffAzureDiscoverySourceResourceProperties : DiscoverySourceResourceProperties + { + /// Initializes a new instance of . + /// Source ArmId of Discovery Source resource. + /// is null. + public OffAzureDiscoverySourceResourceProperties(string sourceId) : base(sourceId) + { + Argument.AssertNotNull(sourceId, nameof(sourceId)); + + SourceType = SourceType.OffAzure; + } + + /// Initializes a new instance of . + /// Provisioning state of Discovery Source resource. + /// Source type of Discovery Source resource. + /// Source ArmId of Discovery Source resource. + /// Keeps track of any properties unknown to the library. + internal OffAzureDiscoverySourceResourceProperties(ProvisioningState? provisioningState, SourceType sourceType, string sourceId, IDictionary serializedAdditionalRawData) : base(provisioningState, sourceType, sourceId, serializedAdditionalRawData) + { + SourceType = sourceType; + } + + /// Initializes a new instance of for deserialization. + internal OffAzureDiscoverySourceResourceProperties() + { + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProcessNameFilter.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProcessNameFilter.Serialization.cs new file mode 100644 index 000000000000..3ffaba525f3f --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProcessNameFilter.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.DependencyMap.Models +{ + public partial class ProcessNameFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProcessNameFilter)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("operator"u8); + writer.WriteStringValue(Operator.ToString()); + writer.WritePropertyName("processNames"u8); + writer.WriteStartArray(); + foreach (var item in ProcessNames) + { + 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 + } + } + } + + ProcessNameFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProcessNameFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProcessNameFilter(document.RootElement, options); + } + + internal static ProcessNameFilter DeserializeProcessNameFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProcessNameFilterOperator @operator = default; + IList processNames = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("operator"u8)) + { + @operator = new ProcessNameFilterOperator(property.Value.GetString()); + continue; + } + if (property.NameEquals("processNames"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + processNames = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProcessNameFilter(@operator, processNames, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProcessNameFilter)} does not support writing '{options.Format}' format."); + } + } + + ProcessNameFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProcessNameFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProcessNameFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProcessNameFilter.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProcessNameFilter.cs new file mode 100644 index 000000000000..229da56b7458 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProcessNameFilter.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 System.Linq; + +namespace Azure.ResourceManager.DependencyMap.Models +{ + /// Process name filter for dependency map visualization apis. + public partial class ProcessNameFilter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Operator for process name filter. + /// List of process names on which the operator should be applied. + /// is null. + public ProcessNameFilter(ProcessNameFilterOperator @operator, IEnumerable processNames) + { + Argument.AssertNotNull(processNames, nameof(processNames)); + + Operator = @operator; + ProcessNames = processNames.ToList(); + } + + /// Initializes a new instance of . + /// Operator for process name filter. + /// List of process names on which the operator should be applied. + /// Keeps track of any properties unknown to the library. + internal ProcessNameFilter(ProcessNameFilterOperator @operator, IList processNames, IDictionary serializedAdditionalRawData) + { + Operator = @operator; + ProcessNames = processNames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProcessNameFilter() + { + } + + /// Operator for process name filter. + public ProcessNameFilterOperator Operator { get; } + /// List of process names on which the operator should be applied. + public IList ProcessNames { get; } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProcessNameFilterOperator.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProcessNameFilterOperator.cs new file mode 100644 index 000000000000..908487d6539d --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProcessNameFilterOperator.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.DependencyMap.Models +{ + /// Operator enum for process name filter. + public readonly partial struct ProcessNameFilterOperator : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProcessNameFilterOperator(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ContainsValue = "contains"; + private const string NotContainsValue = "notContains"; + + /// Operator to include items in the result. + public static ProcessNameFilterOperator Contains { get; } = new ProcessNameFilterOperator(ContainsValue); + /// Operator to exclude items in the result. + public static ProcessNameFilterOperator NotContains { get; } = new ProcessNameFilterOperator(NotContainsValue); + /// Determines if two values are the same. + public static bool operator ==(ProcessNameFilterOperator left, ProcessNameFilterOperator right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProcessNameFilterOperator left, ProcessNameFilterOperator right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProcessNameFilterOperator(string value) => new ProcessNameFilterOperator(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProcessNameFilterOperator other && Equals(other); + /// + public bool Equals(ProcessNameFilterOperator 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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProvisioningState.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..8ea619102b6f --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/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.DependencyMap.Models +{ + /// Provisioning state of the resource. + 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 has been created. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Resource creation failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// This state indicates that the resource is being provisioned. + public static ProvisioningState Provisioning { get; } = new ProvisioningState(ProvisioningValue); + /// This state indicates that the resource is being updated. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// This state indicates that the resource is being deleted. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// This state indicates that the operation on the resource has been 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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/SourceType.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/SourceType.cs new file mode 100644 index 000000000000..6e1732d5abca --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/SourceType.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.DependencyMap.Models +{ + /// Source type of the discoverySource. + internal 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 OffAzureValue = "OffAzure"; + + /// OffAzure source type. + public static SourceType OffAzure { get; } = new SourceType(OffAzureValue); + /// 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/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/UnknownDiscoverySourceResourceProperties.Serialization.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/UnknownDiscoverySourceResourceProperties.Serialization.cs new file mode 100644 index 000000000000..3f33e08d2dfa --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/UnknownDiscoverySourceResourceProperties.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.DependencyMap.Models +{ + internal partial class UnknownDiscoverySourceResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DiscoverySourceResourceProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DiscoverySourceResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoverySourceResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoverySourceResourceProperties(document.RootElement, options); + } + + internal static UnknownDiscoverySourceResourceProperties DeserializeUnknownDiscoverySourceResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + SourceType sourceType = "Unknown"; + string sourceId = 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("sourceType"u8)) + { + sourceType = new SourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceId"u8)) + { + sourceId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDiscoverySourceResourceProperties(provisioningState, sourceType, sourceId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DiscoverySourceResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + DiscoverySourceResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiscoverySourceResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoverySourceResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/UnknownDiscoverySourceResourceProperties.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/UnknownDiscoverySourceResourceProperties.cs new file mode 100644 index 000000000000..03ea8ffcf8f2 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/Models/UnknownDiscoverySourceResourceProperties.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.DependencyMap.Models +{ + /// Unknown version of DiscoverySourceResourceProperties. + internal partial class UnknownDiscoverySourceResourceProperties : DiscoverySourceResourceProperties + { + /// Initializes a new instance of . + /// Provisioning state of Discovery Source resource. + /// Source type of Discovery Source resource. + /// Source ArmId of Discovery Source resource. + /// Keeps track of any properties unknown to the library. + internal UnknownDiscoverySourceResourceProperties(ProvisioningState? provisioningState, SourceType sourceType, string sourceId, IDictionary serializedAdditionalRawData) : base(provisioningState, sourceType, sourceId, serializedAdditionalRawData) + { + SourceType = sourceType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDiscoverySourceResourceProperties() + { + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/ProviderConstants.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..24660c191602 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/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.DependencyMap +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/RestOperations/DiscoverySourcesRestOperations.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/RestOperations/DiscoverySourcesRestOperations.cs new file mode 100644 index 000000000000..7280c7e53228 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/RestOperations/DiscoverySourcesRestOperations.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.DependencyMap.Models; + +namespace Azure.ResourceManager.DependencyMap +{ + internal partial class DiscoverySourcesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DiscoverySourcesRestOperations. + /// 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 DiscoverySourcesRestOperations(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-31-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string mapName, string sourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/discoverySources/", false); + uri.AppendPath(sourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string mapName, string sourceName) + { + 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/discoverySources/", false); + uri.AppendPath(sourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a DiscoverySourceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource name. + /// discovery source 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 mapName, string sourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, mapName, sourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiscoverySourceResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DiscoverySourceResourceData.DeserializeDiscoverySourceResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DiscoverySourceResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a DiscoverySourceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource name. + /// discovery source 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 mapName, string sourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, mapName, sourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiscoverySourceResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DiscoverySourceResourceData.DeserializeDiscoverySourceResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DiscoverySourceResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string mapName, string sourceName, DiscoverySourceResourceData 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/discoverySources/", false); + uri.AppendPath(sourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string mapName, string sourceName, DiscoverySourceResourceData 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/discoverySources/", false); + uri.AppendPath(sourceName, 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 DiscoverySourceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource name. + /// discovery source resource. + /// 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 mapName, string sourceName, DiscoverySourceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, mapName, sourceName, 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 DiscoverySourceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource name. + /// discovery source resource. + /// 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 mapName, string sourceName, DiscoverySourceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, mapName, sourceName, 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 mapName, string sourceName, DiscoverySourceResourcePatch 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/discoverySources/", false); + uri.AppendPath(sourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string mapName, string sourceName, DiscoverySourceResourcePatch 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/discoverySources/", false); + uri.AppendPath(sourceName, 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 DiscoverySourceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource name. + /// discovery source resource. + /// 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 mapName, string sourceName, DiscoverySourceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, mapName, sourceName, 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 DiscoverySourceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource name. + /// discovery source resource. + /// 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 mapName, string sourceName, DiscoverySourceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, mapName, sourceName, 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 mapName, string sourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/discoverySources/", false); + uri.AppendPath(sourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string mapName, string sourceName) + { + 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/discoverySources/", false); + uri.AppendPath(sourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a DiscoverySourceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource name. + /// discovery source 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 mapName, string sourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, mapName, sourceName); + 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 DiscoverySourceResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource name. + /// discovery source 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 mapName, string sourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNullOrEmpty(sourceName, nameof(sourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, mapName, sourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByMapsResourceRequestUri(string subscriptionId, string resourceGroupName, string mapName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/discoverySources", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByMapsResourceRequest(string subscriptionId, string resourceGroupName, string mapName) + { + 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/discoverySources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DiscoverySourceResource resources by MapsResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps 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> ListByMapsResourceAsync(string subscriptionId, string resourceGroupName, string mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + + using var message = CreateListByMapsResourceRequest(subscriptionId, resourceGroupName, mapName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiscoverySourceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DiscoverySourceResourceListResult.DeserializeDiscoverySourceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DiscoverySourceResource resources by MapsResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByMapsResource(string subscriptionId, string resourceGroupName, string mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + + using var message = CreateListByMapsResourceRequest(subscriptionId, resourceGroupName, mapName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiscoverySourceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DiscoverySourceResourceListResult.DeserializeDiscoverySourceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByMapsResourceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string mapName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByMapsResourceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string mapName) + { + 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 DiscoverySourceResource resources by MapsResource. + /// 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. + /// Maps 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> ListByMapsResourceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + + using var message = CreateListByMapsResourceNextPageRequest(nextLink, subscriptionId, resourceGroupName, mapName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiscoverySourceResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DiscoverySourceResourceListResult.DeserializeDiscoverySourceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DiscoverySourceResource resources by MapsResource. + /// 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. + /// Maps resource name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByMapsResourceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + + using var message = CreateListByMapsResourceNextPageRequest(nextLink, subscriptionId, resourceGroupName, mapName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiscoverySourceResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DiscoverySourceResourceListResult.DeserializeDiscoverySourceResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/RestOperations/MapsRestOperations.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/RestOperations/MapsRestOperations.cs new file mode 100644 index 000000000000..9a0363efa963 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Generated/RestOperations/MapsRestOperations.cs @@ -0,0 +1,1091 @@ +// 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.DependencyMap.Models; + +namespace Azure.ResourceManager.DependencyMap +{ + internal partial class MapsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of MapsRestOperations. + /// 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 MapsRestOperations(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-31-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string mapName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string mapName) + { + 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a MapsResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps 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> GetAsync(string subscriptionId, string resourceGroupName, string mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, mapName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MapsResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MapsResourceData.DeserializeMapsResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MapsResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a MapsResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource 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 mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, mapName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MapsResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MapsResourceData.DeserializeMapsResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MapsResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string mapName, MapsResourceData 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string mapName, MapsResourceData 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, 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 MapsResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource 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 mapName, MapsResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, mapName, 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 MapsResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource 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 mapName, MapsResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, mapName, 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 mapName, MapsResourcePatch 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string mapName, MapsResourcePatch 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, 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 MapsResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource 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 mapName, MapsResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, mapName, 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 MapsResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource 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 mapName, MapsResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, mapName, 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 mapName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string mapName) + { + 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a MapsResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps 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 mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, mapName); + 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 MapsResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps 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 mapName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, mapName); + _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.DependencyMap/maps", 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.DependencyMap/maps", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List MapsResource 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: + { + MapsResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MapsResourceListResult.DeserializeMapsResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List MapsResource 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: + { + MapsResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MapsResourceListResult.DeserializeMapsResourceListResult(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.DependencyMap/maps", 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.DependencyMap/maps", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List MapsResource 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: + { + MapsResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MapsResourceListResult.DeserializeMapsResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List MapsResource 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: + { + MapsResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MapsResourceListResult.DeserializeMapsResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetDependencyViewForFocusedMachineRequestUri(string subscriptionId, string resourceGroupName, string mapName, GetDependencyViewForFocusedMachineContent 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/getDependencyViewForFocusedMachine", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetDependencyViewForFocusedMachineRequest(string subscriptionId, string resourceGroupName, string mapName, GetDependencyViewForFocusedMachineContent 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/getDependencyViewForFocusedMachine", 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 dependency map of single machine. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource 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 GetDependencyViewForFocusedMachineAsync(string subscriptionId, string resourceGroupName, string mapName, GetDependencyViewForFocusedMachineContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetDependencyViewForFocusedMachineRequest(subscriptionId, resourceGroupName, mapName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get dependency map of single machine. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource 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 GetDependencyViewForFocusedMachine(string subscriptionId, string resourceGroupName, string mapName, GetDependencyViewForFocusedMachineContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetDependencyViewForFocusedMachineRequest(subscriptionId, resourceGroupName, mapName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetConnectionsWithConnectedMachineForFocusedMachineRequestUri(string subscriptionId, string resourceGroupName, string mapName, GetConnectionsWithConnectedMachineForFocusedMachineContent 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/getConnectionsWithConnectedMachineForFocusedMachine", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetConnectionsWithConnectedMachineForFocusedMachineRequest(string subscriptionId, string resourceGroupName, string mapName, GetConnectionsWithConnectedMachineForFocusedMachineContent 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/getConnectionsWithConnectedMachineForFocusedMachine", 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 network connections between machines. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource 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 GetConnectionsWithConnectedMachineForFocusedMachineAsync(string subscriptionId, string resourceGroupName, string mapName, GetConnectionsWithConnectedMachineForFocusedMachineContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetConnectionsWithConnectedMachineForFocusedMachineRequest(subscriptionId, resourceGroupName, mapName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get network connections between machines. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource 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 GetConnectionsWithConnectedMachineForFocusedMachine(string subscriptionId, string resourceGroupName, string mapName, GetConnectionsWithConnectedMachineForFocusedMachineContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetConnectionsWithConnectedMachineForFocusedMachineRequest(subscriptionId, resourceGroupName, mapName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetConnectionsForProcessOnFocusedMachineRequestUri(string subscriptionId, string resourceGroupName, string mapName, GetConnectionsForProcessOnFocusedMachineContent 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/getConnectionsForProcessOnFocusedMachine", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetConnectionsForProcessOnFocusedMachineRequest(string subscriptionId, string resourceGroupName, string mapName, GetConnectionsForProcessOnFocusedMachineContent 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/getConnectionsForProcessOnFocusedMachine", 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 network connections of a process. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource 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 GetConnectionsForProcessOnFocusedMachineAsync(string subscriptionId, string resourceGroupName, string mapName, GetConnectionsForProcessOnFocusedMachineContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetConnectionsForProcessOnFocusedMachineRequest(subscriptionId, resourceGroupName, mapName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get network connections of a process. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource 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 GetConnectionsForProcessOnFocusedMachine(string subscriptionId, string resourceGroupName, string mapName, GetConnectionsForProcessOnFocusedMachineContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetConnectionsForProcessOnFocusedMachineRequest(subscriptionId, resourceGroupName, mapName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateExportDependenciesRequestUri(string subscriptionId, string resourceGroupName, string mapName, ExportDependenciesContent 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/exportDependencies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateExportDependenciesRequest(string subscriptionId, string resourceGroupName, string mapName, ExportDependenciesContent 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.DependencyMap/maps/", false); + uri.AppendPath(mapName, true); + uri.AppendPath("/exportDependencies", 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; + } + + /// Export dependencies. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource 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 ExportDependenciesAsync(string subscriptionId, string resourceGroupName, string mapName, ExportDependenciesContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateExportDependenciesRequest(subscriptionId, resourceGroupName, mapName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Export dependencies. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maps resource 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 ExportDependencies(string subscriptionId, string resourceGroupName, string mapName, ExportDependenciesContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mapName, nameof(mapName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateExportDependenciesRequest(subscriptionId, resourceGroupName, mapName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return 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 MapsResource 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: + { + MapsResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MapsResourceListResult.DeserializeMapsResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List MapsResource 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: + { + MapsResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MapsResourceListResult.DeserializeMapsResourceListResult(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 MapsResource 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: + { + MapsResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MapsResourceListResult.DeserializeMapsResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List MapsResource 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: + { + MapsResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MapsResourceListResult.DeserializeMapsResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Properties/AssemblyInfo.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..76da9bae4e8d --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/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.DependencyMap.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("DependencyMap")] diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/tests/Azure.ResourceManager.DependencyMap.Tests.csproj b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/tests/Azure.ResourceManager.DependencyMap.Tests.csproj new file mode 100644 index 000000000000..11a53c99de60 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/tests/Azure.ResourceManager.DependencyMap.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/tests/DependencyMapManagementTestBase.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/tests/DependencyMapManagementTestBase.cs new file mode 100644 index 000000000000..6d7ae4763bd4 --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/tests/DependencyMapManagementTestBase.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.DependencyMap.Tests +{ + public class DependencyMapManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected DependencyMapManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected DependencyMapManagementTestBase(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/dependencymap/Azure.ResourceManager.DependencyMap/tests/DependencyMapManagementTestEnvironment.cs b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/tests/DependencyMapManagementTestEnvironment.cs new file mode 100644 index 000000000000..6121eda4251a --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/tests/DependencyMapManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.DependencyMap.Tests +{ + public class DependencyMapManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/dependencymap/Azure.ResourceManager.DependencyMap/tsp-location.yaml b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/tsp-location.yaml new file mode 100644 index 000000000000..921c2074253b --- /dev/null +++ b/sdk/dependencymap/Azure.ResourceManager.DependencyMap/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/azuredependencymap/DependencyMap.Management +commit: 47fb75e55cbbcaf8d65602ad991885e7dfd49a1e +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/dependencymap/ci.mgmt.yml b/sdk/dependencymap/ci.mgmt.yml new file mode 100644 index 000000000000..8a338eb1f795 --- /dev/null +++ b/sdk/dependencymap/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/dependencymap /ci.mgmt.yml + - sdk/dependencymap /Azure.ResourceManager.DependencyMap / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: dependencymap + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.DependencyMap + safeName: AzureResourceManagerDependencyMap 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/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/samples/Generated/Samples/Sample_LambdaTestHyperExecuteOrganizationCollection.cs b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/samples/Generated/Samples/Sample_LambdaTestHyperExecuteOrganizationCollection.cs index 3c49557edc93..a7b137a1d756 100644 --- a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/samples/Generated/Samples/Sample_LambdaTestHyperExecuteOrganizationCollection.cs +++ b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/samples/Generated/Samples/Sample_LambdaTestHyperExecuteOrganizationCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_LambdaTestHyperExecuteOrganizationCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_OrganizationsCreateOrUpdateMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - // Generated from example definition: 2024-02-01-preview/Organizations_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2024-02-01/Organizations_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "OrganizationResource_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 @@ -89,7 +89,7 @@ public async Task CreateOrUpdate_OrganizationsCreateOrUpdateMaximumSetGenGenerat [Ignore("Only validating compilation of examples")] public async Task Get_OrganizationsGetMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - // Generated from example definition: 2024-02-01-preview/Organizations_Get_MaximumSet_Gen.json + // Generated from example definition: 2024-02-01/Organizations_Get_MaximumSet_Gen.json // this example is just showing the usage of "OrganizationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 Get_OrganizationsGetMaximumSetGenGeneratedByMaximumSetRuleGene [Ignore("Only validating compilation of examples")] public async Task GetAll_OrganizationsListByResourceGroupMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - // Generated from example definition: 2024-02-01-preview/Organizations_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: 2024-02-01/Organizations_ListByResourceGroup_MaximumSet_Gen.json // this example is just showing the usage of "OrganizationResource_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 @@ -157,7 +157,7 @@ public async Task GetAll_OrganizationsListByResourceGroupMaximumSetGenGeneratedB [Ignore("Only validating compilation of examples")] public async Task GetAll_OrganizationsListByResourceGroupMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - // Generated from example definition: 2024-02-01-preview/Organizations_ListByResourceGroup_MinimumSet_Gen.json + // Generated from example definition: 2024-02-01/Organizations_ListByResourceGroup_MinimumSet_Gen.json // this example is just showing the usage of "OrganizationResource_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 @@ -192,7 +192,7 @@ public async Task GetAll_OrganizationsListByResourceGroupMaximumSetGenGeneratedB [Ignore("Only validating compilation of examples")] public async Task Exists_OrganizationsGetMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - // Generated from example definition: 2024-02-01-preview/Organizations_Get_MaximumSet_Gen.json + // Generated from example definition: 2024-02-01/Organizations_Get_MaximumSet_Gen.json // this example is just showing the usage of "OrganizationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 Exists_OrganizationsGetMaximumSetGenGeneratedByMaximumSetRuleG [Ignore("Only validating compilation of examples")] public async Task GetIfExists_OrganizationsGetMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - // Generated from example definition: 2024-02-01-preview/Organizations_Get_MaximumSet_Gen.json + // Generated from example definition: 2024-02-01/Organizations_Get_MaximumSet_Gen.json // this example is just showing the usage of "OrganizationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/samples/Generated/Samples/Sample_LambdaTestHyperExecuteOrganizationResource.cs b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/samples/Generated/Samples/Sample_LambdaTestHyperExecuteOrganizationResource.cs index b6d9240f2d28..2905eef73552 100644 --- a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/samples/Generated/Samples/Sample_LambdaTestHyperExecuteOrganizationResource.cs +++ b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/samples/Generated/Samples/Sample_LambdaTestHyperExecuteOrganizationResource.cs @@ -21,7 +21,7 @@ public partial class Sample_LambdaTestHyperExecuteOrganizationResource [Ignore("Only validating compilation of examples")] public async Task Get_OrganizationsGetMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - // Generated from example definition: 2024-02-01-preview/Organizations_Get_MaximumSet_Gen.json + // Generated from example definition: 2024-02-01/Organizations_Get_MaximumSet_Gen.json // this example is just showing the usage of "OrganizationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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_OrganizationsGetMaximumSetGenGeneratedByMaximumSetRuleGene [Ignore("Only validating compilation of examples")] public async Task Delete_OrganizationsDeleteMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - // Generated from example definition: 2024-02-01-preview/Organizations_Delete_MaximumSet_Gen.json + // Generated from example definition: 2024-02-01/Organizations_Delete_MaximumSet_Gen.json // this example is just showing the usage of "OrganizationResource_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_OrganizationsDeleteMaximumSetGenGeneratedByMaximumSetRu [Ignore("Only validating compilation of examples")] public async Task Update_OrganizationsUpdateMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - // Generated from example definition: 2024-02-01-preview/Organizations_Update_MaximumSet_Gen.json + // Generated from example definition: 2024-02-01/Organizations_Update_MaximumSet_Gen.json // this example is just showing the usage of "OrganizationResource_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/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 0ba05fb51e02..4a31fe37f9d2 100644 --- a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -20,7 +20,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetLambdaTestHyperExecuteOrganizations_OrganizationsListBySubscriptionMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - // Generated from example definition: 2024-02-01-preview/Organizations_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: 2024-02-01/Organizations_ListBySubscription_MaximumSet_Gen.json // this example is just showing the usage of "OrganizationResource_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task GetLambdaTestHyperExecuteOrganizations_OrganizationsListBySubs [Ignore("Only validating compilation of examples")] public async Task GetLambdaTestHyperExecuteOrganizations_OrganizationsListBySubscriptionMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - // Generated from example definition: 2024-02-01-preview/Organizations_ListBySubscription_MinimumSet_Gen.json + // Generated from example definition: 2024-02-01/Organizations_ListBySubscription_MinimumSet_Gen.json // this example is just showing the usage of "OrganizationResource_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/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/Extensions/LambdaTestHyperExecuteExtensions.cs b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/Extensions/LambdaTestHyperExecuteExtensions.cs index d91ff011e710..4342c61dd392 100644 --- a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/Extensions/LambdaTestHyperExecuteExtensions.cs +++ b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/Extensions/LambdaTestHyperExecuteExtensions.cs @@ -81,7 +81,7 @@ public static LambdaTestHyperExecuteOrganizationCollection GetLambdaTestHyperExe /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -119,7 +119,7 @@ public static async Task> G /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -157,7 +157,7 @@ public static Response GetLambdaTest /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -193,7 +193,7 @@ public static AsyncPageable GetLambd /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource diff --git a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/Extensions/MockableLambdaTestHyperExecuteResourceGroupResource.cs b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/Extensions/MockableLambdaTestHyperExecuteResourceGroupResource.cs index 67d80b414704..f3202658ba71 100644 --- a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/Extensions/MockableLambdaTestHyperExecuteResourceGroupResource.cs +++ b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/Extensions/MockableLambdaTestHyperExecuteResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual LambdaTestHyperExecuteOrganizationCollection GetLambdaTestHyperEx /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource diff --git a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/Extensions/MockableLambdaTestHyperExecuteSubscriptionResource.cs b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/Extensions/MockableLambdaTestHyperExecuteSubscriptionResource.cs index 7e088cf0afab..cb754766aaf0 100644 --- a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/Extensions/MockableLambdaTestHyperExecuteSubscriptionResource.cs +++ b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/Extensions/MockableLambdaTestHyperExecuteSubscriptionResource.cs @@ -52,7 +52,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -82,7 +82,7 @@ public virtual AsyncPageable GetLamb /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource diff --git a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/LambdaTestHyperExecuteOrganizationCollection.cs b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/LambdaTestHyperExecuteOrganizationCollection.cs index a3cc0f258f87..2c11d656949c 100644 --- a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/LambdaTestHyperExecuteOrganizationCollection.cs +++ b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/LambdaTestHyperExecuteOrganizationCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string o /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(Cance /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string organizationname, C /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string organizationname, CancellationToken /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource diff --git a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/LambdaTestHyperExecuteOrganizationResource.cs b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/LambdaTestHyperExecuteOrganizationResource.cs index 33752728e768..63cec75787bb 100644 --- a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/LambdaTestHyperExecuteOrganizationResource.cs +++ b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/LambdaTestHyperExecuteOrganizationResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -309,7 +309,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -351,7 +351,7 @@ public virtual Response Update(Lambd /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -413,7 +413,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -475,7 +475,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -532,7 +532,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -589,7 +589,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource @@ -649,7 +649,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-02-01-preview + /// 2024-02-01 /// /// /// Resource diff --git a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/RestOperations/OrganizationsRestOperations.cs b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/RestOperations/OrganizationsRestOperations.cs index 4cd7017d9207..6630bb722a32 100644 --- a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/src/Generated/RestOperations/OrganizationsRestOperations.cs +++ b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/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-02-01-preview"; + _apiVersion = apiVersion ?? "2024-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/tsp-location.yaml b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/tsp-location.yaml index 353db515eb44..aff801158fc5 100644 --- a/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/tsp-location.yaml +++ b/sdk/lambdatesthyperexecute/Azure.ResourceManager.LambdaTestHyperExecute/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/liftrhyperexecute/LambdaTest.HyperExecute.Management -commit: ad9b489baef1d982f7641f6c47a00794c9a1a5be -repo: Azure/azure-rest-api-specs \ No newline at end of file +commit: 47fb75e55cbbcaf8d65602ad991885e7dfd49a1e +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/Azure.ResourceManager.OnlineExperimentation.sln b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/Azure.ResourceManager.OnlineExperimentation.sln new file mode 100644 index 000000000000..779249ad70eb --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/Azure.ResourceManager.OnlineExperimentation.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.OnlineExperimentation.Samples", "samples\Azure.ResourceManager.OnlineExperimentation.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.OnlineExperimentation", "src\Azure.ResourceManager.OnlineExperimentation.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.OnlineExperimentation.Tests", "tests\Azure.ResourceManager.OnlineExperimentation.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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/CHANGELOG.md b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/Directory.Build.props b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/README.md b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/README.md new file mode 100644 index 000000000000..13d45116b02c --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure OnlineExperimentation 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 OnlineExperimentation management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.OnlineExperimentation --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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/api/Azure.ResourceManager.OnlineExperimentation.net8.0.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/api/Azure.ResourceManager.OnlineExperimentation.net8.0.cs new file mode 100644 index 000000000000..0c2d832a7405 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/api/Azure.ResourceManager.OnlineExperimentation.net8.0.cs @@ -0,0 +1,228 @@ +namespace Azure.ResourceManager.OnlineExperimentation +{ + public static partial class OnlineExperimentationExtensions + { + public static Azure.Response GetOnlineExperimentWorkspace(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetOnlineExperimentWorkspaceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceResource GetOnlineExperimentWorkspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceCollection GetOnlineExperimentWorkspaces(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetOnlineExperimentWorkspaces(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetOnlineExperimentWorkspacesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class OnlineExperimentWorkspaceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected OnlineExperimentWorkspaceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string workspaceName, Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string workspaceName, Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string workspaceName, 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 workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string workspaceName, 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 OnlineExperimentWorkspaceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OnlineExperimentWorkspaceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentWorkspaceProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSku Sku { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OnlineExperimentWorkspaceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected OnlineExperimentWorkspaceResource() { } + public virtual Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData 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 workspaceName) { 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 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.OnlineExperimentation.OnlineExperimentWorkspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.OnlineExperimentation.OnlineExperimentWorkspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.OnlineExperimentation.Mocking +{ + public partial class MockableOnlineExperimentationArmClient : Azure.ResourceManager.ArmResource + { + protected MockableOnlineExperimentationArmClient() { } + public virtual Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceResource GetOnlineExperimentWorkspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableOnlineExperimentationResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableOnlineExperimentationResourceGroupResource() { } + public virtual Azure.Response GetOnlineExperimentWorkspace(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetOnlineExperimentWorkspaceAsync(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceCollection GetOnlineExperimentWorkspaces() { throw null; } + } + public partial class MockableOnlineExperimentationSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableOnlineExperimentationSubscriptionResource() { } + public virtual Azure.Pageable GetOnlineExperimentWorkspaces(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetOnlineExperimentWorkspacesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.OnlineExperimentation.Models +{ + public static partial class ArmOnlineExperimentationModelFactory + { + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSku OnlineExperimentationWorkspaceSku(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName name = default(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName), Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier? tier = default(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier?)) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData OnlineExperimentWorkspaceData(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.OnlineExperimentation.Models.OnlineExperimentWorkspaceProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSku sku = null) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentWorkspaceProperties OnlineExperimentWorkspaceProperties(string workspaceId = null, Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState?), Azure.Core.ResourceIdentifier logAnalyticsWorkspaceResourceId = null, Azure.Core.ResourceIdentifier logsExporterStorageAccountResourceId = null, Azure.Core.ResourceIdentifier appConfigurationResourceId = null, Azure.ResourceManager.OnlineExperimentation.Models.CustomerManagedKeyEncryption customerManagedKeyEncryption = null, System.Uri endpoint = null) { throw null; } + } + public partial class CustomerManagedKeyEncryption : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CustomerManagedKeyEncryption() { } + public Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentity KeyEncryptionKeyIdentity { get { throw null; } set { } } + public System.Uri KeyEncryptionKeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.CustomerManagedKeyEncryption System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.CustomerManagedKeyEncryption System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class KeyEncryptionKeyIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public KeyEncryptionKeyIdentity() { } + public System.Guid? FederatedClientId { get { throw null; } set { } } + public Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType? IdentityType { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier UserAssignedIdentityResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 KeyEncryptionKeyIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public KeyEncryptionKeyIdentityType(string value) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType SystemAssignedIdentity { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType UserAssignedIdentity { get { throw null; } } + public bool Equals(Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType 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.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType left, Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType left, Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OnlineExperimentationWorkspaceSku : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OnlineExperimentationWorkspaceSku(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName name) { } + public Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName Name { get { throw null; } set { } } + public Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier? Tier { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSku System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 OnlineExperimentationWorkspaceSkuName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OnlineExperimentationWorkspaceSkuName(string value) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName D0 { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName F0 { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName P0 { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName S0 { get { throw null; } } + public bool Equals(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName 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.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName left, Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName right) { throw null; } + public static implicit operator Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName left, Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct OnlineExperimentationWorkspaceSkuTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OnlineExperimentationWorkspaceSkuTier(string value) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier Developer { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier Free { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier Premium { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier Standard { get { throw null; } } + public bool Equals(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier 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.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier left, Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier right) { throw null; } + public static implicit operator Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier left, Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OnlineExperimentWorkspaceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OnlineExperimentWorkspaceProperties(Azure.Core.ResourceIdentifier logAnalyticsWorkspaceResourceId, Azure.Core.ResourceIdentifier logsExporterStorageAccountResourceId, Azure.Core.ResourceIdentifier appConfigurationResourceId) { } + public Azure.Core.ResourceIdentifier AppConfigurationResourceId { get { throw null; } set { } } + public Azure.ResourceManager.OnlineExperimentation.Models.CustomerManagedKeyEncryption CustomerManagedKeyEncryption { get { throw null; } set { } } + public System.Uri Endpoint { get { throw null; } } + public Azure.Core.ResourceIdentifier LogAnalyticsWorkspaceResourceId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier LogsExporterStorageAccountResourceId { get { throw null; } set { } } + public Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState? ProvisioningState { get { throw null; } } + public string WorkspaceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentWorkspaceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentWorkspaceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ResourceProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState 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.OnlineExperimentation.Models.ResourceProvisioningState left, Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState left, Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/api/Azure.ResourceManager.OnlineExperimentation.netstandard2.0.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/api/Azure.ResourceManager.OnlineExperimentation.netstandard2.0.cs new file mode 100644 index 000000000000..0c2d832a7405 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/api/Azure.ResourceManager.OnlineExperimentation.netstandard2.0.cs @@ -0,0 +1,228 @@ +namespace Azure.ResourceManager.OnlineExperimentation +{ + public static partial class OnlineExperimentationExtensions + { + public static Azure.Response GetOnlineExperimentWorkspace(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetOnlineExperimentWorkspaceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceResource GetOnlineExperimentWorkspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceCollection GetOnlineExperimentWorkspaces(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetOnlineExperimentWorkspaces(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetOnlineExperimentWorkspacesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class OnlineExperimentWorkspaceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected OnlineExperimentWorkspaceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string workspaceName, Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string workspaceName, Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string workspaceName, 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 workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string workspaceName, 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 OnlineExperimentWorkspaceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OnlineExperimentWorkspaceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentWorkspaceProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSku Sku { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OnlineExperimentWorkspaceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected OnlineExperimentWorkspaceResource() { } + public virtual Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData 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 workspaceName) { 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 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.OnlineExperimentation.OnlineExperimentWorkspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.OnlineExperimentation.OnlineExperimentWorkspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.OnlineExperimentation.Mocking +{ + public partial class MockableOnlineExperimentationArmClient : Azure.ResourceManager.ArmResource + { + protected MockableOnlineExperimentationArmClient() { } + public virtual Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceResource GetOnlineExperimentWorkspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableOnlineExperimentationResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableOnlineExperimentationResourceGroupResource() { } + public virtual Azure.Response GetOnlineExperimentWorkspace(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetOnlineExperimentWorkspaceAsync(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceCollection GetOnlineExperimentWorkspaces() { throw null; } + } + public partial class MockableOnlineExperimentationSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableOnlineExperimentationSubscriptionResource() { } + public virtual Azure.Pageable GetOnlineExperimentWorkspaces(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetOnlineExperimentWorkspacesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.OnlineExperimentation.Models +{ + public static partial class ArmOnlineExperimentationModelFactory + { + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSku OnlineExperimentationWorkspaceSku(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName name = default(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName), Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier? tier = default(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier?)) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.OnlineExperimentWorkspaceData OnlineExperimentWorkspaceData(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.OnlineExperimentation.Models.OnlineExperimentWorkspaceProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSku sku = null) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentWorkspaceProperties OnlineExperimentWorkspaceProperties(string workspaceId = null, Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState?), Azure.Core.ResourceIdentifier logAnalyticsWorkspaceResourceId = null, Azure.Core.ResourceIdentifier logsExporterStorageAccountResourceId = null, Azure.Core.ResourceIdentifier appConfigurationResourceId = null, Azure.ResourceManager.OnlineExperimentation.Models.CustomerManagedKeyEncryption customerManagedKeyEncryption = null, System.Uri endpoint = null) { throw null; } + } + public partial class CustomerManagedKeyEncryption : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CustomerManagedKeyEncryption() { } + public Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentity KeyEncryptionKeyIdentity { get { throw null; } set { } } + public System.Uri KeyEncryptionKeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.CustomerManagedKeyEncryption System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.CustomerManagedKeyEncryption System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class KeyEncryptionKeyIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public KeyEncryptionKeyIdentity() { } + public System.Guid? FederatedClientId { get { throw null; } set { } } + public Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType? IdentityType { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier UserAssignedIdentityResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 KeyEncryptionKeyIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public KeyEncryptionKeyIdentityType(string value) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType SystemAssignedIdentity { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType UserAssignedIdentity { get { throw null; } } + public bool Equals(Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType 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.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType left, Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType left, Azure.ResourceManager.OnlineExperimentation.Models.KeyEncryptionKeyIdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OnlineExperimentationWorkspaceSku : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OnlineExperimentationWorkspaceSku(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName name) { } + public Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName Name { get { throw null; } set { } } + public Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier? Tier { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSku System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 OnlineExperimentationWorkspaceSkuName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OnlineExperimentationWorkspaceSkuName(string value) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName D0 { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName F0 { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName P0 { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName S0 { get { throw null; } } + public bool Equals(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName 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.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName left, Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName right) { throw null; } + public static implicit operator Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName left, Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuName right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct OnlineExperimentationWorkspaceSkuTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OnlineExperimentationWorkspaceSkuTier(string value) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier Developer { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier Free { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier Premium { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier Standard { get { throw null; } } + public bool Equals(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier 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.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier left, Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier right) { throw null; } + public static implicit operator Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier left, Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentationWorkspaceSkuTier right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OnlineExperimentWorkspaceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OnlineExperimentWorkspaceProperties(Azure.Core.ResourceIdentifier logAnalyticsWorkspaceResourceId, Azure.Core.ResourceIdentifier logsExporterStorageAccountResourceId, Azure.Core.ResourceIdentifier appConfigurationResourceId) { } + public Azure.Core.ResourceIdentifier AppConfigurationResourceId { get { throw null; } set { } } + public Azure.ResourceManager.OnlineExperimentation.Models.CustomerManagedKeyEncryption CustomerManagedKeyEncryption { get { throw null; } set { } } + public System.Uri Endpoint { get { throw null; } } + public Azure.Core.ResourceIdentifier LogAnalyticsWorkspaceResourceId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier LogsExporterStorageAccountResourceId { get { throw null; } set { } } + public Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState? ProvisioningState { get { throw null; } } + public string WorkspaceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentWorkspaceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.OnlineExperimentation.Models.OnlineExperimentWorkspaceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ResourceProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState 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.OnlineExperimentation.Models.ResourceProvisioningState left, Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState left, Azure.ResourceManager.OnlineExperimentation.Models.ResourceProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/assets.json b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/assets.json new file mode 100644 index 000000000000..9e49956a0064 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation", + "Tag": "" +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Azure.ResourceManager.OnlineExperimentation.Samples.csproj b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Azure.ResourceManager.OnlineExperimentation.Samples.csproj new file mode 100644 index 000000000000..bd64b7950a3b --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Azure.ResourceManager.OnlineExperimentation.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Generated/Samples/Sample_OnlineExperimentWorkspaceCollection.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Generated/Samples/Sample_OnlineExperimentWorkspaceCollection.cs new file mode 100644 index 000000000000..5861b06e1435 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Generated/Samples/Sample_OnlineExperimentWorkspaceCollection.cs @@ -0,0 +1,272 @@ +// 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.Models; +using Azure.ResourceManager.OnlineExperimentation.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.OnlineExperimentation.Samples +{ + public partial class Sample_OnlineExperimentWorkspaceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateAnOnlineExperimentWorkspaceWithFreeSku() + { + // Generated from example definition: 2025-05-31-preview/OnlineExperimentWorkspaces_CreateOrUpdate.json + // this example is just showing the usage of "OnlineExperimentWorkspace_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 = "fa5fc227-a624-475e-b696-cdd604c735bc"; + string resourceGroupName = "res9871"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this OnlineExperimentWorkspaceResource + OnlineExperimentWorkspaceCollection collection = resourceGroupResource.GetOnlineExperimentWorkspaces(); + + // invoke the operation + string workspaceName = "expworkspace7"; + OnlineExperimentWorkspaceData data = new OnlineExperimentWorkspaceData(new AzureLocation("eastus2")) + { + Properties = new OnlineExperimentWorkspaceProperties(new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/res9871/providers/Microsoft.OperationalInsights/workspaces/log9871"), new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto9871"), new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/res9871/providers/Microsoft.AppConfiguration/configurationStores/appconfig9871")), + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity(), +[new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2")] = new UserAssignedIdentity() +}, + }, + Sku = new OnlineExperimentationWorkspaceSku(OnlineExperimentationWorkspaceSkuName.F0), + Tags = +{ +["newKey"] = "newVal" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, workspaceName, data); + OnlineExperimentWorkspaceResource 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 + OnlineExperimentWorkspaceData 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_CreateOrUpdateAnOnlineExperimentWorkspaceWithFreeSkuAndCustomerManagedKey() + { + // Generated from example definition: 2025-05-31-preview/OnlineExperimentWorkspaces_CreateOrUpdateWithEncryption.json + // this example is just showing the usage of "OnlineExperimentWorkspace_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 = "fa5fc227-a624-475e-b696-cdd604c735bc"; + string resourceGroupName = "res9871"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this OnlineExperimentWorkspaceResource + OnlineExperimentWorkspaceCollection collection = resourceGroupResource.GetOnlineExperimentWorkspaces(); + + // invoke the operation + string workspaceName = "expworkspace7"; + OnlineExperimentWorkspaceData data = new OnlineExperimentWorkspaceData(new AzureLocation("eastus2")) + { + Properties = new OnlineExperimentWorkspaceProperties(new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/res9871/providers/Microsoft.OperationalInsights/workspaces/log9871"), new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto9871"), new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/res9871/providers/Microsoft.AppConfiguration/configurationStores/appconfig9871")) + { + CustomerManagedKeyEncryption = new CustomerManagedKeyEncryption + { + KeyEncryptionKeyIdentity = new KeyEncryptionKeyIdentity + { + IdentityType = KeyEncryptionKeyIdentityType.UserAssignedIdentity, + UserAssignedIdentityResourceId = new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"), + }, + KeyEncryptionKeyUri = new Uri("https://contosovault.vault.azure.net/keys/contosokek"), + }, + }, + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity(), +[new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2")] = new UserAssignedIdentity() +}, + }, + Sku = new OnlineExperimentationWorkspaceSku(OnlineExperimentationWorkspaceSkuName.F0), + Tags = +{ +["newKey"] = "newVal" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, workspaceName, data); + OnlineExperimentWorkspaceResource 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 + OnlineExperimentWorkspaceData 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_GetASingleOnlineExperimentWorkspace() + { + // Generated from example definition: 2025-05-31-preview/OnlineExperimentWorkspaces_Get.json + // this example is just showing the usage of "OnlineExperimentWorkspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "fa5fc227-a624-475e-b696-cdd604c735bc"; + string resourceGroupName = "res9871"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this OnlineExperimentWorkspaceResource + OnlineExperimentWorkspaceCollection collection = resourceGroupResource.GetOnlineExperimentWorkspaces(); + + // invoke the operation + string workspaceName = "expworkspace3"; + OnlineExperimentWorkspaceResource result = await collection.GetAsync(workspaceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + OnlineExperimentWorkspaceData 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_ListOnlineExperimentWorkspacesInAResourceGroup() + { + // Generated from example definition: 2025-05-31-preview/OnlineExperimentWorkspaces_ListByResourceGroup.json + // this example is just showing the usage of "OnlineExperimentWorkspace_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 = "fa5fc227-a624-475e-b696-cdd604c735bc"; + string resourceGroupName = "res9871"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this OnlineExperimentWorkspaceResource + OnlineExperimentWorkspaceCollection collection = resourceGroupResource.GetOnlineExperimentWorkspaces(); + + // invoke the operation and iterate over the result + await foreach (OnlineExperimentWorkspaceResource 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 + OnlineExperimentWorkspaceData 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_GetASingleOnlineExperimentWorkspace() + { + // Generated from example definition: 2025-05-31-preview/OnlineExperimentWorkspaces_Get.json + // this example is just showing the usage of "OnlineExperimentWorkspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "fa5fc227-a624-475e-b696-cdd604c735bc"; + string resourceGroupName = "res9871"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this OnlineExperimentWorkspaceResource + OnlineExperimentWorkspaceCollection collection = resourceGroupResource.GetOnlineExperimentWorkspaces(); + + // invoke the operation + string workspaceName = "expworkspace3"; + bool result = await collection.ExistsAsync(workspaceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetASingleOnlineExperimentWorkspace() + { + // Generated from example definition: 2025-05-31-preview/OnlineExperimentWorkspaces_Get.json + // this example is just showing the usage of "OnlineExperimentWorkspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "fa5fc227-a624-475e-b696-cdd604c735bc"; + string resourceGroupName = "res9871"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this OnlineExperimentWorkspaceResource + OnlineExperimentWorkspaceCollection collection = resourceGroupResource.GetOnlineExperimentWorkspaces(); + + // invoke the operation + string workspaceName = "expworkspace3"; + NullableResponse response = await collection.GetIfExistsAsync(workspaceName); + OnlineExperimentWorkspaceResource 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 + OnlineExperimentWorkspaceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Generated/Samples/Sample_OnlineExperimentWorkspaceResource.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Generated/Samples/Sample_OnlineExperimentWorkspaceResource.cs new file mode 100644 index 000000000000..2f1537910618 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Generated/Samples/Sample_OnlineExperimentWorkspaceResource.cs @@ -0,0 +1,180 @@ +// 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.Models; +using Azure.ResourceManager.OnlineExperimentation.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.OnlineExperimentation.Samples +{ + public partial class Sample_OnlineExperimentWorkspaceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetASingleOnlineExperimentWorkspace() + { + // Generated from example definition: 2025-05-31-preview/OnlineExperimentWorkspaces_Get.json + // this example is just showing the usage of "OnlineExperimentWorkspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this OnlineExperimentWorkspaceResource created on azure + // for more information of creating OnlineExperimentWorkspaceResource, please refer to the document of OnlineExperimentWorkspaceResource + string subscriptionId = "fa5fc227-a624-475e-b696-cdd604c735bc"; + string resourceGroupName = "res9871"; + string workspaceName = "expworkspace3"; + ResourceIdentifier onlineExperimentWorkspaceResourceId = OnlineExperimentWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + OnlineExperimentWorkspaceResource onlineExperimentWorkspace = client.GetOnlineExperimentWorkspaceResource(onlineExperimentWorkspaceResourceId); + + // invoke the operation + OnlineExperimentWorkspaceResource result = await onlineExperimentWorkspace.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 + OnlineExperimentWorkspaceData 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_DeleteAnOnlineExperimentWorkspace() + { + // Generated from example definition: 2025-05-31-preview/OnlineExperimentWorkspaces_Delete.json + // this example is just showing the usage of "OnlineExperimentWorkspace_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 OnlineExperimentWorkspaceResource created on azure + // for more information of creating OnlineExperimentWorkspaceResource, please refer to the document of OnlineExperimentWorkspaceResource + string subscriptionId = "fa5fc227-a624-475e-b696-cdd604c735bc"; + string resourceGroupName = "res9871"; + string workspaceName = "expworkspace3"; + ResourceIdentifier onlineExperimentWorkspaceResourceId = OnlineExperimentWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + OnlineExperimentWorkspaceResource onlineExperimentWorkspace = client.GetOnlineExperimentWorkspaceResource(onlineExperimentWorkspaceResourceId); + + // invoke the operation + await onlineExperimentWorkspace.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateAnOnlineExperimentWorkspace() + { + // Generated from example definition: 2025-05-31-preview/OnlineExperimentWorkspaces_Update.json + // this example is just showing the usage of "OnlineExperimentWorkspace_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 OnlineExperimentWorkspaceResource created on azure + // for more information of creating OnlineExperimentWorkspaceResource, please refer to the document of OnlineExperimentWorkspaceResource + string subscriptionId = "fa5fc227-a624-475e-b696-cdd604c735bc"; + string resourceGroupName = "res9871"; + string workspaceName = "expworkspace3"; + ResourceIdentifier onlineExperimentWorkspaceResourceId = OnlineExperimentWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + OnlineExperimentWorkspaceResource onlineExperimentWorkspace = client.GetOnlineExperimentWorkspaceResource(onlineExperimentWorkspaceResourceId); + + // invoke the operation + OnlineExperimentWorkspaceData data = new OnlineExperimentWorkspaceData(default) + { + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity(), +[new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2")] = new UserAssignedIdentity() +}, + }, + Tags = +{ +["newKey"] = "newVal" +}, + }; + ArmOperation lro = await onlineExperimentWorkspace.UpdateAsync(WaitUntil.Completed, data); + OnlineExperimentWorkspaceResource 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 + OnlineExperimentWorkspaceData 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_UpdateAnOnlineExperimentWorkspaceWithCustomerManagedEncryptionKey() + { + // Generated from example definition: 2025-05-31-preview/OnlineExperimentWorkspaces_UpdateWithEncryption.json + // this example is just showing the usage of "OnlineExperimentWorkspace_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 OnlineExperimentWorkspaceResource created on azure + // for more information of creating OnlineExperimentWorkspaceResource, please refer to the document of OnlineExperimentWorkspaceResource + string subscriptionId = "fa5fc227-a624-475e-b696-cdd604c735bc"; + string resourceGroupName = "res9871"; + string workspaceName = "expworkspace3"; + ResourceIdentifier onlineExperimentWorkspaceResourceId = OnlineExperimentWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + OnlineExperimentWorkspaceResource onlineExperimentWorkspace = client.GetOnlineExperimentWorkspaceResource(onlineExperimentWorkspaceResourceId); + + // invoke the operation + OnlineExperimentWorkspaceData data = new OnlineExperimentWorkspaceData(default) + { + Properties = new OnlineExperimentWorkspaceProperties(new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/res9871/providers/Microsoft.OperationalInsights/workspaces/log9871"), new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto9871"), null) + { + CustomerManagedKeyEncryption = new CustomerManagedKeyEncryption + { + KeyEncryptionKeyIdentity = new KeyEncryptionKeyIdentity + { + IdentityType = KeyEncryptionKeyIdentityType.UserAssignedIdentity, + UserAssignedIdentityResourceId = new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"), + }, + KeyEncryptionKeyUri = new Uri("https://contosovault.vault.azure.net/keys/contosokek"), + }, + }, + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity(), +[new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2")] = new UserAssignedIdentity() +}, + }, + Tags = +{ +["newKey"] = "newVal" +}, + }; + ArmOperation lro = await onlineExperimentWorkspace.UpdateAsync(WaitUntil.Completed, data); + OnlineExperimentWorkspaceResource 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 + OnlineExperimentWorkspaceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..10c9728ba122 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/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.OnlineExperimentation.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetOnlineExperimentWorkspaces_ListOnlineExperimentWorkspacesInASubscription() + { + // Generated from example definition: 2025-05-31-preview/OnlineExperimentWorkspaces_ListBySubscription.json + // this example is just showing the usage of "OnlineExperimentWorkspace_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 = "fa5fc227-a624-475e-b696-cdd604c735bc"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (OnlineExperimentWorkspaceResource item in subscriptionResource.GetOnlineExperimentWorkspacesAsync()) + { + // 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 + OnlineExperimentWorkspaceData 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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Azure.ResourceManager.OnlineExperimentation.csproj b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Azure.ResourceManager.OnlineExperimentation.csproj new file mode 100644 index 000000000000..0cd904f70d96 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Azure.ResourceManager.OnlineExperimentation.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider OnlineExperimentation. + 1.0.0-beta.1 + azure;management;arm;resource manager;onlineexperimentation + Azure.ResourceManager.OnlineExperimentation + + diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/ArmOnlineExperimentationModelFactory.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/ArmOnlineExperimentationModelFactory.cs new file mode 100644 index 000000000000..7c01043e0917 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/ArmOnlineExperimentationModelFactory.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 System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.OnlineExperimentation.Models +{ + /// Model factory for models. + public static partial class ArmOnlineExperimentationModelFactory + { + /// 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. + /// The SKU (Stock Keeping Unit) assigned to this resource. + /// A new instance for mocking. + public static OnlineExperimentWorkspaceData OnlineExperimentWorkspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, OnlineExperimentWorkspaceProperties properties = null, ManagedServiceIdentity identity = null, OnlineExperimentationWorkspaceSku sku = null) + { + tags ??= new Dictionary(); + + return new OnlineExperimentWorkspaceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + identity, + sku, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Id of the workspace. + /// The provisioning state for the resource. + /// The resource identifier of the Log Analytics workspace which online experiment workspace uses for generating experiment analysis results. + /// The resource identifier of storage account where logs are exported from Log Analytics workspace. Online Experiment workspace uses it generating experiment analysis results. + /// The resource identifier of App Configuration with which this online experiment workspace is tied for experimentation. This is a required field for creating an online experiment workspace. + /// The encryption configuration for the online experiment workspace resource. + /// The data plane endpoint for the online experiment workspace resource. + /// A new instance for mocking. + public static OnlineExperimentWorkspaceProperties OnlineExperimentWorkspaceProperties(string workspaceId = null, ResourceProvisioningState? provisioningState = null, ResourceIdentifier logAnalyticsWorkspaceResourceId = null, ResourceIdentifier logsExporterStorageAccountResourceId = null, ResourceIdentifier appConfigurationResourceId = null, CustomerManagedKeyEncryption customerManagedKeyEncryption = null, Uri endpoint = null) + { + return new OnlineExperimentWorkspaceProperties( + workspaceId, + provisioningState, + logAnalyticsWorkspaceResourceId, + logsExporterStorageAccountResourceId, + appConfigurationResourceId, + customerManagedKeyEncryption != null ? new ResourceEncryptionConfiguration(customerManagedKeyEncryption, serializedAdditionalRawData: null) : null, + endpoint, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the SKU. Ex - F0, P0. It is typically a letter+number code. + /// The name of the SKU tier. + /// A new instance for mocking. + public static OnlineExperimentationWorkspaceSku OnlineExperimentationWorkspaceSku(OnlineExperimentationWorkspaceSkuName name = default, OnlineExperimentationWorkspaceSkuTier? tier = null) + { + return new OnlineExperimentationWorkspaceSku(name, tier, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/MockableOnlineExperimentationArmClient.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/MockableOnlineExperimentationArmClient.cs new file mode 100644 index 000000000000..669fb77b6060 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/MockableOnlineExperimentationArmClient.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.OnlineExperimentation.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableOnlineExperimentationArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableOnlineExperimentationArmClient() + { + } + + /// 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 MockableOnlineExperimentationArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableOnlineExperimentationArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// 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 OnlineExperimentWorkspaceResource GetOnlineExperimentWorkspaceResource(ResourceIdentifier id) + { + OnlineExperimentWorkspaceResource.ValidateResourceId(id); + return new OnlineExperimentWorkspaceResource(Client, id); + } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/MockableOnlineExperimentationResourceGroupResource.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/MockableOnlineExperimentationResourceGroupResource.cs new file mode 100644 index 000000000000..195543a97bdb --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/MockableOnlineExperimentationResourceGroupResource.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.OnlineExperimentation.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableOnlineExperimentationResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableOnlineExperimentationResourceGroupResource() + { + } + + /// 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 MockableOnlineExperimentationResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of OnlineExperimentWorkspaceResources in the ResourceGroupResource. + /// An object representing collection of OnlineExperimentWorkspaceResources and their operations over a OnlineExperimentWorkspaceResource. + public virtual OnlineExperimentWorkspaceCollection GetOnlineExperimentWorkspaces() + { + return GetCachedClient(client => new OnlineExperimentWorkspaceCollection(client, Id)); + } + + /// + /// Gets an experiment workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the OnlineExperimentWorkspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetOnlineExperimentWorkspaceAsync(string workspaceName, CancellationToken cancellationToken = default) + { + return await GetOnlineExperimentWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an experiment workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the OnlineExperimentWorkspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetOnlineExperimentWorkspace(string workspaceName, CancellationToken cancellationToken = default) + { + return GetOnlineExperimentWorkspaces().Get(workspaceName, cancellationToken); + } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/MockableOnlineExperimentationSubscriptionResource.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/MockableOnlineExperimentationSubscriptionResource.cs new file mode 100644 index 000000000000..a60f6cd7553e --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/MockableOnlineExperimentationSubscriptionResource.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.OnlineExperimentation.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableOnlineExperimentationSubscriptionResource : ArmResource + { + private ClientDiagnostics _onlineExperimentWorkspaceClientDiagnostics; + private OnlineExperimentWorkspacesRestOperations _onlineExperimentWorkspaceRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableOnlineExperimentationSubscriptionResource() + { + } + + /// 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 MockableOnlineExperimentationSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics OnlineExperimentWorkspaceClientDiagnostics => _onlineExperimentWorkspaceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.OnlineExperimentation", OnlineExperimentWorkspaceResource.ResourceType.Namespace, Diagnostics); + private OnlineExperimentWorkspacesRestOperations OnlineExperimentWorkspaceRestClient => _onlineExperimentWorkspaceRestClient ??= new OnlineExperimentWorkspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(OnlineExperimentWorkspaceResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets all experiment workspaces in the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.OnlineExperimentation/workspaces + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-05-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetOnlineExperimentWorkspacesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => OnlineExperimentWorkspaceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OnlineExperimentWorkspaceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OnlineExperimentWorkspaceResource(Client, OnlineExperimentWorkspaceData.DeserializeOnlineExperimentWorkspaceData(e)), OnlineExperimentWorkspaceClientDiagnostics, Pipeline, "MockableOnlineExperimentationSubscriptionResource.GetOnlineExperimentWorkspaces", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all experiment workspaces in the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.OnlineExperimentation/workspaces + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-05-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetOnlineExperimentWorkspaces(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => OnlineExperimentWorkspaceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OnlineExperimentWorkspaceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OnlineExperimentWorkspaceResource(Client, OnlineExperimentWorkspaceData.DeserializeOnlineExperimentWorkspaceData(e)), OnlineExperimentWorkspaceClientDiagnostics, Pipeline, "MockableOnlineExperimentationSubscriptionResource.GetOnlineExperimentWorkspaces", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/OnlineExperimentationExtensions.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/OnlineExperimentationExtensions.cs new file mode 100644 index 000000000000..c66a6e467b46 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Extensions/OnlineExperimentationExtensions.cs @@ -0,0 +1,219 @@ +// 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.OnlineExperimentation.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OnlineExperimentation +{ + /// A class to add extension methods to Azure.ResourceManager.OnlineExperimentation. + public static partial class OnlineExperimentationExtensions + { + private static MockableOnlineExperimentationArmClient GetMockableOnlineExperimentationArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableOnlineExperimentationArmClient(client0)); + } + + private static MockableOnlineExperimentationResourceGroupResource GetMockableOnlineExperimentationResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableOnlineExperimentationResourceGroupResource(client, resource.Id)); + } + + private static MockableOnlineExperimentationSubscriptionResource GetMockableOnlineExperimentationSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableOnlineExperimentationSubscriptionResource(client, resource.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 OnlineExperimentWorkspaceResource GetOnlineExperimentWorkspaceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOnlineExperimentationArmClient(client).GetOnlineExperimentWorkspaceResource(id); + } + + /// + /// Gets a collection of OnlineExperimentWorkspaceResources 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 OnlineExperimentWorkspaceResources and their operations over a OnlineExperimentWorkspaceResource. + public static OnlineExperimentWorkspaceCollection GetOnlineExperimentWorkspaces(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOnlineExperimentationResourceGroupResource(resourceGroupResource).GetOnlineExperimentWorkspaces(); + } + + /// + /// Gets an experiment workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the OnlineExperimentWorkspace. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetOnlineExperimentWorkspaceAsync(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableOnlineExperimentationResourceGroupResource(resourceGroupResource).GetOnlineExperimentWorkspaceAsync(workspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an experiment workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the OnlineExperimentWorkspace. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetOnlineExperimentWorkspace(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOnlineExperimentationResourceGroupResource(resourceGroupResource).GetOnlineExperimentWorkspace(workspaceName, cancellationToken); + } + + /// + /// Gets all experiment workspaces in the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.OnlineExperimentation/workspaces + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-05-31-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 GetOnlineExperimentWorkspacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOnlineExperimentationSubscriptionResource(subscriptionResource).GetOnlineExperimentWorkspacesAsync(cancellationToken); + } + + /// + /// Gets all experiment workspaces in the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.OnlineExperimentation/workspaces + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-05-31-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 GetOnlineExperimentWorkspaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOnlineExperimentationSubscriptionResource(subscriptionResource).GetOnlineExperimentWorkspaces(cancellationToken); + } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/Argument.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..c344bacf5812 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/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.OnlineExperimentation +{ + 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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..5eec91d4d3ae --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/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.OnlineExperimentation +{ + 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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/ChangeTrackingList.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..d2c1828f4017 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/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.OnlineExperimentation +{ + 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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..37bad1d6b51c --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/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.OnlineExperimentation +{ + 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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/Optional.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..fc4221ab7bbf --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/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.OnlineExperimentation +{ + 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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..0859f0f298eb --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/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.OnlineExperimentation +{ + 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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/LongRunningOperation/OnlineExperimentWorkspaceOperationSource.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/LongRunningOperation/OnlineExperimentWorkspaceOperationSource.cs new file mode 100644 index 000000000000..bde0879813fb --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/LongRunningOperation/OnlineExperimentWorkspaceOperationSource.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.OnlineExperimentation +{ + internal class OnlineExperimentWorkspaceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal OnlineExperimentWorkspaceOperationSource(ArmClient client) + { + _client = client; + } + + OnlineExperimentWorkspaceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new OnlineExperimentWorkspaceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new OnlineExperimentWorkspaceResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/LongRunningOperation/OnlineExperimentationArmOperation.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/LongRunningOperation/OnlineExperimentationArmOperation.cs new file mode 100644 index 000000000000..b53676065fb1 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/LongRunningOperation/OnlineExperimentationArmOperation.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.OnlineExperimentation +{ +#pragma warning disable SA1649 // File name should match first type name + internal class OnlineExperimentationArmOperation : 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 OnlineExperimentationArmOperation for mocking. + protected OnlineExperimentationArmOperation() + { + } + + internal OnlineExperimentationArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal OnlineExperimentationArmOperation(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, "OnlineExperimentationArmOperation", 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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/LongRunningOperation/OnlineExperimentationArmOperationOfT.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/LongRunningOperation/OnlineExperimentationArmOperationOfT.cs new file mode 100644 index 000000000000..0dc74894eb2a --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/LongRunningOperation/OnlineExperimentationArmOperationOfT.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.OnlineExperimentation +{ +#pragma warning disable SA1649 // File name should match first type name + internal class OnlineExperimentationArmOperation : 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 OnlineExperimentationArmOperation for mocking. + protected OnlineExperimentationArmOperation() + { + } + + internal OnlineExperimentationArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal OnlineExperimentationArmOperation(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, "OnlineExperimentationArmOperation", 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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/CustomerManagedKeyEncryption.Serialization.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/CustomerManagedKeyEncryption.Serialization.cs new file mode 100644 index 000000000000..fa29bd6ca65f --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/CustomerManagedKeyEncryption.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.OnlineExperimentation.Models +{ + public partial class CustomerManagedKeyEncryption : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryption)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(KeyEncryptionKeyIdentity)) + { + writer.WritePropertyName("keyEncryptionKeyIdentity"u8); + writer.WriteObjectValue(KeyEncryptionKeyIdentity, options); + } + if (Optional.IsDefined(KeyEncryptionKeyUri)) + { + writer.WritePropertyName("keyEncryptionKeyUrl"u8); + writer.WriteStringValue(KeyEncryptionKeyUri.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 + } + } + } + + CustomerManagedKeyEncryption IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryption)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomerManagedKeyEncryption(document.RootElement, options); + } + + internal static CustomerManagedKeyEncryption DeserializeCustomerManagedKeyEncryption(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + KeyEncryptionKeyIdentity keyEncryptionKeyIdentity = default; + Uri keyEncryptionKeyUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyEncryptionKeyIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyEncryptionKeyIdentity = KeyEncryptionKeyIdentity.DeserializeKeyEncryptionKeyIdentity(property.Value, options); + continue; + } + if (property.NameEquals("keyEncryptionKeyUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyEncryptionKeyUrl = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomerManagedKeyEncryption(keyEncryptionKeyIdentity, keyEncryptionKeyUrl, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryption)} does not support writing '{options.Format}' format."); + } + } + + CustomerManagedKeyEncryption IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCustomerManagedKeyEncryption(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryption)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/CustomerManagedKeyEncryption.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/CustomerManagedKeyEncryption.cs new file mode 100644 index 000000000000..086b415c91c4 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/CustomerManagedKeyEncryption.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.OnlineExperimentation.Models +{ + /// Customer-managed key encryption properties for the resource. + public partial class CustomerManagedKeyEncryption + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 CustomerManagedKeyEncryption() + { + } + + /// Initializes a new instance of . + /// All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. + /// key encryption key Url, versioned or non-versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek. + /// Keeps track of any properties unknown to the library. + internal CustomerManagedKeyEncryption(KeyEncryptionKeyIdentity keyEncryptionKeyIdentity, Uri keyEncryptionKeyUri, IDictionary serializedAdditionalRawData) + { + KeyEncryptionKeyIdentity = keyEncryptionKeyIdentity; + KeyEncryptionKeyUri = keyEncryptionKeyUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. + public KeyEncryptionKeyIdentity KeyEncryptionKeyIdentity { get; set; } + /// key encryption key Url, versioned or non-versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek. + public Uri KeyEncryptionKeyUri { get; set; } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/KeyEncryptionKeyIdentity.Serialization.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/KeyEncryptionKeyIdentity.Serialization.cs new file mode 100644 index 000000000000..967d746855d2 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/KeyEncryptionKeyIdentity.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.OnlineExperimentation.Models +{ + public partial class KeyEncryptionKeyIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeyEncryptionKeyIdentity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IdentityType)) + { + writer.WritePropertyName("identityType"u8); + writer.WriteStringValue(IdentityType.Value.ToString()); + } + if (Optional.IsDefined(UserAssignedIdentityResourceId)) + { + writer.WritePropertyName("userAssignedIdentityResourceId"u8); + writer.WriteStringValue(UserAssignedIdentityResourceId); + } + 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 + } + } + } + + KeyEncryptionKeyIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeyEncryptionKeyIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyEncryptionKeyIdentity(document.RootElement, options); + } + + internal static KeyEncryptionKeyIdentity DeserializeKeyEncryptionKeyIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + KeyEncryptionKeyIdentityType? identityType = default; + ResourceIdentifier userAssignedIdentityResourceId = 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 KeyEncryptionKeyIdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentityResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedIdentityResourceId = new ResourceIdentifier(property.Value.GetString()); + 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 KeyEncryptionKeyIdentity(identityType, userAssignedIdentityResourceId, 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(KeyEncryptionKeyIdentity)} does not support writing '{options.Format}' format."); + } + } + + KeyEncryptionKeyIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeKeyEncryptionKeyIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(KeyEncryptionKeyIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/KeyEncryptionKeyIdentity.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/KeyEncryptionKeyIdentity.cs new file mode 100644 index 000000000000..7f917da8f03e --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/KeyEncryptionKeyIdentity.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.OnlineExperimentation.Models +{ + /// All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. + public partial class KeyEncryptionKeyIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 KeyEncryptionKeyIdentity() + { + } + + /// Initializes a new instance of . + /// The type of identity to use. Values can be systemAssignedIdentity, userAssignedIdentity, or delegatedResourceIdentity. + /// User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity. + /// application client identity to use for accessing key encryption key Url in a different tenant. Ex: f83c6b1b-4d34-47e4-bb34-9d83df58b540. + /// Keeps track of any properties unknown to the library. + internal KeyEncryptionKeyIdentity(KeyEncryptionKeyIdentityType? identityType, ResourceIdentifier userAssignedIdentityResourceId, Guid? federatedClientId, IDictionary serializedAdditionalRawData) + { + IdentityType = identityType; + UserAssignedIdentityResourceId = userAssignedIdentityResourceId; + FederatedClientId = federatedClientId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of identity to use. Values can be systemAssignedIdentity, userAssignedIdentity, or delegatedResourceIdentity. + public KeyEncryptionKeyIdentityType? IdentityType { get; set; } + /// User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity. + public ResourceIdentifier UserAssignedIdentityResourceId { get; set; } + /// application client identity to use for accessing key encryption key Url in a different tenant. Ex: f83c6b1b-4d34-47e4-bb34-9d83df58b540. + public Guid? FederatedClientId { get; set; } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/KeyEncryptionKeyIdentityType.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/KeyEncryptionKeyIdentityType.cs new file mode 100644 index 000000000000..5dcc17dbd48e --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/KeyEncryptionKeyIdentityType.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.OnlineExperimentation.Models +{ + /// The type of identity to use. + public readonly partial struct KeyEncryptionKeyIdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public KeyEncryptionKeyIdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemAssignedIdentityValue = "SystemAssignedIdentity"; + private const string UserAssignedIdentityValue = "UserAssignedIdentity"; + + /// System assigned identity. + public static KeyEncryptionKeyIdentityType SystemAssignedIdentity { get; } = new KeyEncryptionKeyIdentityType(SystemAssignedIdentityValue); + /// User assigned identity. + public static KeyEncryptionKeyIdentityType UserAssignedIdentity { get; } = new KeyEncryptionKeyIdentityType(UserAssignedIdentityValue); + /// Determines if two values are the same. + public static bool operator ==(KeyEncryptionKeyIdentityType left, KeyEncryptionKeyIdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(KeyEncryptionKeyIdentityType left, KeyEncryptionKeyIdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator KeyEncryptionKeyIdentityType(string value) => new KeyEncryptionKeyIdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is KeyEncryptionKeyIdentityType other && Equals(other); + /// + public bool Equals(KeyEncryptionKeyIdentityType 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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceListResult.Serialization.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceListResult.Serialization.cs new file mode 100644 index 000000000000..9ea5d4525510 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceListResult.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.OnlineExperimentation.Models +{ + internal partial class OnlineExperimentWorkspaceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnlineExperimentWorkspaceListResult)} 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 + } + } + } + + OnlineExperimentWorkspaceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnlineExperimentWorkspaceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnlineExperimentWorkspaceListResult(document.RootElement, options); + } + + internal static OnlineExperimentWorkspaceListResult DeserializeOnlineExperimentWorkspaceListResult(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(OnlineExperimentWorkspaceData.DeserializeOnlineExperimentWorkspaceData(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 OnlineExperimentWorkspaceListResult(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(OnlineExperimentWorkspaceListResult)} does not support writing '{options.Format}' format."); + } + } + + OnlineExperimentWorkspaceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOnlineExperimentWorkspaceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnlineExperimentWorkspaceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceListResult.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceListResult.cs new file mode 100644 index 000000000000..283ace09b30b --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceListResult.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.OnlineExperimentation.Models +{ + /// The response of a OnlineExperimentWorkspace list operation. + internal partial class OnlineExperimentWorkspaceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 OnlineExperimentWorkspace items on this page. + /// is null. + internal OnlineExperimentWorkspaceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The OnlineExperimentWorkspace items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal OnlineExperimentWorkspaceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OnlineExperimentWorkspaceListResult() + { + } + + /// The OnlineExperimentWorkspace items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceProperties.Serialization.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceProperties.Serialization.cs new file mode 100644 index 000000000000..d9b545861be3 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceProperties.Serialization.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.OnlineExperimentation.Models +{ + public partial class OnlineExperimentWorkspaceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnlineExperimentWorkspaceProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(WorkspaceId)) + { + writer.WritePropertyName("workspaceId"u8); + writer.WriteStringValue(WorkspaceId); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("logAnalyticsWorkspaceResourceId"u8); + writer.WriteStringValue(LogAnalyticsWorkspaceResourceId); + writer.WritePropertyName("logsExporterStorageAccountResourceId"u8); + writer.WriteStringValue(LogsExporterStorageAccountResourceId); + writer.WritePropertyName("appConfigurationResourceId"u8); + writer.WriteStringValue(AppConfigurationResourceId); + if (Optional.IsDefined(Encryption)) + { + writer.WritePropertyName("encryption"u8); + writer.WriteObjectValue(Encryption, options); + } + if (options.Format != "W" && Optional.IsDefined(Endpoint)) + { + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint.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 + } + } + } + + OnlineExperimentWorkspaceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnlineExperimentWorkspaceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnlineExperimentWorkspaceProperties(document.RootElement, options); + } + + internal static OnlineExperimentWorkspaceProperties DeserializeOnlineExperimentWorkspaceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string workspaceId = default; + ResourceProvisioningState? provisioningState = default; + ResourceIdentifier logAnalyticsWorkspaceResourceId = default; + ResourceIdentifier logsExporterStorageAccountResourceId = default; + ResourceIdentifier appConfigurationResourceId = default; + ResourceEncryptionConfiguration encryption = default; + Uri endpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("workspaceId"u8)) + { + workspaceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("logAnalyticsWorkspaceResourceId"u8)) + { + logAnalyticsWorkspaceResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("logsExporterStorageAccountResourceId"u8)) + { + logsExporterStorageAccountResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("appConfigurationResourceId"u8)) + { + appConfigurationResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("encryption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryption = ResourceEncryptionConfiguration.DeserializeResourceEncryptionConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("endpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpoint = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnlineExperimentWorkspaceProperties( + workspaceId, + provisioningState, + logAnalyticsWorkspaceResourceId, + logsExporterStorageAccountResourceId, + appConfigurationResourceId, + encryption, + endpoint, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnlineExperimentWorkspaceProperties)} does not support writing '{options.Format}' format."); + } + } + + OnlineExperimentWorkspaceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOnlineExperimentWorkspaceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnlineExperimentWorkspaceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceProperties.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceProperties.cs new file mode 100644 index 000000000000..371b76ee88f2 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentWorkspaceProperties.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.OnlineExperimentation.Models +{ + /// The properties of an online experiment workspace. + public partial class OnlineExperimentWorkspaceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 resource identifier of the Log Analytics workspace which online experiment workspace uses for generating experiment analysis results. + /// The resource identifier of storage account where logs are exported from Log Analytics workspace. Online Experiment workspace uses it generating experiment analysis results. + /// The resource identifier of App Configuration with which this online experiment workspace is tied for experimentation. This is a required field for creating an online experiment workspace. + /// , or is null. + public OnlineExperimentWorkspaceProperties(ResourceIdentifier logAnalyticsWorkspaceResourceId, ResourceIdentifier logsExporterStorageAccountResourceId, ResourceIdentifier appConfigurationResourceId) + { + Argument.AssertNotNull(logAnalyticsWorkspaceResourceId, nameof(logAnalyticsWorkspaceResourceId)); + Argument.AssertNotNull(logsExporterStorageAccountResourceId, nameof(logsExporterStorageAccountResourceId)); + Argument.AssertNotNull(appConfigurationResourceId, nameof(appConfigurationResourceId)); + + LogAnalyticsWorkspaceResourceId = logAnalyticsWorkspaceResourceId; + LogsExporterStorageAccountResourceId = logsExporterStorageAccountResourceId; + AppConfigurationResourceId = appConfigurationResourceId; + } + + /// Initializes a new instance of . + /// The Id of the workspace. + /// The provisioning state for the resource. + /// The resource identifier of the Log Analytics workspace which online experiment workspace uses for generating experiment analysis results. + /// The resource identifier of storage account where logs are exported from Log Analytics workspace. Online Experiment workspace uses it generating experiment analysis results. + /// The resource identifier of App Configuration with which this online experiment workspace is tied for experimentation. This is a required field for creating an online experiment workspace. + /// The encryption configuration for the online experiment workspace resource. + /// The data plane endpoint for the online experiment workspace resource. + /// Keeps track of any properties unknown to the library. + internal OnlineExperimentWorkspaceProperties(string workspaceId, ResourceProvisioningState? provisioningState, ResourceIdentifier logAnalyticsWorkspaceResourceId, ResourceIdentifier logsExporterStorageAccountResourceId, ResourceIdentifier appConfigurationResourceId, ResourceEncryptionConfiguration encryption, Uri endpoint, IDictionary serializedAdditionalRawData) + { + WorkspaceId = workspaceId; + ProvisioningState = provisioningState; + LogAnalyticsWorkspaceResourceId = logAnalyticsWorkspaceResourceId; + LogsExporterStorageAccountResourceId = logsExporterStorageAccountResourceId; + AppConfigurationResourceId = appConfigurationResourceId; + Encryption = encryption; + Endpoint = endpoint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OnlineExperimentWorkspaceProperties() + { + } + + /// The Id of the workspace. + public string WorkspaceId { get; } + /// The provisioning state for the resource. + public ResourceProvisioningState? ProvisioningState { get; } + /// The resource identifier of the Log Analytics workspace which online experiment workspace uses for generating experiment analysis results. + public ResourceIdentifier LogAnalyticsWorkspaceResourceId { get; set; } + /// The resource identifier of storage account where logs are exported from Log Analytics workspace. Online Experiment workspace uses it generating experiment analysis results. + public ResourceIdentifier LogsExporterStorageAccountResourceId { get; set; } + /// The resource identifier of App Configuration with which this online experiment workspace is tied for experimentation. This is a required field for creating an online experiment workspace. + public ResourceIdentifier AppConfigurationResourceId { get; set; } + /// The encryption configuration for the online experiment workspace resource. + internal ResourceEncryptionConfiguration Encryption { get; set; } + /// All Customer-managed key encryption properties for the resource. + public CustomerManagedKeyEncryption CustomerManagedKeyEncryption + { + get => Encryption is null ? default : Encryption.CustomerManagedKeyEncryption; + set + { + if (Encryption is null) + Encryption = new ResourceEncryptionConfiguration(); + Encryption.CustomerManagedKeyEncryption = value; + } + } + + /// The data plane endpoint for the online experiment workspace resource. + public Uri Endpoint { get; } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSku.Serialization.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSku.Serialization.cs new file mode 100644 index 000000000000..7020ae79bacd --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSku.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.OnlineExperimentation.Models +{ + public partial class OnlineExperimentationWorkspaceSku : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnlineExperimentationWorkspaceSku)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.ToString()); + if (options.Format != "W" && Optional.IsDefined(Tier)) + { + writer.WritePropertyName("tier"u8); + writer.WriteStringValue(Tier.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 + } + } + } + + OnlineExperimentationWorkspaceSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnlineExperimentationWorkspaceSku)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnlineExperimentationWorkspaceSku(document.RootElement, options); + } + + internal static OnlineExperimentationWorkspaceSku DeserializeOnlineExperimentationWorkspaceSku(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OnlineExperimentationWorkspaceSkuName name = default; + OnlineExperimentationWorkspaceSkuTier? tier = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = new OnlineExperimentationWorkspaceSkuName(property.Value.GetString()); + continue; + } + if (property.NameEquals("tier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tier = new OnlineExperimentationWorkspaceSkuTier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OnlineExperimentationWorkspaceSku(name, tier, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OnlineExperimentationWorkspaceSku)} does not support writing '{options.Format}' format."); + } + } + + OnlineExperimentationWorkspaceSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOnlineExperimentationWorkspaceSku(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnlineExperimentationWorkspaceSku)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSku.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSku.cs new file mode 100644 index 000000000000..6eca9afe394e --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSku.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; + +namespace Azure.ResourceManager.OnlineExperimentation.Models +{ + /// The SKU (Stock Keeping Unit) assigned to this resource. + public partial class OnlineExperimentationWorkspaceSku + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 name of the SKU. Ex - F0, P0. It is typically a letter+number code. + public OnlineExperimentationWorkspaceSku(OnlineExperimentationWorkspaceSkuName name) + { + Name = name; + } + + /// Initializes a new instance of . + /// The name of the SKU. Ex - F0, P0. It is typically a letter+number code. + /// The name of the SKU tier. + /// Keeps track of any properties unknown to the library. + internal OnlineExperimentationWorkspaceSku(OnlineExperimentationWorkspaceSkuName name, OnlineExperimentationWorkspaceSkuTier? tier, IDictionary serializedAdditionalRawData) + { + Name = name; + Tier = tier; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OnlineExperimentationWorkspaceSku() + { + } + + /// The name of the SKU. Ex - F0, P0. It is typically a letter+number code. + public OnlineExperimentationWorkspaceSkuName Name { get; set; } + /// The name of the SKU tier. + public OnlineExperimentationWorkspaceSkuTier? Tier { get; } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSkuName.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSkuName.cs new file mode 100644 index 000000000000..8a9bc528f7cf --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSkuName.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.OnlineExperimentation.Models +{ + /// The allowed SKU names for the online experimentation workspace. + public readonly partial struct OnlineExperimentationWorkspaceSkuName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OnlineExperimentationWorkspaceSkuName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string F0Value = "F0"; + private const string S0Value = "S0"; + private const string P0Value = "P0"; + private const string D0Value = "D0"; + + /// The Free service sku name. + public static OnlineExperimentationWorkspaceSkuName F0 { get; } = new OnlineExperimentationWorkspaceSkuName(F0Value); + /// The Standard service sku name. + public static OnlineExperimentationWorkspaceSkuName S0 { get; } = new OnlineExperimentationWorkspaceSkuName(S0Value); + /// The Premium service sku name. + public static OnlineExperimentationWorkspaceSkuName P0 { get; } = new OnlineExperimentationWorkspaceSkuName(P0Value); + /// The Developer service sku name. + public static OnlineExperimentationWorkspaceSkuName D0 { get; } = new OnlineExperimentationWorkspaceSkuName(D0Value); + /// Determines if two values are the same. + public static bool operator ==(OnlineExperimentationWorkspaceSkuName left, OnlineExperimentationWorkspaceSkuName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OnlineExperimentationWorkspaceSkuName left, OnlineExperimentationWorkspaceSkuName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OnlineExperimentationWorkspaceSkuName(string value) => new OnlineExperimentationWorkspaceSkuName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OnlineExperimentationWorkspaceSkuName other && Equals(other); + /// + public bool Equals(OnlineExperimentationWorkspaceSkuName 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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSkuTier.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSkuTier.cs new file mode 100644 index 000000000000..444b84a5c3ea --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/OnlineExperimentationWorkspaceSkuTier.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.OnlineExperimentation.Models +{ + /// The allowed SKU tiers for the online experimentation workspace. + public readonly partial struct OnlineExperimentationWorkspaceSkuTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OnlineExperimentationWorkspaceSkuTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FreeValue = "Free"; + private const string StandardValue = "Standard"; + private const string PremiumValue = "Premium"; + private const string DeveloperValue = "Developer"; + + /// The Free service tier. + public static OnlineExperimentationWorkspaceSkuTier Free { get; } = new OnlineExperimentationWorkspaceSkuTier(FreeValue); + /// The Standard service tier. + public static OnlineExperimentationWorkspaceSkuTier Standard { get; } = new OnlineExperimentationWorkspaceSkuTier(StandardValue); + /// The Premium service tier. + public static OnlineExperimentationWorkspaceSkuTier Premium { get; } = new OnlineExperimentationWorkspaceSkuTier(PremiumValue); + /// The Developer service tier. + public static OnlineExperimentationWorkspaceSkuTier Developer { get; } = new OnlineExperimentationWorkspaceSkuTier(DeveloperValue); + /// Determines if two values are the same. + public static bool operator ==(OnlineExperimentationWorkspaceSkuTier left, OnlineExperimentationWorkspaceSkuTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OnlineExperimentationWorkspaceSkuTier left, OnlineExperimentationWorkspaceSkuTier right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OnlineExperimentationWorkspaceSkuTier(string value) => new OnlineExperimentationWorkspaceSkuTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OnlineExperimentationWorkspaceSkuTier other && Equals(other); + /// + public bool Equals(OnlineExperimentationWorkspaceSkuTier 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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/ResourceEncryptionConfiguration.Serialization.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/ResourceEncryptionConfiguration.Serialization.cs new file mode 100644 index 000000000000..ce14517f4e15 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/ResourceEncryptionConfiguration.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.OnlineExperimentation.Models +{ + internal partial class ResourceEncryptionConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceEncryptionConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CustomerManagedKeyEncryption)) + { + writer.WritePropertyName("customerManagedKeyEncryption"u8); + writer.WriteObjectValue(CustomerManagedKeyEncryption, 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 + } + } + } + + ResourceEncryptionConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceEncryptionConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceEncryptionConfiguration(document.RootElement, options); + } + + internal static ResourceEncryptionConfiguration DeserializeResourceEncryptionConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CustomerManagedKeyEncryption customerManagedKeyEncryption = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customerManagedKeyEncryption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerManagedKeyEncryption = CustomerManagedKeyEncryption.DeserializeCustomerManagedKeyEncryption(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceEncryptionConfiguration(customerManagedKeyEncryption, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResourceEncryptionConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ResourceEncryptionConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeResourceEncryptionConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceEncryptionConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/ResourceEncryptionConfiguration.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/ResourceEncryptionConfiguration.cs new file mode 100644 index 000000000000..8e79d4cb8d3d --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/ResourceEncryptionConfiguration.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.OnlineExperimentation.Models +{ + /// The encryption configuration for the online experiment workspace resource. + internal partial class ResourceEncryptionConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ResourceEncryptionConfiguration() + { + } + + /// Initializes a new instance of . + /// All Customer-managed key encryption properties for the resource. + /// Keeps track of any properties unknown to the library. + internal ResourceEncryptionConfiguration(CustomerManagedKeyEncryption customerManagedKeyEncryption, IDictionary serializedAdditionalRawData) + { + CustomerManagedKeyEncryption = customerManagedKeyEncryption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// All Customer-managed key encryption properties for the resource. + public CustomerManagedKeyEncryption CustomerManagedKeyEncryption { get; set; } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/ResourceProvisioningState.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/Models/ResourceProvisioningState.cs new file mode 100644 index 000000000000..dcc279210b75 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/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.OnlineExperimentation.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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceCollection.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceCollection.cs new file mode 100644 index 000000000000..d2ae0bf7d049 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceCollection.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.OnlineExperimentation +{ + /// + /// 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 GetOnlineExperimentWorkspaces method from an instance of . + /// + public partial class OnlineExperimentWorkspaceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _onlineExperimentWorkspaceClientDiagnostics; + private readonly OnlineExperimentWorkspacesRestOperations _onlineExperimentWorkspaceRestClient; + + /// Initializes a new instance of the class for mocking. + protected OnlineExperimentWorkspaceCollection() + { + } + + /// 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 OnlineExperimentWorkspaceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _onlineExperimentWorkspaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OnlineExperimentation", OnlineExperimentWorkspaceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(OnlineExperimentWorkspaceResource.ResourceType, out string onlineExperimentWorkspaceApiVersion); + _onlineExperimentWorkspaceRestClient = new OnlineExperimentWorkspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, onlineExperimentWorkspaceApiVersion); +#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 an experiment workspace, or update an existing workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-05-31-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 name of the OnlineExperimentWorkspace. + /// 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 workspaceName, OnlineExperimentWorkspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _onlineExperimentWorkspaceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, data, cancellationToken).ConfigureAwait(false); + var operation = new OnlineExperimentationArmOperation(new OnlineExperimentWorkspaceOperationSource(Client), _onlineExperimentWorkspaceClientDiagnostics, Pipeline, _onlineExperimentWorkspaceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, 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 an experiment workspace, or update an existing workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-05-31-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 name of the OnlineExperimentWorkspace. + /// 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 workspaceName, OnlineExperimentWorkspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _onlineExperimentWorkspaceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, data, cancellationToken); + var operation = new OnlineExperimentationArmOperation(new OnlineExperimentWorkspaceOperationSource(Client), _onlineExperimentWorkspaceClientDiagnostics, Pipeline, _onlineExperimentWorkspaceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets an experiment workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the OnlineExperimentWorkspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var scope = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceCollection.Get"); + scope.Start(); + try + { + var response = await _onlineExperimentWorkspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new OnlineExperimentWorkspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets an experiment workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the OnlineExperimentWorkspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var scope = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceCollection.Get"); + scope.Start(); + try + { + var response = _onlineExperimentWorkspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new OnlineExperimentWorkspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all experiment workspaces in a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-05-31-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) => _onlineExperimentWorkspaceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _onlineExperimentWorkspaceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OnlineExperimentWorkspaceResource(Client, OnlineExperimentWorkspaceData.DeserializeOnlineExperimentWorkspaceData(e)), _onlineExperimentWorkspaceClientDiagnostics, Pipeline, "OnlineExperimentWorkspaceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all experiment workspaces in a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-05-31-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) => _onlineExperimentWorkspaceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _onlineExperimentWorkspaceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OnlineExperimentWorkspaceResource(Client, OnlineExperimentWorkspaceData.DeserializeOnlineExperimentWorkspaceData(e)), _onlineExperimentWorkspaceClientDiagnostics, Pipeline, "OnlineExperimentWorkspaceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the OnlineExperimentWorkspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var scope = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceCollection.Exists"); + scope.Start(); + try + { + var response = await _onlineExperimentWorkspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, 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.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the OnlineExperimentWorkspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var scope = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceCollection.Exists"); + scope.Start(); + try + { + var response = _onlineExperimentWorkspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, 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.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the OnlineExperimentWorkspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var scope = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _onlineExperimentWorkspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new OnlineExperimentWorkspaceResource(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.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the OnlineExperimentWorkspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var scope = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _onlineExperimentWorkspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, workspaceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new OnlineExperimentWorkspaceResource(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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceData.Serialization.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceData.Serialization.cs new file mode 100644 index 000000000000..5477146b0b91 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceData.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.OnlineExperimentation.Models; + +namespace Azure.ResourceManager.OnlineExperimentation +{ + public partial class OnlineExperimentWorkspaceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(OnlineExperimentWorkspaceData)} 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); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } + } + + OnlineExperimentWorkspaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OnlineExperimentWorkspaceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOnlineExperimentWorkspaceData(document.RootElement, options); + } + + internal static OnlineExperimentWorkspaceData DeserializeOnlineExperimentWorkspaceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OnlineExperimentWorkspaceProperties properties = default; + ManagedServiceIdentity identity = default; + OnlineExperimentationWorkspaceSku sku = 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 = OnlineExperimentWorkspaceProperties.DeserializeOnlineExperimentWorkspaceProperties(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("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = OnlineExperimentationWorkspaceSku.DeserializeOnlineExperimentationWorkspaceSku(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 OnlineExperimentWorkspaceData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + identity, + 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(OnlineExperimentWorkspaceData)} does not support writing '{options.Format}' format."); + } + } + + OnlineExperimentWorkspaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOnlineExperimentWorkspaceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OnlineExperimentWorkspaceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceData.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceData.cs new file mode 100644 index 000000000000..54239ad0039c --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceData.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.OnlineExperimentation.Models; + +namespace Azure.ResourceManager.OnlineExperimentation +{ + /// + /// A class representing the OnlineExperimentWorkspace data model. + /// An online experiment workspace resource. + /// + public partial class OnlineExperimentWorkspaceData : 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 OnlineExperimentWorkspaceData(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. + /// The SKU (Stock Keeping Unit) assigned to this resource. + /// Keeps track of any properties unknown to the library. + internal OnlineExperimentWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, OnlineExperimentWorkspaceProperties properties, ManagedServiceIdentity identity, OnlineExperimentationWorkspaceSku sku, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Identity = identity; + Sku = sku; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OnlineExperimentWorkspaceData() + { + } + + /// The resource-specific properties for this resource. + public OnlineExperimentWorkspaceProperties Properties { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + /// The SKU (Stock Keeping Unit) assigned to this resource. + public OnlineExperimentationWorkspaceSku Sku { get; set; } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceResource.Serialization.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceResource.Serialization.cs new file mode 100644 index 000000000000..95f593ce6d87 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceResource.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.OnlineExperimentation +{ + public partial class OnlineExperimentWorkspaceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + OnlineExperimentWorkspaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + OnlineExperimentWorkspaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceResource.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceResource.cs new file mode 100644 index 000000000000..b374b1195ae7 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/OnlineExperimentWorkspaceResource.cs @@ -0,0 +1,706 @@ +// 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; + +namespace Azure.ResourceManager.OnlineExperimentation +{ + /// + /// A Class representing an OnlineExperimentWorkspace 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 GetOnlineExperimentWorkspaceResource method. + /// Otherwise you can get one from its parent resource using the GetOnlineExperimentWorkspace method. + /// + public partial class OnlineExperimentWorkspaceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _onlineExperimentWorkspaceClientDiagnostics; + private readonly OnlineExperimentWorkspacesRestOperations _onlineExperimentWorkspaceRestClient; + private readonly OnlineExperimentWorkspaceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.OnlineExperimentation/workspaces"; + + /// Initializes a new instance of the class for mocking. + protected OnlineExperimentWorkspaceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal OnlineExperimentWorkspaceResource(ArmClient client, OnlineExperimentWorkspaceData 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 OnlineExperimentWorkspaceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _onlineExperimentWorkspaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OnlineExperimentation", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string onlineExperimentWorkspaceApiVersion); + _onlineExperimentWorkspaceRestClient = new OnlineExperimentWorkspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, onlineExperimentWorkspaceApiVersion); +#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 OnlineExperimentWorkspaceData 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 an experiment workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceResource.Get"); + scope.Start(); + try + { + var response = await _onlineExperimentWorkspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new OnlineExperimentWorkspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets an experiment workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceResource.Get"); + scope.Start(); + try + { + var response = _onlineExperimentWorkspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new OnlineExperimentWorkspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an experiment workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Delete + /// + /// + /// Default Api Version + /// 2025-05-31-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 = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceResource.Delete"); + scope.Start(); + try + { + var response = await _onlineExperimentWorkspaceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new OnlineExperimentationArmOperation(_onlineExperimentWorkspaceClientDiagnostics, Pipeline, _onlineExperimentWorkspaceRestClient.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 an experiment workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Delete + /// + /// + /// Default Api Version + /// 2025-05-31-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 = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceResource.Delete"); + scope.Start(); + try + { + var response = _onlineExperimentWorkspaceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new OnlineExperimentationArmOperation(_onlineExperimentWorkspaceClientDiagnostics, Pipeline, _onlineExperimentWorkspaceRestClient.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; + } + } + + /// + /// Patch an experiment workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Update + /// + /// + /// Default Api Version + /// 2025-05-31-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, OnlineExperimentWorkspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceResource.Update"); + scope.Start(); + try + { + var response = await _onlineExperimentWorkspaceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new OnlineExperimentationArmOperation(new OnlineExperimentWorkspaceOperationSource(Client), _onlineExperimentWorkspaceClientDiagnostics, Pipeline, _onlineExperimentWorkspaceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Patch an experiment workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Update + /// + /// + /// Default Api Version + /// 2025-05-31-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, OnlineExperimentWorkspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceResource.Update"); + scope.Start(); + try + { + var response = _onlineExperimentWorkspaceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken); + var operation = new OnlineExperimentationArmOperation(new OnlineExperimentWorkspaceOperationSource(Client), _onlineExperimentWorkspaceClientDiagnostics, Pipeline, _onlineExperimentWorkspaceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data).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.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-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 = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceResource.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 _onlineExperimentWorkspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new OnlineExperimentWorkspaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new OnlineExperimentWorkspaceData(current.Location); + 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.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-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 = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceResource.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 = _onlineExperimentWorkspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new OnlineExperimentWorkspaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new OnlineExperimentWorkspaceData(current.Location); + 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.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-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 = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceResource.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 _onlineExperimentWorkspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new OnlineExperimentWorkspaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new OnlineExperimentWorkspaceData(current.Location); + 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.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-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 = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceResource.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 = _onlineExperimentWorkspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new OnlineExperimentWorkspaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new OnlineExperimentWorkspaceData(current.Location); + 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.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-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 = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceResource.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 _onlineExperimentWorkspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new OnlineExperimentWorkspaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new OnlineExperimentWorkspaceData(current.Location); + 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.OnlineExperimentation/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// OnlineExperimentWorkspace_Get + /// + /// + /// Default Api Version + /// 2025-05-31-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 = _onlineExperimentWorkspaceClientDiagnostics.CreateScope("OnlineExperimentWorkspaceResource.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 = _onlineExperimentWorkspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new OnlineExperimentWorkspaceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new OnlineExperimentWorkspaceData(current.Location); + 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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/ProviderConstants.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..f27b73f85b77 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/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.OnlineExperimentation +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/RestOperations/OnlineExperimentWorkspacesRestOperations.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/RestOperations/OnlineExperimentWorkspacesRestOperations.cs new file mode 100644 index 000000000000..69662412aae9 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Generated/RestOperations/OnlineExperimentWorkspacesRestOperations.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.OnlineExperimentation.Models; + +namespace Azure.ResourceManager.OnlineExperimentation +{ + internal partial class OnlineExperimentWorkspacesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of OnlineExperimentWorkspacesRestOperations. + /// 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 OnlineExperimentWorkspacesRestOperations(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-05-31-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.OnlineExperimentation/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName) + { + 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.OnlineExperimentation/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets an experiment workspace. + /// 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 OnlineExperimentWorkspace. + /// 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 workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OnlineExperimentWorkspaceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OnlineExperimentWorkspaceData.DeserializeOnlineExperimentWorkspaceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((OnlineExperimentWorkspaceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets an experiment workspace. + /// 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 OnlineExperimentWorkspace. + /// 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 workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OnlineExperimentWorkspaceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OnlineExperimentWorkspaceData.DeserializeOnlineExperimentWorkspaceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((OnlineExperimentWorkspaceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, OnlineExperimentWorkspaceData 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.OnlineExperimentation/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, OnlineExperimentWorkspaceData 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.OnlineExperimentation/workspaces/", false); + uri.AppendPath(workspaceName, 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 an experiment workspace, or update an existing workspace. + /// 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 OnlineExperimentWorkspace. + /// 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 workspaceName, OnlineExperimentWorkspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, 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 an experiment workspace, or update an existing workspace. + /// 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 OnlineExperimentWorkspace. + /// 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 workspaceName, OnlineExperimentWorkspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, 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 workspaceName, OnlineExperimentWorkspaceData 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.OnlineExperimentation/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, OnlineExperimentWorkspaceData 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.OnlineExperimentation/workspaces/", false); + uri.AppendPath(workspaceName, 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; + } + + /// Patch an experiment workspace. + /// 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 OnlineExperimentWorkspace. + /// 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 workspaceName, OnlineExperimentWorkspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, workspaceName, 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); + } + } + + /// Patch an experiment workspace. + /// 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 OnlineExperimentWorkspace. + /// 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 workspaceName, OnlineExperimentWorkspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, workspaceName, 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 workspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.OnlineExperimentation/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName) + { + 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.OnlineExperimentation/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an experiment workspace. + /// 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 OnlineExperimentWorkspace. + /// 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 workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName); + 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 an experiment workspace. + /// 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 OnlineExperimentWorkspace. + /// 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 workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName); + _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.OnlineExperimentation/workspaces", 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.OnlineExperimentation/workspaces", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all experiment workspaces 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: + { + OnlineExperimentWorkspaceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OnlineExperimentWorkspaceListResult.DeserializeOnlineExperimentWorkspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all experiment workspaces 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: + { + OnlineExperimentWorkspaceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OnlineExperimentWorkspaceListResult.DeserializeOnlineExperimentWorkspaceListResult(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.OnlineExperimentation/workspaces", 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.OnlineExperimentation/workspaces", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all experiment workspaces in the specified 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: + { + OnlineExperimentWorkspaceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OnlineExperimentWorkspaceListResult.DeserializeOnlineExperimentWorkspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all experiment workspaces in the specified 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: + { + OnlineExperimentWorkspaceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OnlineExperimentWorkspaceListResult.DeserializeOnlineExperimentWorkspaceListResult(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 experiment workspaces 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: + { + OnlineExperimentWorkspaceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OnlineExperimentWorkspaceListResult.DeserializeOnlineExperimentWorkspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all experiment workspaces 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: + { + OnlineExperimentWorkspaceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OnlineExperimentWorkspaceListResult.DeserializeOnlineExperimentWorkspaceListResult(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 experiment workspaces in the specified 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: + { + OnlineExperimentWorkspaceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OnlineExperimentWorkspaceListResult.DeserializeOnlineExperimentWorkspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all experiment workspaces in the specified 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: + { + OnlineExperimentWorkspaceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OnlineExperimentWorkspaceListResult.DeserializeOnlineExperimentWorkspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Properties/AssemblyInfo.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..4aeb666286c8 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/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.OnlineExperimentation.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("OnlineExperimentation")] diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tests/Azure.ResourceManager.OnlineExperimentation.Tests.csproj b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tests/Azure.ResourceManager.OnlineExperimentation.Tests.csproj new file mode 100644 index 000000000000..509ef6525348 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tests/Azure.ResourceManager.OnlineExperimentation.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tests/OnlineExperimentationManagementTestBase.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tests/OnlineExperimentationManagementTestBase.cs new file mode 100644 index 000000000000..fac75bab168d --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tests/OnlineExperimentationManagementTestBase.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.OnlineExperimentation.Tests +{ + public class OnlineExperimentationManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected OnlineExperimentationManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected OnlineExperimentationManagementTestBase(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/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tests/OnlineExperimentationManagementTestEnvironment.cs b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tests/OnlineExperimentationManagementTestEnvironment.cs new file mode 100644 index 000000000000..79cae7dfee21 --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tests/OnlineExperimentationManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.OnlineExperimentation.Tests +{ + public class OnlineExperimentationManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tsp-location.yaml b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tsp-location.yaml new file mode 100644 index 000000000000..e57e3e7c622a --- /dev/null +++ b/sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/onlineexperimentation/OnlineExperimentation.Management +commit: 47fb75e55cbbcaf8d65602ad991885e7dfd49a1e +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/onlineexperimentation/ci.mgmt.yml b/sdk/onlineexperimentation/ci.mgmt.yml new file mode 100644 index 000000000000..0fe2fec93cce --- /dev/null +++ b/sdk/onlineexperimentation/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/onlineexperimentation /ci.mgmt.yml + - sdk/onlineexperimentation /Azure.ResourceManager.OnlineExperimentation / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: onlineexperimentation + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.OnlineExperimentation + safeName: AzureResourceManagerOnlineExperimentation 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/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 1c0fe85cd2f6..bb0363f477c0 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -37,6 +37,7 @@ trigger: - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits - sdk/blueprint/Azure.ResourceManager.Blueprint - sdk/botservice/Azure.ResourceManager.BotService + - sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization - sdk/cdn/Azure.ResourceManager.Cdn - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis - sdk/chaos/Azure.ResourceManager.Chaos @@ -69,6 +70,7 @@ trigger: - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup - sdk/datashare/Azure.ResourceManager.DataShare - sdk/defendereasm/Azure.ResourceManager.DefenderEasm + - sdk/dependencymap/Azure.ResourceManager.DependencyMap - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization - sdk/devcenter/Azure.ResourceManager.DevCenter - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices @@ -147,6 +149,7 @@ trigger: - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability - sdk/nginx/Azure.ResourceManager.Nginx - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs + - sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights - sdk/oracle/Azure.ResourceManager.OracleDatabase @@ -213,6 +216,7 @@ trigger: - sdk/weightsandbiases/Azure.ResourceManager.WeightsAndBiases - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor - sdk/workloads/Azure.ResourceManager.Workloads + - sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances pr: branches: @@ -252,6 +256,7 @@ pr: - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits - sdk/blueprint/Azure.ResourceManager.Blueprint - sdk/botservice/Azure.ResourceManager.BotService + - sdk/carbonoptimization/Azure.ResourceManager.CarbonOptimization - sdk/cdn/Azure.ResourceManager.Cdn - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis - sdk/chaos/Azure.ResourceManager.Chaos @@ -284,6 +289,7 @@ pr: - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup - sdk/datashare/Azure.ResourceManager.DataShare - sdk/defendereasm/Azure.ResourceManager.DefenderEasm + - sdk/dependencymap/Azure.ResourceManager.DependencyMap - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization - sdk/devcenter/Azure.ResourceManager.DevCenter - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices @@ -362,6 +368,7 @@ pr: - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability - sdk/nginx/Azure.ResourceManager.Nginx - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs + - sdk/onlineexperimentation/Azure.ResourceManager.OnlineExperimentation - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights - sdk/oracle/Azure.ResourceManager.OracleDatabase @@ -428,6 +435,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/servicenetworking/Azure.ResourceManager.ServiceNetworking/Configuration.json b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/Configuration.json new file mode 100644 index 000000000000..4a3e558fc260 --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/Configuration.json @@ -0,0 +1,12 @@ +{ + "output-folder": ".", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "library-name": "Azure.ResourceManager.ServiceNetworking", + "flavor": "azure", + "use-model-reader-writer": true, + "shared-source-folders": [ + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Generator.Shared", + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Azure.Core.Shared" + ], + "azure-arm": true +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/tsp-location.yaml b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/tsp-location.yaml index 717c8fce85f2..facc2d2996b6 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/tsp-location.yaml +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/servicenetworking/ServiceNetworking.Management -commit: 488fe8302cc529352bd6544e882773b5cc391f15 +commit: 47fb75e55cbbcaf8d65602ad991885e7dfd49a1e repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/tspCodeModel.json b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/tspCodeModel.json new file mode 100644 index 000000000000..061e6a0df054 --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/tspCodeModel.json @@ -0,0 +1,16451 @@ +{ + "$id": "1", + "name": "Microsoft.ServiceNetworking", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "enums": [ + { + "$id": "2", + "kind": "enum", + "name": "TrafficControllerAssociationType", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationType", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "subnets", + "value": "subnets", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Association of Type Subnet", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.ServiceNetworking", + "doc": "Association Type Enum", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "6", + "kind": "enum", + "name": "ServiceNetworkingProvisioningState", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.ProvisioningState", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "8", + "kind": "enumvalue", + "name": "Provisioning", + "value": "Provisioning", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "doc": "Resource in Provisioning State", + "decorators": [] + }, + { + "$id": "10", + "kind": "enumvalue", + "name": "Updating", + "value": "Updating", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "doc": "Resource in Updating State", + "decorators": [] + }, + { + "$id": "12", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "doc": "Resource in Deleting State", + "decorators": [] + }, + { + "$id": "14", + "kind": "enumvalue", + "name": "Accepted", + "value": "Accepted", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "doc": "Resource in Accepted State", + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "doc": "Resource in Succeeded State", + "decorators": [] + }, + { + "$id": "18", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "doc": "Resource in Failed State", + "decorators": [] + }, + { + "$id": "20", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "doc": "Resource in Canceled State", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.ServiceNetworking", + "doc": "Resource Provisioning State Enum", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "22", + "kind": "enum", + "name": "createdByType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.createdByType", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "24", + "kind": "enumvalue", + "name": "User", + "value": "User", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "The entity was created by a user.", + "decorators": [] + }, + { + "$id": "26", + "kind": "enumvalue", + "name": "Application", + "value": "Application", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "The entity was created by an application.", + "decorators": [] + }, + { + "$id": "28", + "kind": "enumvalue", + "name": "ManagedIdentity", + "value": "ManagedIdentity", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "The entity was created by a managed identity.", + "decorators": [] + }, + { + "$id": "30", + "kind": "enumvalue", + "name": "Key", + "value": "Key", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "The entity was created by a key.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.ServiceNetworking", + "doc": "The kind of entity that created the resource.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "32", + "kind": "enum", + "name": "ResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceProvisioningState", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "34", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "36", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "38", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.ServiceNetworking", + "doc": "The provisioning state of a resource type.", + "isFixed": false, + "isFlags": false, + "usage": "LroPolling", + "decorators": [] + }, + { + "$id": "40", + "kind": "enum", + "name": "ApplicationGatewayForContainersSecurityPolicyType", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.PolicyType", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "42", + "kind": "enumvalue", + "name": "WAF", + "value": "waf", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "doc": "Policy of Type WAF", + "decorators": [] + }, + { + "$id": "44", + "kind": "enumvalue", + "name": "IpAccessRules", + "value": "ipAccessRules", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "doc": "Policy of Type IpAccessRules", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.ServiceNetworking", + "doc": "Policy Type of the Security Policy", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "46", + "kind": "enum", + "name": "IpAccessRuleAction", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.IpAccessRuleAction", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "48", + "kind": "enumvalue", + "name": "Allow", + "value": "allow", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "46" + }, + "doc": "Allow Source Ip Prefixes", + "decorators": [] + }, + { + "$id": "50", + "kind": "enumvalue", + "name": "Deny", + "value": "deny", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "46" + }, + "doc": "Deny Source Ip Prefixes", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.ServiceNetworking", + "doc": "Action of Ip Access Rule", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "52", + "kind": "enum", + "name": "Origin", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Origin", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "54", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Indicates the operation is initiated by a user.", + "decorators": [] + }, + { + "$id": "56", + "kind": "enumvalue", + "name": "system", + "value": "system", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Indicates the operation is initiated by a system.", + "decorators": [] + }, + { + "$id": "58", + "kind": "enumvalue", + "name": "user,system", + "value": "user,system", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Indicates the operation is initiated by a user or system.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.ServiceNetworking", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "60", + "kind": "enum", + "name": "ActionType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ActionType", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "62", + "kind": "enumvalue", + "name": "Internal", + "value": "Internal", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "60" + }, + "doc": "Actions are for internal-only APIs.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.ServiceNetworking", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "64", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.Versions", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "66", + "kind": "enumvalue", + "name": "v2023_11_01", + "value": "2023-11-01", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "64" + }, + "doc": "2023-11-01 stable version", + "decorators": [] + }, + { + "$id": "68", + "kind": "enumvalue", + "name": "v2024_05_01_preview", + "value": "2024-05-01-preview", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "64" + }, + "doc": "2024-05-01 preview version", + "decorators": [] + }, + { + "$id": "70", + "kind": "enumvalue", + "name": "v2025_05_01", + "value": "2025-01-01", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "64" + }, + "doc": "2025-01-01 stable version", + "decorators": [] + }, + { + "$id": "72", + "kind": "enumvalue", + "name": "v2025_03_01_preview", + "value": "2025-03-01-preview", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "64" + }, + "doc": "2025-03-01 preview version", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.ServiceNetworking", + "doc": "Api versions", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "models": [ + { + "$id": "74", + "kind": "model", + "name": "TrafficControllerAssociation", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.Association", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Association Subresource of Traffic Controller", + "decorators": [], + "baseModel": { + "$id": "75", + "kind": "model", + "name": "TrackedResource", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", + "decorators": [], + "baseModel": { + "$id": "76", + "kind": "model", + "name": "Resource", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Common fields that are returned in the response for all Azure Resource Manager resources", + "decorators": [], + "properties": [ + { + "$id": "77", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", + "type": { + "$id": "78", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.id", + "serializationOptions": { + "$id": "79", + "json": { + "$id": "80", + "name": "id" + } + } + }, + { + "$id": "81", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the resource", + "type": { + "$id": "82", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.name", + "serializationOptions": { + "$id": "83", + "json": { + "$id": "84", + "name": "name" + } + } + }, + { + "$id": "85", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"", + "type": { + "$id": "86", + "kind": "string", + "name": "armResourceType", + "crossLanguageDefinitionId": "Azure.Core.armResourceType", + "baseType": { + "$id": "87", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.type", + "serializationOptions": { + "$id": "88", + "json": { + "$id": "89", + "name": "type" + } + } + }, + { + "$id": "90", + "kind": "property", + "name": "systemData", + "serializedName": "systemData", + "doc": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "type": { + "$id": "91", + "kind": "model", + "name": "SystemData", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData", + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Metadata pertaining to creation and last modification of the resource.", + "decorators": [], + "properties": [ + { + "$id": "92", + "kind": "property", + "name": "createdBy", + "serializedName": "createdBy", + "doc": "The identity that created the resource.", + "type": { + "$id": "93", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdBy", + "serializationOptions": { + "$id": "94", + "json": { + "$id": "95", + "name": "createdBy" + } + } + }, + { + "$id": "96", + "kind": "property", + "name": "createdByType", + "serializedName": "createdByType", + "doc": "The type of identity that created the resource.", + "type": { + "$ref": "22" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdByType", + "serializationOptions": { + "$id": "97", + "json": { + "$id": "98", + "name": "createdByType" + } + } + }, + { + "$id": "99", + "kind": "property", + "name": "createdAt", + "serializedName": "createdAt", + "doc": "The timestamp of resource creation (UTC).", + "type": { + "$id": "100", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdAt", + "serializationOptions": { + "$id": "102", + "json": { + "$id": "103", + "name": "createdAt" + } + } + }, + { + "$id": "104", + "kind": "property", + "name": "lastModifiedBy", + "serializedName": "lastModifiedBy", + "doc": "The identity that last modified the resource.", + "type": { + "$id": "105", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedBy", + "serializationOptions": { + "$id": "106", + "json": { + "$id": "107", + "name": "lastModifiedBy" + } + } + }, + { + "$id": "108", + "kind": "property", + "name": "lastModifiedByType", + "serializedName": "lastModifiedByType", + "doc": "The type of identity that last modified the resource.", + "type": { + "$ref": "22" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedByType", + "serializationOptions": { + "$id": "109", + "json": { + "$id": "110", + "name": "lastModifiedByType" + } + } + }, + { + "$id": "111", + "kind": "property", + "name": "lastModifiedAt", + "serializedName": "lastModifiedAt", + "doc": "The timestamp of resource last modification (UTC)", + "type": { + "$id": "112", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "113", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedAt", + "serializationOptions": { + "$id": "114", + "json": { + "$id": "115", + "name": "lastModifiedAt" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.systemData", + "serializationOptions": { + "$id": "116", + "json": { + "$id": "117", + "name": "systemData" + } + } + } + ] + }, + "properties": [ + { + "$id": "118", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "119", + "kind": "dict", + "keyType": { + "$id": "120", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "121", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.tags", + "serializationOptions": { + "$id": "122", + "json": { + "$id": "123", + "name": "tags" + } + } + }, + { + "$id": "124", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The geo-location where the resource lives", + "type": { + "$id": "125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.location", + "serializationOptions": { + "$id": "126", + "json": { + "$id": "127", + "name": "location" + } + } + } + ] + }, + "properties": [ + { + "$id": "128", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "129", + "kind": "model", + "name": "AssociationProperties", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Association Properties.", + "decorators": [], + "properties": [ + { + "$id": "130", + "kind": "property", + "name": "associationType", + "serializedName": "associationType", + "doc": "Association Type", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationProperties.associationType", + "serializationOptions": { + "$id": "131", + "json": { + "$id": "132", + "name": "associationType" + } + } + }, + { + "$id": "133", + "kind": "property", + "name": "subnet", + "serializedName": "subnet", + "doc": "Association Subnet", + "type": { + "$id": "134", + "kind": "model", + "name": "AssociationSubnet", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationSubnet", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Association Subnet.", + "decorators": [], + "properties": [ + { + "$id": "135", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Association ID.", + "type": { + "$id": "136", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationSubnet.id", + "serializationOptions": { + "$id": "137", + "json": { + "$id": "138", + "name": "id" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationProperties.subnet", + "serializationOptions": { + "$id": "139", + "json": { + "$id": "140", + "name": "subnet" + } + } + }, + { + "$id": "141", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Provisioning State of Traffic Controller Association Resource", + "type": { + "$ref": "6" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationProperties.provisioningState", + "serializationOptions": { + "$id": "142", + "json": { + "$id": "143", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.Association.properties", + "serializationOptions": { + "$id": "144", + "json": { + "$id": "145", + "name": "properties" + } + } + }, + { + "$id": "146", + "kind": "path", + "name": "name", + "serializedName": "name", + "doc": "Name of Association", + "type": { + "$id": "147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.Association.name", + "discriminator": false, + "flatten": false + } + ] + }, + { + "$ref": "129" + }, + { + "$ref": "134" + }, + { + "$ref": "75" + }, + { + "$ref": "76" + }, + { + "$ref": "91" + }, + { + "$id": "148", + "kind": "model", + "name": "ErrorResponse", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "usage": "Json,Exception", + "doc": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", + "decorators": [], + "properties": [ + { + "$id": "149", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error object.", + "type": { + "$id": "150", + "kind": "model", + "name": "ErrorDetail", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "usage": "Json,Exception,LroPolling", + "doc": "The error detail.", + "decorators": [], + "properties": [ + { + "$id": "151", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "152", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.code", + "serializationOptions": { + "$id": "153", + "json": { + "$id": "154", + "name": "code" + } + } + }, + { + "$id": "155", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "156", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.message", + "serializationOptions": { + "$id": "157", + "json": { + "$id": "158", + "name": "message" + } + } + }, + { + "$id": "159", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The error target.", + "type": { + "$id": "160", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.target", + "serializationOptions": { + "$id": "161", + "json": { + "$id": "162", + "name": "target" + } + } + }, + { + "$id": "163", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The error details.", + "type": { + "$id": "164", + "kind": "array", + "name": "ArrayErrorDetail", + "valueType": { + "$ref": "150" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details", + "serializationOptions": { + "$id": "165", + "json": { + "$id": "166", + "name": "details" + } + } + }, + { + "$id": "167", + "kind": "property", + "name": "additionalInfo", + "serializedName": "additionalInfo", + "doc": "The error additional info.", + "type": { + "$id": "168", + "kind": "array", + "name": "ArrayErrorAdditionalInfo", + "valueType": { + "$id": "169", + "kind": "model", + "name": "ErrorAdditionalInfo", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "usage": "Json,Exception,LroPolling", + "doc": "The resource management error additional info.", + "decorators": [], + "properties": [ + { + "$id": "170", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The additional info type.", + "type": { + "$id": "171", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.type", + "serializationOptions": { + "$id": "172", + "json": { + "$id": "173", + "name": "type" + } + } + }, + { + "$id": "174", + "kind": "property", + "name": "info", + "serializedName": "info", + "doc": "The additional info.", + "type": { + "$id": "175", + "kind": "model", + "name": "ErrorAdditionalInfoInfo", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info.anonymous", + "usage": "Json,Exception,LroPolling", + "decorators": [], + "properties": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info", + "serializationOptions": { + "$id": "176", + "json": { + "$id": "177", + "name": "info" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo", + "serializationOptions": { + "$id": "178", + "json": { + "$id": "179", + "name": "additionalInfo" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error", + "serializationOptions": { + "$id": "180", + "json": { + "$id": "181", + "name": "error" + } + } + } + ] + }, + { + "$ref": "150" + }, + { + "$ref": "169" + }, + { + "$ref": "175" + }, + { + "$id": "182", + "kind": "model", + "name": "TrafficControllerAssociationUpdate", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationUpdate", + "usage": "Input,Json", + "doc": "The type used for update operations of the Association.", + "decorators": [], + "properties": [ + { + "$id": "183", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "184", + "kind": "dict", + "keyType": { + "$id": "185", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "186", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationUpdate.tags", + "serializationOptions": { + "$id": "187", + "json": { + "$id": "188", + "name": "tags" + } + } + }, + { + "$id": "189", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "190", + "kind": "model", + "name": "AssociationUpdateProperties", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationUpdateProperties", + "usage": "Input,Json", + "doc": "The updatable properties of the Association.", + "decorators": [], + "properties": [ + { + "$id": "191", + "kind": "property", + "name": "associationType", + "serializedName": "associationType", + "doc": "Association Type", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationUpdateProperties.associationType", + "serializationOptions": { + "$id": "192", + "json": { + "$id": "193", + "name": "associationType" + } + } + }, + { + "$id": "194", + "kind": "property", + "name": "subnet", + "serializedName": "subnet", + "doc": "Association Subnet", + "type": { + "$id": "195", + "kind": "model", + "name": "AssociationSubnetUpdate", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationSubnetUpdate", + "usage": "Input,Json", + "doc": "Association Subnet.", + "decorators": [], + "properties": [ + { + "$id": "196", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Association ID.", + "type": { + "$id": "197", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationSubnetUpdate.id", + "serializationOptions": { + "$id": "198", + "json": { + "$id": "199", + "name": "id" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationUpdateProperties.subnet", + "serializationOptions": { + "$id": "200", + "json": { + "$id": "201", + "name": "subnet" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationUpdate.properties", + "serializationOptions": { + "$id": "202", + "json": { + "$id": "203", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "190" + }, + { + "$ref": "195" + }, + { + "$id": "204", + "kind": "model", + "name": "ArmOperationStatusResourceProvisioningState", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus", + "usage": "LroPolling", + "doc": "Standard Azure Resource Manager operation status response", + "decorators": [], + "properties": [ + { + "$id": "205", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The operation status", + "type": { + "$ref": "32" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.status", + "serializationOptions": { + "$id": "206", + "json": { + "$id": "207", + "name": "status" + } + } + }, + { + "$id": "208", + "kind": "path", + "name": "id", + "serializedName": "id", + "doc": "The unique identifier for the operationStatus resource", + "type": { + "$id": "209", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.id", + "discriminator": false, + "flatten": false + }, + { + "$id": "210", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operationStatus resource", + "type": { + "$id": "211", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.name", + "serializationOptions": { + "$id": "212", + "json": { + "$id": "213", + "name": "name" + } + } + }, + { + "$id": "214", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "Operation start time", + "type": { + "$id": "215", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "216", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.startTime", + "serializationOptions": { + "$id": "217", + "json": { + "$id": "218", + "name": "startTime" + } + } + }, + { + "$id": "219", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "Operation complete time", + "type": { + "$id": "220", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.endTime", + "serializationOptions": { + "$id": "222", + "json": { + "$id": "223", + "name": "endTime" + } + } + }, + { + "$id": "224", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "doc": "The progress made toward completing the operation", + "type": { + "$id": "225", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.percentComplete", + "serializationOptions": { + "$id": "226", + "json": { + "$id": "227", + "name": "percentComplete" + } + } + }, + { + "$id": "228", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Errors that occurred if the operation ended with Canceled or Failed status", + "type": { + "$ref": "150" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.error", + "serializationOptions": { + "$id": "229", + "json": { + "$id": "230", + "name": "error" + } + } + } + ] + }, + { + "$id": "231", + "kind": "model", + "name": "AssociationListResult", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a Association list operation.", + "decorators": [], + "properties": [ + { + "$id": "232", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Association items on this page", + "type": { + "$id": "233", + "kind": "array", + "name": "ArrayAssociation", + "valueType": { + "$ref": "74" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "234", + "json": { + "$id": "235", + "name": "value" + } + } + }, + { + "$id": "236", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "237", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "238", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "239", + "json": { + "$id": "240", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "241", + "kind": "model", + "name": "TrafficControllerFrontend", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.Frontend", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Frontend Sub Resource of Traffic Controller.", + "decorators": [], + "baseModel": { + "$ref": "75" + }, + "properties": [ + { + "$id": "242", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "243", + "kind": "model", + "name": "FrontendProperties", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Frontend Properties.", + "decorators": [], + "properties": [ + { + "$id": "244", + "kind": "property", + "name": "fqdn", + "serializedName": "fqdn", + "doc": "The Fully Qualified Domain Name of the DNS record associated to a Traffic Controller frontend.", + "type": { + "$id": "245", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendProperties.fqdn", + "serializationOptions": { + "$id": "246", + "json": { + "$id": "247", + "name": "fqdn" + } + } + }, + { + "$id": "248", + "kind": "property", + "name": "securityPolicyConfigurations", + "serializedName": "securityPolicyConfigurations", + "doc": "Frontend Security Policy Configuration", + "type": { + "$id": "249", + "kind": "model", + "name": "SecurityPolicyConfigurations", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPolicyConfigurations", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "SecurityPolicyConfigurations Subresource of Traffic Controller.", + "decorators": [], + "properties": [ + { + "$id": "250", + "kind": "property", + "name": "wafSecurityPolicy", + "serializedName": "wafSecurityPolicy", + "doc": "Contains reference to a WAF-type security policy.", + "type": { + "$id": "251", + "kind": "model", + "name": "WafSecurityPolicy", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.WafSecurityPolicy", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Web Application Firewall Security Policy", + "decorators": [], + "properties": [ + { + "$id": "252", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Resource ID of the Waf Security Policy", + "type": { + "$id": "253", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.WafSecurityPolicy.id", + "serializationOptions": { + "$id": "254", + "json": { + "$id": "255", + "name": "id" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPolicyConfigurations.wafSecurityPolicy", + "serializationOptions": { + "$id": "256", + "json": { + "$id": "257", + "name": "wafSecurityPolicy" + } + } + }, + { + "$id": "258", + "kind": "property", + "name": "ipAccessRulesSecurityPolicy", + "serializedName": "ipAccessRulesSecurityPolicy", + "doc": "Contains reference to a IpAccessRules-type security policy.", + "type": { + "$id": "259", + "kind": "model", + "name": "IpAccessRulesSecurityPolicy", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.IpAccessRulesSecurityPolicy", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "IpAccessRules Security Policy", + "decorators": [], + "properties": [ + { + "$id": "260", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Resource ID of the Ip Access Rules Security Policy", + "type": { + "$id": "261", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.IpAccessRulesSecurityPolicy.id", + "serializationOptions": { + "$id": "262", + "json": { + "$id": "263", + "name": "id" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPolicyConfigurations.ipAccessRulesSecurityPolicy", + "serializationOptions": { + "$id": "264", + "json": { + "$id": "265", + "name": "ipAccessRulesSecurityPolicy" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendProperties.securityPolicyConfigurations", + "serializationOptions": { + "$id": "266", + "json": { + "$id": "267", + "name": "securityPolicyConfigurations" + } + } + }, + { + "$id": "268", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Provisioning State of Traffic Controller Frontend Resource", + "type": { + "$ref": "6" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendProperties.provisioningState", + "serializationOptions": { + "$id": "269", + "json": { + "$id": "270", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.Frontend.properties", + "serializationOptions": { + "$id": "271", + "json": { + "$id": "272", + "name": "properties" + } + } + }, + { + "$id": "273", + "kind": "path", + "name": "name", + "serializedName": "name", + "doc": "Frontends", + "type": { + "$id": "274", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.Frontend.name", + "discriminator": false, + "flatten": false + } + ] + }, + { + "$ref": "243" + }, + { + "$ref": "249" + }, + { + "$ref": "251" + }, + { + "$ref": "259" + }, + { + "$id": "275", + "kind": "model", + "name": "FrontendUpdate", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "usage": "Input,Json", + "doc": "The type used for update operations of the Frontend.", + "decorators": [], + "properties": [ + { + "$id": "276", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "277", + "kind": "dict", + "keyType": { + "$id": "278", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "279", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.tags", + "serializationOptions": { + "$id": "280", + "json": { + "$id": "281", + "name": "tags" + } + } + }, + { + "$id": "282", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "283", + "kind": "model", + "name": "FrontendUpdateProperties", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "usage": "Input,Json", + "doc": "The updatable properties of the Frontend.", + "decorators": [], + "properties": [ + { + "$id": "284", + "kind": "property", + "name": "securityPolicyConfigurations", + "serializedName": "securityPolicyConfigurations", + "doc": "Frontend Security Policy Configuration", + "type": { + "$ref": "249" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.securityPolicyConfigurations", + "serializationOptions": { + "$id": "285", + "json": { + "$id": "286", + "name": "securityPolicyConfigurations" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.properties", + "serializationOptions": { + "$id": "287", + "json": { + "$id": "288", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "283" + }, + { + "$id": "289", + "kind": "model", + "name": "FrontendListResult", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a Frontend list operation.", + "decorators": [], + "properties": [ + { + "$id": "290", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Frontend items on this page", + "type": { + "$id": "291", + "kind": "array", + "name": "ArrayFrontend", + "valueType": { + "$ref": "241" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "292", + "json": { + "$id": "293", + "name": "value" + } + } + }, + { + "$id": "294", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "295", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "296", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "297", + "json": { + "$id": "298", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "299", + "kind": "model", + "name": "ApplicationGatewayForContainersSecurityPolicy", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPolicy", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "SecurityPolicy Subresource of Traffic Controller.", + "decorators": [], + "baseModel": { + "$ref": "75" + }, + "properties": [ + { + "$id": "300", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "301", + "kind": "model", + "name": "SecurityPolicyProperties", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPolicyProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "SecurityPolicy Properties.", + "decorators": [], + "properties": [ + { + "$id": "302", + "kind": "property", + "name": "policyType", + "serializedName": "policyType", + "doc": "Type of the Traffic Controller Security Policy", + "type": { + "$ref": "40" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPolicyProperties.policyType", + "serializationOptions": { + "$id": "303", + "json": { + "$id": "304", + "name": "policyType" + } + } + }, + { + "$id": "305", + "kind": "property", + "name": "wafPolicy", + "serializedName": "wafPolicy", + "doc": "Web Application Firewall Policy of the Traffic Controller Security Policy. Single Security Policy can have only one policy type set.", + "type": { + "$id": "306", + "kind": "model", + "name": "WafPolicy", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.WafPolicy", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Web Application Firewall Policy", + "decorators": [], + "properties": [ + { + "$id": "307", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Resource ID of the WAF", + "type": { + "$id": "308", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.WafPolicy.id", + "serializationOptions": { + "$id": "309", + "json": { + "$id": "310", + "name": "id" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPolicyProperties.wafPolicy", + "serializationOptions": { + "$id": "311", + "json": { + "$id": "312", + "name": "wafPolicy" + } + } + }, + { + "$id": "313", + "kind": "property", + "name": "ipAccessRulesPolicy", + "serializedName": "ipAccessRulesPolicy", + "doc": "Ip Access Policy of the Traffic Controller Security Policy. Single Security Policy can have only one policy type set.", + "type": { + "$id": "314", + "kind": "model", + "name": "IpAccessRulesPolicy", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.IpAccessRulesPolicy", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Ip Access Policy", + "decorators": [], + "properties": [ + { + "$id": "315", + "kind": "property", + "name": "rules", + "serializedName": "rules", + "doc": "Ip Access Policy Rules List", + "type": { + "$id": "316", + "kind": "array", + "name": "ArrayIpAccessRule", + "valueType": { + "$id": "317", + "kind": "model", + "name": "IpAccessRule", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.IpAccessRule", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Ip Access Policy Rules", + "decorators": [], + "properties": [ + { + "$id": "318", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "Name of the Ip Access Rule", + "type": { + "$id": "319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.IpAccessRule.name", + "serializationOptions": { + "$id": "320", + "json": { + "$id": "321", + "name": "name" + } + } + }, + { + "$id": "322", + "kind": "property", + "name": "priority", + "serializedName": "priority", + "doc": "The priority of the rule. The value can be between 1 and 500. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", + "type": { + "$id": "323", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.IpAccessRule.priority", + "serializationOptions": { + "$id": "324", + "json": { + "$id": "325", + "name": "priority" + } + } + }, + { + "$id": "326", + "kind": "property", + "name": "sourceAddressPrefixes", + "serializedName": "sourceAddressPrefixes", + "doc": "Source Address Prefixed Applied by the Rule. Asterisk '*' can also be used to match all source IPs.", + "type": { + "$id": "327", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "328", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.IpAccessRule.sourceAddressPrefixes", + "serializationOptions": { + "$id": "329", + "json": { + "$id": "330", + "name": "sourceAddressPrefixes" + } + } + }, + { + "$id": "331", + "kind": "property", + "name": "action", + "serializedName": "action", + "doc": "Action of the Rule", + "type": { + "$ref": "46" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.IpAccessRule.action", + "serializationOptions": { + "$id": "332", + "json": { + "$id": "333", + "name": "action" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.IpAccessRulesPolicy.rules", + "serializationOptions": { + "$id": "334", + "json": { + "$id": "335", + "name": "rules" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPolicyProperties.ipAccessRulesPolicy", + "serializationOptions": { + "$id": "336", + "json": { + "$id": "337", + "name": "ipAccessRulesPolicy" + } + } + }, + { + "$id": "338", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Provisioning State of Traffic Controller SecurityPolicy Resource", + "type": { + "$ref": "6" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPolicyProperties.provisioningState", + "serializationOptions": { + "$id": "339", + "json": { + "$id": "340", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPolicy.properties", + "serializationOptions": { + "$id": "341", + "json": { + "$id": "342", + "name": "properties" + } + } + }, + { + "$id": "343", + "kind": "path", + "name": "name", + "serializedName": "name", + "doc": "SecurityPolicy", + "type": { + "$id": "344", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPolicy.name", + "discriminator": false, + "flatten": false + } + ] + }, + { + "$ref": "301" + }, + { + "$ref": "306" + }, + { + "$ref": "314" + }, + { + "$ref": "317" + }, + { + "$id": "345", + "kind": "model", + "name": "SecurityPolicyUpdate", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "usage": "Input,Json", + "doc": "The type used for update operations of the SecurityPolicy.", + "decorators": [], + "properties": [ + { + "$id": "346", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "347", + "kind": "dict", + "keyType": { + "$id": "348", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "349", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.tags", + "serializationOptions": { + "$id": "350", + "json": { + "$id": "351", + "name": "tags" + } + } + }, + { + "$id": "352", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "353", + "kind": "model", + "name": "SecurityPolicyUpdateProperties", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "usage": "Input,Json", + "doc": "The updatable properties of the SecurityPolicy.", + "decorators": [], + "properties": [ + { + "$id": "354", + "kind": "property", + "name": "wafPolicy", + "serializedName": "wafPolicy", + "doc": "Web Application Firewall Policy of the Traffic Controller Security Policy. Single Security Policy can have only one policy type set.", + "type": { + "$ref": "306" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.wafPolicy", + "serializationOptions": { + "$id": "355", + "json": { + "$id": "356", + "name": "wafPolicy" + } + } + }, + { + "$id": "357", + "kind": "property", + "name": "ipAccessRulesPolicy", + "serializedName": "ipAccessRulesPolicy", + "doc": "Ip Access Policy of the Traffic Controller Security Policy. Single Security Policy can have only one policy type set.", + "type": { + "$ref": "314" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.ipAccessRulesPolicy", + "serializationOptions": { + "$id": "358", + "json": { + "$id": "359", + "name": "ipAccessRulesPolicy" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.properties", + "serializationOptions": { + "$id": "360", + "json": { + "$id": "361", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "353" + }, + { + "$id": "362", + "kind": "model", + "name": "SecurityPolicyListResult", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a SecurityPolicy list operation.", + "decorators": [], + "properties": [ + { + "$id": "363", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The SecurityPolicy items on this page", + "type": { + "$id": "364", + "kind": "array", + "name": "ArraySecurityPolicy", + "valueType": { + "$ref": "299" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "365", + "json": { + "$id": "366", + "name": "value" + } + } + }, + { + "$id": "367", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "368", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "369", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "370", + "json": { + "$id": "371", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "372", + "kind": "model", + "name": "TrafficController", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficController", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Concrete tracked resource types can be created by aliasing this type using a specific property type.", + "decorators": [], + "baseModel": { + "$ref": "75" + }, + "properties": [ + { + "$id": "373", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "374", + "kind": "model", + "name": "TrafficControllerProperties", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Traffic Controller Properties.", + "decorators": [], + "properties": [ + { + "$id": "375", + "kind": "property", + "name": "configurationEndpoints", + "serializedName": "configurationEndpoints", + "doc": "Configuration Endpoints.", + "type": { + "$id": "376", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "377", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerProperties.configurationEndpoints", + "serializationOptions": { + "$id": "378", + "json": { + "$id": "379", + "name": "configurationEndpoints" + } + } + }, + { + "$id": "380", + "kind": "property", + "name": "frontends", + "serializedName": "frontends", + "doc": "Frontends References List", + "type": { + "$id": "381", + "kind": "array", + "name": "ArrayResourceId", + "valueType": { + "$id": "382", + "kind": "model", + "name": "ResourceId", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.ResourceId", + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Resource ID definition used by parent to reference child resources.", + "decorators": [], + "properties": [ + { + "$id": "383", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Resource ID of child resource.", + "type": { + "$id": "384", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.ResourceId.id", + "serializationOptions": { + "$id": "385", + "json": { + "$id": "386", + "name": "id" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerProperties.frontends", + "serializationOptions": { + "$id": "387", + "json": { + "$id": "388", + "name": "frontends" + } + } + }, + { + "$id": "389", + "kind": "property", + "name": "associations", + "serializedName": "associations", + "doc": "Associations References List", + "type": { + "$id": "390", + "kind": "array", + "name": "ArrayResourceId", + "valueType": { + "$ref": "382" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerProperties.associations", + "serializationOptions": { + "$id": "391", + "json": { + "$id": "392", + "name": "associations" + } + } + }, + { + "$id": "393", + "kind": "property", + "name": "securityPolicies", + "serializedName": "securityPolicies", + "doc": "Security Policies References List", + "type": { + "$id": "394", + "kind": "array", + "name": "ArrayResourceId", + "valueType": { + "$ref": "382" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerProperties.securityPolicies", + "serializationOptions": { + "$id": "395", + "json": { + "$id": "396", + "name": "securityPolicies" + } + } + }, + { + "$id": "397", + "kind": "property", + "name": "securityPolicyConfigurations", + "serializedName": "securityPolicyConfigurations", + "doc": "Security Policy Configuration", + "type": { + "$ref": "249" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerProperties.securityPolicyConfigurations", + "serializationOptions": { + "$id": "398", + "json": { + "$id": "399", + "name": "securityPolicyConfigurations" + } + } + }, + { + "$id": "400", + "kind": "property", + "name": "TrafficControllerProvisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "6" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerProperties.provisioningState", + "serializationOptions": { + "$id": "401", + "json": { + "$id": "402", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficController.properties", + "serializationOptions": { + "$id": "403", + "json": { + "$id": "404", + "name": "properties" + } + } + }, + { + "$id": "405", + "kind": "path", + "name": "name", + "serializedName": "name", + "doc": "traffic controller name for path", + "type": { + "$id": "406", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficController.name", + "discriminator": false, + "flatten": false + } + ] + }, + { + "$ref": "374" + }, + { + "$ref": "382" + }, + { + "$id": "407", + "kind": "model", + "name": "TrafficControllerUpdate", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "usage": "Input,Json", + "doc": "The type used for update operations of the TrafficController.", + "decorators": [], + "properties": [ + { + "$id": "408", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "409", + "kind": "dict", + "keyType": { + "$id": "410", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "411", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.tags", + "serializationOptions": { + "$id": "412", + "json": { + "$id": "413", + "name": "tags" + } + } + }, + { + "$id": "414", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "415", + "kind": "model", + "name": "TrafficControllerUpdateProperties", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "usage": "Input,Json", + "doc": "The updatable properties of the TrafficController.", + "decorators": [], + "properties": [ + { + "$id": "416", + "kind": "property", + "name": "securityPolicyConfigurations", + "serializedName": "securityPolicyConfigurations", + "doc": "Security Policy Configuration", + "type": { + "$ref": "249" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.securityPolicyConfigurations", + "serializationOptions": { + "$id": "417", + "json": { + "$id": "418", + "name": "securityPolicyConfigurations" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.properties", + "serializationOptions": { + "$id": "419", + "json": { + "$id": "420", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "415" + }, + { + "$id": "421", + "kind": "model", + "name": "TrafficControllerListResult", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a TrafficController list operation.", + "decorators": [], + "properties": [ + { + "$id": "422", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The TrafficController items on this page", + "type": { + "$id": "423", + "kind": "array", + "name": "ArrayTrafficController", + "valueType": { + "$ref": "372" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "424", + "json": { + "$id": "425", + "name": "value" + } + } + }, + { + "$id": "426", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "427", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "428", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "429", + "json": { + "$id": "430", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "431", + "kind": "model", + "name": "OperationListResult", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult", + "usage": "Output,Json", + "doc": "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.", + "decorators": [], + "properties": [ + { + "$id": "432", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Operation items on this page", + "type": { + "$id": "433", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$id": "434", + "kind": "model", + "name": "Operation", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation", + "usage": "Output,Json", + "doc": "Details of a REST API operation, returned from the Resource Provider Operations API", + "decorators": [], + "properties": [ + { + "$id": "435", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\"", + "type": { + "$id": "436", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.name", + "serializationOptions": { + "$id": "437", + "json": { + "$id": "438", + "name": "name" + } + } + }, + { + "$id": "439", + "kind": "property", + "name": "isDataAction", + "serializedName": "isDataAction", + "doc": "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.", + "type": { + "$id": "440", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.isDataAction", + "serializationOptions": { + "$id": "441", + "json": { + "$id": "442", + "name": "isDataAction" + } + } + }, + { + "$id": "443", + "kind": "property", + "name": "display", + "serializedName": "display", + "doc": "Localized display information for this particular operation.", + "type": { + "$id": "444", + "kind": "model", + "name": "OperationDisplay", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "usage": "Output,Json", + "doc": "Localized display information for and operation.", + "decorators": [], + "properties": [ + { + "$id": "445", + "kind": "property", + "name": "provider", + "serializedName": "provider", + "doc": "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\".", + "type": { + "$id": "446", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.provider", + "serializationOptions": { + "$id": "447", + "json": { + "$id": "448", + "name": "provider" + } + } + }, + { + "$id": "449", + "kind": "property", + "name": "resource", + "serializedName": "resource", + "doc": "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\".", + "type": { + "$id": "450", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.resource", + "serializationOptions": { + "$id": "451", + "json": { + "$id": "452", + "name": "resource" + } + } + }, + { + "$id": "453", + "kind": "property", + "name": "operation", + "serializedName": "operation", + "doc": "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\".", + "type": { + "$id": "454", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.operation", + "serializationOptions": { + "$id": "455", + "json": { + "$id": "456", + "name": "operation" + } + } + }, + { + "$id": "457", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + "type": { + "$id": "458", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.description", + "serializationOptions": { + "$id": "459", + "json": { + "$id": "460", + "name": "description" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display", + "serializationOptions": { + "$id": "461", + "json": { + "$id": "462", + "name": "display" + } + } + }, + { + "$id": "463", + "kind": "property", + "name": "origin", + "serializedName": "origin", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "type": { + "$ref": "52" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin", + "serializationOptions": { + "$id": "464", + "json": { + "$id": "465", + "name": "origin" + } + } + }, + { + "$id": "466", + "kind": "property", + "name": "actionType", + "serializedName": "actionType", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "type": { + "$ref": "60" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType", + "serializationOptions": { + "$id": "467", + "json": { + "$id": "468", + "name": "actionType" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.value", + "serializationOptions": { + "$id": "469", + "json": { + "$id": "470", + "name": "value" + } + } + }, + { + "$id": "471", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "472", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "473", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.nextLink", + "serializationOptions": { + "$id": "474", + "json": { + "$id": "475", + "name": "nextLink" + } + } + } + ] + }, + { + "$ref": "434" + }, + { + "$ref": "444" + } + ], + "clients": [ + { + "$id": "476", + "kind": "client", + "name": "ServiceNetworkingClient", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "doc": "Traffic Controller Provider management API.", + "methods": [], + "parameters": [ + { + "$id": "477", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "478", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client", + "defaultValue": { + "$id": "479", + "type": { + "$id": "480", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [ + { + "$id": "481", + "name": "TypeSpec.@service", + "arguments": { + "$id": "482", + "options": { + "$id": "483", + "title": "TrafficController" + } + } + } + ], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "children": [ + { + "$id": "484", + "kind": "client", + "name": "AssociationsInterface", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "methods": [ + { + "$id": "485", + "kind": "basic", + "name": "get", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Get a Association", + "operation": { + "$id": "486", + "name": "get", + "resourceName": "Association", + "doc": "Get a Association", + "accessibility": "public", + "parameters": [ + { + "$id": "487", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "488", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "489", + "type": { + "$id": "490", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "491", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "492", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "493", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "494", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "495", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "496", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "497", + "name": "associationName", + "nameInRequest": "associationName", + "doc": "Name of Association", + "type": { + "$id": "498", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "499", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "500", + "kind": "constant", + "valueType": { + "$id": "501", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "502", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "74" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationsInterface.get", + "decorators": [], + "examples": [ + { + "$id": "503", + "kind": "http", + "name": "Get Association", + "description": "Get Association", + "filePath": "2025-03-01-preview/AssociationGet.json", + "parameters": [ + { + "$id": "504", + "parameter": { + "$ref": "487" + }, + "value": { + "$id": "505", + "kind": "string", + "type": { + "$ref": "488" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "506", + "parameter": { + "$ref": "491" + }, + "value": { + "$id": "507", + "kind": "string", + "type": { + "$ref": "492" + }, + "value": "subid" + } + }, + { + "$id": "508", + "parameter": { + "$ref": "493" + }, + "value": { + "$id": "509", + "kind": "string", + "type": { + "$ref": "494" + }, + "value": "rg1" + } + }, + { + "$id": "510", + "parameter": { + "$ref": "495" + }, + "value": { + "$id": "511", + "kind": "string", + "type": { + "$ref": "496" + }, + "value": "tc1" + } + }, + { + "$id": "512", + "parameter": { + "$ref": "497" + }, + "value": { + "$id": "513", + "kind": "string", + "type": { + "$ref": "498" + }, + "value": "as1" + } + } + ], + "responses": [ + { + "$id": "514", + "response": { + "$ref": "502" + }, + "statusCode": 200, + "bodyValue": { + "$id": "515", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "516", + "name": { + "$id": "517", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "as1" + }, + "type": { + "$id": "518", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/associations" + }, + "id": { + "$id": "519", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/associations/as1" + }, + "location": { + "$id": "520", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "properties": { + "$id": "521", + "kind": "model", + "type": { + "$ref": "129" + }, + "value": { + "$id": "522", + "associationType": { + "$id": "523", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "subnets" + }, + "subnet": { + "$id": "524", + "kind": "model", + "type": { + "$ref": "134" + }, + "value": { + "$id": "525", + "id": { + "$id": "526", + "kind": "string", + "type": { + "$ref": "136" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-tc/subnets/tc-subnet" + } + } + }, + "provisioningState": { + "$id": "527", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "528", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "529", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "530", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "531", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "532", + "name": "associationName", + "nameInRequest": "associationName", + "doc": "Name of Association", + "type": { + "$id": "533", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "534", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "500" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "535", + "type": { + "$ref": "74" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationsInterface.get" + }, + { + "$id": "536", + "kind": "lro", + "name": "createOrUpdate", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Create a Association", + "operation": { + "$id": "537", + "name": "createOrUpdate", + "resourceName": "Association", + "doc": "Create a Association", + "accessibility": "public", + "parameters": [ + { + "$id": "538", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "539", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "540", + "type": { + "$id": "541", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "542", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "543", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "544", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "545", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "546", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "547", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "548", + "name": "associationName", + "nameInRequest": "associationName", + "doc": "Name of Association", + "type": { + "$id": "549", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "550", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "551", + "kind": "constant", + "valueType": { + "$id": "552", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "553", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "554", + "kind": "constant", + "valueType": { + "$id": "555", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "556", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "74" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "557", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "74" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "558", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "74" + }, + "headers": [ + { + "$id": "559", + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "560", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationsInterface.createOrUpdate", + "decorators": [ + { + "$id": "561", + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "$id": "562", + "finalState": "azure-async-operation" + } + } + ], + "examples": [ + { + "$id": "563", + "kind": "http", + "name": "Put Association", + "description": "Put Association", + "filePath": "2025-03-01-preview/AssociationPut.json", + "parameters": [ + { + "$id": "564", + "parameter": { + "$ref": "538" + }, + "value": { + "$id": "565", + "kind": "string", + "type": { + "$ref": "539" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "566", + "parameter": { + "$ref": "542" + }, + "value": { + "$id": "567", + "kind": "string", + "type": { + "$ref": "543" + }, + "value": "subid" + } + }, + { + "$id": "568", + "parameter": { + "$ref": "544" + }, + "value": { + "$id": "569", + "kind": "string", + "type": { + "$ref": "545" + }, + "value": "rg1" + } + }, + { + "$id": "570", + "parameter": { + "$ref": "546" + }, + "value": { + "$id": "571", + "kind": "string", + "type": { + "$ref": "547" + }, + "value": "tc1" + } + }, + { + "$id": "572", + "parameter": { + "$ref": "548" + }, + "value": { + "$id": "573", + "kind": "string", + "type": { + "$ref": "549" + }, + "value": "as1" + } + }, + { + "$id": "574", + "parameter": { + "$ref": "556" + }, + "value": { + "$id": "575", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "576", + "location": { + "$id": "577", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "properties": { + "$id": "578", + "kind": "model", + "type": { + "$ref": "129" + }, + "value": { + "$id": "579", + "associationType": { + "$id": "580", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "subnets" + }, + "subnet": { + "$id": "581", + "kind": "model", + "type": { + "$ref": "134" + }, + "value": { + "$id": "582", + "id": { + "$id": "583", + "kind": "string", + "type": { + "$ref": "136" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-tc/subnets/tc-subnet" + } + } + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "584", + "response": { + "$ref": "557" + }, + "statusCode": 200, + "bodyValue": { + "$id": "585", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "586", + "name": { + "$id": "587", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "associatedvnet-1" + }, + "type": { + "$id": "588", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/associations" + }, + "id": { + "$id": "589", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/associations/as1" + }, + "location": { + "$id": "590", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "properties": { + "$id": "591", + "kind": "model", + "type": { + "$ref": "129" + }, + "value": { + "$id": "592", + "associationType": { + "$id": "593", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "subnets" + }, + "subnet": { + "$id": "594", + "kind": "model", + "type": { + "$ref": "134" + }, + "value": { + "$id": "595", + "id": { + "$id": "596", + "kind": "string", + "type": { + "$ref": "136" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-tc/subnets/tc-subnet" + } + } + }, + "provisioningState": { + "$id": "597", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Accepted" + } + } + } + } + } + }, + { + "$id": "598", + "response": { + "$ref": "558" + }, + "statusCode": 201, + "bodyValue": { + "$id": "599", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "600", + "name": { + "$id": "601", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "associatedvnet-1" + }, + "type": { + "$id": "602", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/associations" + }, + "id": { + "$id": "603", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/associations/as1" + }, + "location": { + "$id": "604", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "properties": { + "$id": "605", + "kind": "model", + "type": { + "$ref": "129" + }, + "value": { + "$id": "606", + "associationType": { + "$id": "607", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "subnets" + }, + "subnet": { + "$id": "608", + "kind": "model", + "type": { + "$ref": "134" + }, + "value": { + "$id": "609", + "id": { + "$id": "610", + "kind": "string", + "type": { + "$ref": "136" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-tc/subnets/tc-subnet" + } + } + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "611", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "612", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "613", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "614", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "615", + "name": "associationName", + "nameInRequest": "associationName", + "doc": "Name of Association", + "type": { + "$id": "616", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "617", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "74" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "618", + "name": "contentType", + "nameInRequest": "contentType", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "619", + "kind": "constant", + "valueType": { + "$id": "620", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "621", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$id": "622", + "kind": "constant", + "valueType": { + "$id": "623", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "624", + "type": { + "$ref": "74" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationsInterface.createOrUpdate", + "lroMetadata": { + "$id": "625", + "finalStateVia": 0, + "finalResponse": { + "$id": "626", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "74" + } + } + } + }, + { + "$id": "627", + "kind": "basic", + "name": "update", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Update a Association", + "operation": { + "$id": "628", + "name": "update", + "resourceName": "Association", + "doc": "Update a Association", + "accessibility": "public", + "parameters": [ + { + "$id": "629", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "630", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "631", + "type": { + "$id": "632", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "633", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "634", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "635", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "636", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "637", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "638", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "639", + "name": "associationName", + "nameInRequest": "associationName", + "doc": "Name of Association", + "type": { + "$id": "640", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "641", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "642", + "kind": "constant", + "valueType": { + "$id": "643", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "644", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "645", + "kind": "constant", + "valueType": { + "$id": "646", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "647", + "name": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "182" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "648", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "74" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PATCH", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": false, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationsInterface.update", + "decorators": [], + "examples": [ + { + "$id": "649", + "kind": "http", + "name": "Update Association", + "description": "Update Association", + "filePath": "2025-03-01-preview/AssociationPatch.json", + "parameters": [ + { + "$id": "650", + "parameter": { + "$ref": "629" + }, + "value": { + "$id": "651", + "kind": "string", + "type": { + "$ref": "630" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "652", + "parameter": { + "$ref": "633" + }, + "value": { + "$id": "653", + "kind": "string", + "type": { + "$ref": "634" + }, + "value": "subid" + } + }, + { + "$id": "654", + "parameter": { + "$ref": "635" + }, + "value": { + "$id": "655", + "kind": "string", + "type": { + "$ref": "636" + }, + "value": "rg1" + } + }, + { + "$id": "656", + "parameter": { + "$ref": "637" + }, + "value": { + "$id": "657", + "kind": "string", + "type": { + "$ref": "638" + }, + "value": "tc1" + } + }, + { + "$id": "658", + "parameter": { + "$ref": "639" + }, + "value": { + "$id": "659", + "kind": "string", + "type": { + "$ref": "640" + }, + "value": "as1" + } + }, + { + "$id": "660", + "parameter": { + "$ref": "647" + }, + "value": { + "$id": "661", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "662", + "properties": { + "$id": "663", + "kind": "model", + "type": { + "$ref": "190" + }, + "value": { + "$id": "664", + "associationType": { + "$id": "665", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "subnets" + }, + "subnet": { + "$id": "666", + "kind": "model", + "type": { + "$ref": "195" + }, + "value": { + "$id": "667", + "id": { + "$id": "668", + "kind": "string", + "type": { + "$ref": "197" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-tc/subnets/tc-subnet" + } + } + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "669", + "response": { + "$ref": "648" + }, + "statusCode": 200, + "bodyValue": { + "$id": "670", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "671", + "name": { + "$id": "672", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "as1" + }, + "type": { + "$id": "673", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/associations" + }, + "id": { + "$id": "674", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/associations/as1" + }, + "location": { + "$id": "675", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "properties": { + "$id": "676", + "kind": "model", + "type": { + "$ref": "129" + }, + "value": { + "$id": "677", + "associationType": { + "$id": "678", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "subnets" + }, + "subnet": { + "$id": "679", + "kind": "model", + "type": { + "$ref": "134" + }, + "value": { + "$id": "680", + "id": { + "$id": "681", + "kind": "string", + "type": { + "$ref": "136" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-tc/subnets/tc-subnet" + } + } + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "682", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "683", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "684", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "685", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "686", + "name": "associationName", + "nameInRequest": "associationName", + "doc": "Name of Association", + "type": { + "$id": "687", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "688", + "name": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "182" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "689", + "name": "contentType", + "nameInRequest": "contentType", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "642" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "690", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "645" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "691", + "type": { + "$ref": "74" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationsInterface.update" + }, + { + "$id": "692", + "kind": "lro", + "name": "delete", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Delete a Association", + "operation": { + "$id": "693", + "name": "delete", + "resourceName": "Association", + "doc": "Delete a Association", + "accessibility": "public", + "parameters": [ + { + "$id": "694", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "695", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "696", + "type": { + "$id": "697", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "698", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "699", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "700", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "701", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "702", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "703", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "704", + "name": "associationName", + "nameInRequest": "associationName", + "doc": "Name of Association", + "type": { + "$id": "705", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "706", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "707", + "kind": "constant", + "valueType": { + "$id": "708", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "709", + "statusCodes": [ + 202 + ], + "headers": [ + { + "$id": "710", + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "711", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "712", + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "713", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "$id": "714", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationsInterface.delete", + "decorators": [], + "examples": [ + { + "$id": "715", + "kind": "http", + "name": "Delete Association", + "description": "Delete Association", + "filePath": "2025-03-01-preview/AssociationDelete.json", + "parameters": [ + { + "$id": "716", + "parameter": { + "$ref": "694" + }, + "value": { + "$id": "717", + "kind": "string", + "type": { + "$ref": "695" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "718", + "parameter": { + "$ref": "698" + }, + "value": { + "$id": "719", + "kind": "string", + "type": { + "$ref": "699" + }, + "value": "subid" + } + }, + { + "$id": "720", + "parameter": { + "$ref": "700" + }, + "value": { + "$id": "721", + "kind": "string", + "type": { + "$ref": "701" + }, + "value": "rg1" + } + }, + { + "$id": "722", + "parameter": { + "$ref": "702" + }, + "value": { + "$id": "723", + "kind": "string", + "type": { + "$ref": "703" + }, + "value": "tc1" + } + }, + { + "$id": "724", + "parameter": { + "$ref": "704" + }, + "value": { + "$id": "725", + "kind": "string", + "type": { + "$ref": "705" + }, + "value": "as1" + } + } + ], + "responses": [ + { + "$id": "726", + "response": { + "$ref": "709" + }, + "statusCode": 202 + }, + { + "$id": "727", + "response": { + "$ref": "714" + }, + "statusCode": 204 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "728", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "729", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "730", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "731", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "732", + "name": "associationName", + "nameInRequest": "associationName", + "doc": "Name of Association", + "type": { + "$id": "733", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "734", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$id": "735", + "kind": "constant", + "valueType": { + "$id": "736", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "737" + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationsInterface.delete", + "lroMetadata": { + "$id": "738", + "finalStateVia": 1, + "finalResponse": { + "$id": "739", + "statusCodes": [ + 204 + ] + } + } + }, + { + "$id": "740", + "kind": "paging", + "name": "listByTrafficController", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "List Association resources by TrafficController", + "operation": { + "$id": "741", + "name": "listByTrafficController", + "resourceName": "Association", + "doc": "List Association resources by TrafficController", + "accessibility": "public", + "parameters": [ + { + "$id": "742", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "743", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "744", + "type": { + "$id": "745", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "746", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "747", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "748", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "749", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "750", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "751", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "752", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "753", + "kind": "constant", + "valueType": { + "$id": "754", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "755", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "231" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationsInterface.listByTrafficController", + "decorators": [], + "examples": [ + { + "$id": "756", + "kind": "http", + "name": "Get Associations", + "description": "Get Associations", + "filePath": "2025-03-01-preview/AssociationsGet.json", + "parameters": [ + { + "$id": "757", + "parameter": { + "$ref": "742" + }, + "value": { + "$id": "758", + "kind": "string", + "type": { + "$ref": "743" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "759", + "parameter": { + "$ref": "746" + }, + "value": { + "$id": "760", + "kind": "string", + "type": { + "$ref": "747" + }, + "value": "subid" + } + }, + { + "$id": "761", + "parameter": { + "$ref": "748" + }, + "value": { + "$id": "762", + "kind": "string", + "type": { + "$ref": "749" + }, + "value": "rg1" + } + }, + { + "$id": "763", + "parameter": { + "$ref": "750" + }, + "value": { + "$id": "764", + "kind": "string", + "type": { + "$ref": "751" + }, + "value": "tc1" + } + } + ], + "responses": [ + { + "$id": "765", + "response": { + "$ref": "755" + }, + "statusCode": 200, + "bodyValue": { + "$id": "766", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "767", + "value": { + "$id": "768", + "kind": "array", + "type": { + "$ref": "233" + }, + "value": [ + { + "$id": "769", + "kind": "model", + "type": { + "$ref": "74" + }, + "value": { + "$id": "770", + "name": { + "$id": "771", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "as1" + }, + "type": { + "$id": "772", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/associations" + }, + "id": { + "$id": "773", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/associations/as1" + }, + "location": { + "$id": "774", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "properties": { + "$id": "775", + "kind": "model", + "type": { + "$ref": "129" + }, + "value": { + "$id": "776", + "associationType": { + "$id": "777", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "subnets" + }, + "subnet": { + "$id": "778", + "kind": "model", + "type": { + "$ref": "134" + }, + "value": { + "$id": "779", + "id": { + "$id": "780", + "kind": "string", + "type": { + "$ref": "136" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-tc/subnets/tc-subnet" + } + } + }, + "provisioningState": { + "$id": "781", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "782", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "783", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "784", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "785", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "786", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "753" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "787", + "type": { + "$id": "788", + "kind": "array", + "name": "ArrayAssociation", + "valueType": { + "$ref": "74" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationsInterface.listByTrafficController", + "pagingMetadata": { + "$id": "789", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "790", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "791", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "792", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client", + "defaultValue": { + "$id": "793", + "type": { + "$id": "794", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [ + { + "$id": "795", + "name": "Azure.ResourceManager.@armResourceOperations", + "arguments": { + "$id": "796" + } + } + ], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.AssociationsInterface", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "parent": { + "$ref": "476" + } + }, + { + "$id": "797", + "kind": "client", + "name": "FrontendsInterface", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "methods": [ + { + "$id": "798", + "kind": "basic", + "name": "get", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Get a Frontend", + "operation": { + "$id": "799", + "name": "get", + "resourceName": "Frontend", + "doc": "Get a Frontend", + "accessibility": "public", + "parameters": [ + { + "$id": "800", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "801", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "802", + "type": { + "$id": "803", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "804", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "805", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "806", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "807", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "808", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "809", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "810", + "name": "frontendName", + "nameInRequest": "frontendName", + "doc": "Frontends", + "type": { + "$id": "811", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "812", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "813", + "kind": "constant", + "valueType": { + "$id": "814", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "815", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "241" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendsInterface.get", + "decorators": [], + "examples": [ + { + "$id": "816", + "kind": "http", + "name": "Get Frontend", + "description": "Get Frontend", + "filePath": "2025-03-01-preview/FrontendGet.json", + "parameters": [ + { + "$id": "817", + "parameter": { + "$ref": "800" + }, + "value": { + "$id": "818", + "kind": "string", + "type": { + "$ref": "801" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "819", + "parameter": { + "$ref": "804" + }, + "value": { + "$id": "820", + "kind": "string", + "type": { + "$ref": "805" + }, + "value": "subid" + } + }, + { + "$id": "821", + "parameter": { + "$ref": "806" + }, + "value": { + "$id": "822", + "kind": "string", + "type": { + "$ref": "807" + }, + "value": "rg1" + } + }, + { + "$id": "823", + "parameter": { + "$ref": "808" + }, + "value": { + "$id": "824", + "kind": "string", + "type": { + "$ref": "809" + }, + "value": "tc1" + } + }, + { + "$id": "825", + "parameter": { + "$ref": "810" + }, + "value": { + "$id": "826", + "kind": "string", + "type": { + "$ref": "811" + }, + "value": "fe1" + } + } + ], + "responses": [ + { + "$id": "827", + "response": { + "$ref": "815" + }, + "statusCode": 200, + "bodyValue": { + "$id": "828", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "829", + "name": { + "$id": "830", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "fe1" + }, + "location": { + "$id": "831", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "type": { + "$id": "832", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/frontends" + }, + "id": { + "$id": "833", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1" + }, + "properties": { + "$id": "834", + "kind": "model", + "type": { + "$ref": "243" + }, + "value": { + "$id": "835", + "fqdn": { + "$id": "836", + "kind": "string", + "type": { + "$ref": "245" + }, + "value": "test.net" + }, + "securityPolicyConfigurations": { + "$id": "837", + "kind": "model", + "type": { + "$ref": "249" + }, + "value": { + "$id": "838", + "ipAccessRulesSecurityPolicy": { + "$id": "839", + "kind": "model", + "type": { + "$ref": "259" + }, + "value": { + "$id": "840", + "id": { + "$id": "841", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/sample-tc/securityPolicies/ipAccessRules-0" + } + } + } + } + }, + "provisioningState": { + "$id": "842", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "843", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "844", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "845", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "846", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "847", + "name": "frontendName", + "nameInRequest": "frontendName", + "doc": "Frontends", + "type": { + "$id": "848", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "849", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "813" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "850", + "type": { + "$ref": "241" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendsInterface.get" + }, + { + "$id": "851", + "kind": "lro", + "name": "createOrUpdate", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Create a Frontend", + "operation": { + "$id": "852", + "name": "createOrUpdate", + "resourceName": "Frontend", + "doc": "Create a Frontend", + "accessibility": "public", + "parameters": [ + { + "$id": "853", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "854", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "855", + "type": { + "$id": "856", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "857", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "858", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "859", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "860", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "861", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "862", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "863", + "name": "frontendName", + "nameInRequest": "frontendName", + "doc": "Frontends", + "type": { + "$id": "864", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "865", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "866", + "kind": "constant", + "valueType": { + "$id": "867", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "868", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "869", + "kind": "constant", + "valueType": { + "$id": "870", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "871", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "241" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "872", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "241" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "873", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "241" + }, + "headers": [ + { + "$id": "874", + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "875", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendsInterface.createOrUpdate", + "decorators": [ + { + "$id": "876", + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "$id": "877", + "finalState": "azure-async-operation" + } + } + ], + "examples": [ + { + "$id": "878", + "kind": "http", + "name": "Put Frontend", + "description": "Put Frontend", + "filePath": "2025-03-01-preview/FrontendPut.json", + "parameters": [ + { + "$id": "879", + "parameter": { + "$ref": "853" + }, + "value": { + "$id": "880", + "kind": "string", + "type": { + "$ref": "854" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "881", + "parameter": { + "$ref": "857" + }, + "value": { + "$id": "882", + "kind": "string", + "type": { + "$ref": "858" + }, + "value": "subid" + } + }, + { + "$id": "883", + "parameter": { + "$ref": "859" + }, + "value": { + "$id": "884", + "kind": "string", + "type": { + "$ref": "860" + }, + "value": "rg1" + } + }, + { + "$id": "885", + "parameter": { + "$ref": "861" + }, + "value": { + "$id": "886", + "kind": "string", + "type": { + "$ref": "862" + }, + "value": "tc1" + } + }, + { + "$id": "887", + "parameter": { + "$ref": "863" + }, + "value": { + "$id": "888", + "kind": "string", + "type": { + "$ref": "864" + }, + "value": "fe1" + } + }, + { + "$id": "889", + "parameter": { + "$ref": "871" + }, + "value": { + "$id": "890", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "891", + "location": { + "$id": "892", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "properties": { + "$id": "893", + "kind": "model", + "type": { + "$ref": "243" + }, + "value": { + "$id": "894" + } + } + } + } + } + ], + "responses": [ + { + "$id": "895", + "response": { + "$ref": "872" + }, + "statusCode": 200, + "bodyValue": { + "$id": "896", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "897", + "name": { + "$id": "898", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "fe1" + }, + "location": { + "$id": "899", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "type": { + "$id": "900", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/frontends" + }, + "id": { + "$id": "901", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1" + }, + "properties": { + "$id": "902", + "kind": "model", + "type": { + "$ref": "243" + }, + "value": { + "$id": "903", + "fqdn": { + "$id": "904", + "kind": "string", + "type": { + "$ref": "245" + }, + "value": "test.net" + }, + "securityPolicyConfigurations": { + "$id": "905", + "kind": "model", + "type": { + "$ref": "249" + }, + "value": { + "$id": "906", + "ipAccessRulesSecurityPolicy": { + "$id": "907", + "kind": "model", + "type": { + "$ref": "259" + }, + "value": { + "$id": "908", + "id": { + "$id": "909", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/sample-tc/securityPolicies/ipAccessRules-0" + } + } + } + } + }, + "provisioningState": { + "$id": "910", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + }, + { + "$id": "911", + "response": { + "$ref": "873" + }, + "statusCode": 201, + "bodyValue": { + "$id": "912", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "913", + "name": { + "$id": "914", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "fe1" + }, + "location": { + "$id": "915", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "type": { + "$id": "916", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/frontends" + }, + "id": { + "$id": "917", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1" + }, + "properties": { + "$id": "918", + "kind": "model", + "type": { + "$ref": "243" + }, + "value": { + "$id": "919", + "fqdn": { + "$id": "920", + "kind": "string", + "type": { + "$ref": "245" + }, + "value": "test.net" + }, + "securityPolicyConfigurations": { + "$id": "921", + "kind": "model", + "type": { + "$ref": "249" + }, + "value": { + "$id": "922", + "ipAccessRulesSecurityPolicy": { + "$id": "923", + "kind": "model", + "type": { + "$ref": "259" + }, + "value": { + "$id": "924", + "id": { + "$id": "925", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/sample-tc/securityPolicies/ipAccessRules-0" + } + } + } + } + }, + "provisioningState": { + "$id": "926", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "927", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "928", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "929", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "930", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "931", + "name": "frontendName", + "nameInRequest": "frontendName", + "doc": "Frontends", + "type": { + "$id": "932", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "933", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "241" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "934", + "name": "contentType", + "nameInRequest": "contentType", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "935", + "kind": "constant", + "valueType": { + "$id": "936", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "937", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$id": "938", + "kind": "constant", + "valueType": { + "$id": "939", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "940", + "type": { + "$ref": "241" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendsInterface.createOrUpdate", + "lroMetadata": { + "$id": "941", + "finalStateVia": 0, + "finalResponse": { + "$id": "942", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "241" + } + } + } + }, + { + "$id": "943", + "kind": "basic", + "name": "update", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Update a Frontend", + "operation": { + "$id": "944", + "name": "update", + "resourceName": "Frontend", + "doc": "Update a Frontend", + "accessibility": "public", + "parameters": [ + { + "$id": "945", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "946", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "947", + "type": { + "$id": "948", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "949", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "950", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "951", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "952", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "953", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "954", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "955", + "name": "frontendName", + "nameInRequest": "frontendName", + "doc": "Frontends", + "type": { + "$id": "956", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "957", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "958", + "kind": "constant", + "valueType": { + "$id": "959", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "960", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "961", + "kind": "constant", + "valueType": { + "$id": "962", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "963", + "name": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "275" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "964", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "241" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PATCH", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": false, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendsInterface.update", + "decorators": [], + "examples": [ + { + "$id": "965", + "kind": "http", + "name": "Update Frontend", + "description": "Update Frontend", + "filePath": "2025-03-01-preview/FrontendPatch.json", + "parameters": [ + { + "$id": "966", + "parameter": { + "$ref": "945" + }, + "value": { + "$id": "967", + "kind": "string", + "type": { + "$ref": "946" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "968", + "parameter": { + "$ref": "949" + }, + "value": { + "$id": "969", + "kind": "string", + "type": { + "$ref": "950" + }, + "value": "subid" + } + }, + { + "$id": "970", + "parameter": { + "$ref": "951" + }, + "value": { + "$id": "971", + "kind": "string", + "type": { + "$ref": "952" + }, + "value": "rg1" + } + }, + { + "$id": "972", + "parameter": { + "$ref": "953" + }, + "value": { + "$id": "973", + "kind": "string", + "type": { + "$ref": "954" + }, + "value": "tc1" + } + }, + { + "$id": "974", + "parameter": { + "$ref": "955" + }, + "value": { + "$id": "975", + "kind": "string", + "type": { + "$ref": "956" + }, + "value": "fe1" + } + }, + { + "$id": "976", + "parameter": { + "$ref": "963" + }, + "value": { + "$id": "977", + "kind": "model", + "type": { + "$ref": "275" + }, + "value": { + "$id": "978" + } + } + } + ], + "responses": [ + { + "$id": "979", + "response": { + "$ref": "964" + }, + "statusCode": 200, + "bodyValue": { + "$id": "980", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "981", + "name": { + "$id": "982", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "fe1" + }, + "location": { + "$id": "983", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "type": { + "$id": "984", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/frontends" + }, + "id": { + "$id": "985", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1" + }, + "properties": { + "$id": "986", + "kind": "model", + "type": { + "$ref": "243" + }, + "value": { + "$id": "987", + "fqdn": { + "$id": "988", + "kind": "string", + "type": { + "$ref": "245" + }, + "value": "test.net" + }, + "securityPolicyConfigurations": { + "$id": "989", + "kind": "model", + "type": { + "$ref": "249" + }, + "value": { + "$id": "990", + "ipAccessRulesSecurityPolicy": { + "$id": "991", + "kind": "model", + "type": { + "$ref": "259" + }, + "value": { + "$id": "992", + "id": { + "$id": "993", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/sample-tc/securityPolicies/ipAccessRules-0" + } + } + } + } + }, + "provisioningState": { + "$id": "994", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "995", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "996", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "997", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "998", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "999", + "name": "frontendName", + "nameInRequest": "frontendName", + "doc": "Frontends", + "type": { + "$id": "1000", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1001", + "name": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "275" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1002", + "name": "contentType", + "nameInRequest": "contentType", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "958" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1003", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "961" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1004", + "type": { + "$ref": "241" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendsInterface.update" + }, + { + "$id": "1005", + "kind": "lro", + "name": "delete", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Delete a Frontend", + "operation": { + "$id": "1006", + "name": "delete", + "resourceName": "Frontend", + "doc": "Delete a Frontend", + "accessibility": "public", + "parameters": [ + { + "$id": "1007", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1008", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1009", + "type": { + "$id": "1010", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1011", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1012", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1013", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1014", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1015", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1016", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1017", + "name": "frontendName", + "nameInRequest": "frontendName", + "doc": "Frontends", + "type": { + "$id": "1018", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1019", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1020", + "kind": "constant", + "valueType": { + "$id": "1021", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1022", + "statusCodes": [ + 202 + ], + "headers": [ + { + "$id": "1023", + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "1024", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1025", + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "1026", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "$id": "1027", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendsInterface.delete", + "decorators": [], + "examples": [ + { + "$id": "1028", + "kind": "http", + "name": "Delete Frontend", + "description": "Delete Frontend", + "filePath": "2025-03-01-preview/FrontendDelete.json", + "parameters": [ + { + "$id": "1029", + "parameter": { + "$ref": "1007" + }, + "value": { + "$id": "1030", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1031", + "parameter": { + "$ref": "1011" + }, + "value": { + "$id": "1032", + "kind": "string", + "type": { + "$ref": "1012" + }, + "value": "subid" + } + }, + { + "$id": "1033", + "parameter": { + "$ref": "1013" + }, + "value": { + "$id": "1034", + "kind": "string", + "type": { + "$ref": "1014" + }, + "value": "rg1" + } + }, + { + "$id": "1035", + "parameter": { + "$ref": "1015" + }, + "value": { + "$id": "1036", + "kind": "string", + "type": { + "$ref": "1016" + }, + "value": "tc1" + } + }, + { + "$id": "1037", + "parameter": { + "$ref": "1017" + }, + "value": { + "$id": "1038", + "kind": "string", + "type": { + "$ref": "1018" + }, + "value": "fe1" + } + } + ], + "responses": [ + { + "$id": "1039", + "response": { + "$ref": "1022" + }, + "statusCode": 202 + }, + { + "$id": "1040", + "response": { + "$ref": "1027" + }, + "statusCode": 204 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1041", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1042", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1043", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1044", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1045", + "name": "frontendName", + "nameInRequest": "frontendName", + "doc": "Frontends", + "type": { + "$id": "1046", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1047", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$id": "1048", + "kind": "constant", + "valueType": { + "$id": "1049", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1050" + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendsInterface.delete", + "lroMetadata": { + "$id": "1051", + "finalStateVia": 1, + "finalResponse": { + "$id": "1052", + "statusCodes": [ + 204 + ] + } + } + }, + { + "$id": "1053", + "kind": "paging", + "name": "listByTrafficController", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "List Frontend resources by TrafficController", + "operation": { + "$id": "1054", + "name": "listByTrafficController", + "resourceName": "Frontend", + "doc": "List Frontend resources by TrafficController", + "accessibility": "public", + "parameters": [ + { + "$id": "1055", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1056", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1057", + "type": { + "$id": "1058", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1059", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1060", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1061", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1062", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1063", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1064", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1065", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1066", + "kind": "constant", + "valueType": { + "$id": "1067", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1068", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "289" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendsInterface.listByTrafficController", + "decorators": [], + "examples": [ + { + "$id": "1069", + "kind": "http", + "name": "Get Frontends", + "description": "Get Frontends", + "filePath": "2025-03-01-preview/FrontendsGet.json", + "parameters": [ + { + "$id": "1070", + "parameter": { + "$ref": "1055" + }, + "value": { + "$id": "1071", + "kind": "string", + "type": { + "$ref": "1056" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1072", + "parameter": { + "$ref": "1059" + }, + "value": { + "$id": "1073", + "kind": "string", + "type": { + "$ref": "1060" + }, + "value": "subid" + } + }, + { + "$id": "1074", + "parameter": { + "$ref": "1061" + }, + "value": { + "$id": "1075", + "kind": "string", + "type": { + "$ref": "1062" + }, + "value": "rg1" + } + }, + { + "$id": "1076", + "parameter": { + "$ref": "1063" + }, + "value": { + "$id": "1077", + "kind": "string", + "type": { + "$ref": "1064" + }, + "value": "tc1" + } + } + ], + "responses": [ + { + "$id": "1078", + "response": { + "$ref": "1068" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1079", + "kind": "model", + "type": { + "$ref": "289" + }, + "value": { + "$id": "1080", + "value": { + "$id": "1081", + "kind": "array", + "type": { + "$ref": "291" + }, + "value": [ + { + "$id": "1082", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "1083", + "name": { + "$id": "1084", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "fe1" + }, + "location": { + "$id": "1085", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "type": { + "$id": "1086", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/frontends" + }, + "id": { + "$id": "1087", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1" + }, + "properties": { + "$id": "1088", + "kind": "model", + "type": { + "$ref": "243" + }, + "value": { + "$id": "1089", + "fqdn": { + "$id": "1090", + "kind": "string", + "type": { + "$ref": "245" + }, + "value": "test.net" + }, + "securityPolicyConfigurations": { + "$id": "1091", + "kind": "model", + "type": { + "$ref": "249" + }, + "value": { + "$id": "1092", + "ipAccessRulesSecurityPolicy": { + "$id": "1093", + "kind": "model", + "type": { + "$ref": "259" + }, + "value": { + "$id": "1094", + "id": { + "$id": "1095", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/sample-tc/securityPolicies/ipAccessRules-0" + } + } + } + } + }, + "provisioningState": { + "$id": "1096", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1097", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1098", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1099", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1100", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1101", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1066" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1102", + "type": { + "$id": "1103", + "kind": "array", + "name": "ArrayFrontend", + "valueType": { + "$ref": "241" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendsInterface.listByTrafficController", + "pagingMetadata": { + "$id": "1104", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1105", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "1106", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "1107", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client", + "defaultValue": { + "$id": "1108", + "type": { + "$id": "1109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [ + { + "$id": "1110", + "name": "Azure.ResourceManager.@armResourceOperations", + "arguments": { + "$id": "1111" + } + } + ], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.FrontendsInterface", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "parent": { + "$ref": "476" + } + }, + { + "$id": "1112", + "kind": "client", + "name": "SecurityPoliciesInterface", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "methods": [ + { + "$id": "1113", + "kind": "basic", + "name": "get", + "accessibility": "public", + "apiVersions": [ + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Get a SecurityPolicy", + "operation": { + "$id": "1114", + "name": "get", + "resourceName": "SecurityPolicy", + "doc": "Get a SecurityPolicy", + "accessibility": "public", + "parameters": [ + { + "$id": "1115", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1116", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1117", + "type": { + "$id": "1118", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1119", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1120", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1121", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1122", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1123", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1124", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1125", + "name": "securityPolicyName", + "nameInRequest": "securityPolicyName", + "doc": "SecurityPolicy", + "type": { + "$id": "1126", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1127", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1128", + "kind": "constant", + "valueType": { + "$id": "1129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1130", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "299" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.get", + "decorators": [], + "examples": [ + { + "$id": "1131", + "kind": "http", + "name": "Get SecurityPolicy", + "description": "Get SecurityPolicy", + "filePath": "2025-03-01-preview/SecurityPolicyGet.json", + "parameters": [ + { + "$id": "1132", + "parameter": { + "$ref": "1115" + }, + "value": { + "$id": "1133", + "kind": "string", + "type": { + "$ref": "1116" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1134", + "parameter": { + "$ref": "1119" + }, + "value": { + "$id": "1135", + "kind": "string", + "type": { + "$ref": "1120" + }, + "value": "subid" + } + }, + { + "$id": "1136", + "parameter": { + "$ref": "1121" + }, + "value": { + "$id": "1137", + "kind": "string", + "type": { + "$ref": "1122" + }, + "value": "rg1" + } + }, + { + "$id": "1138", + "parameter": { + "$ref": "1123" + }, + "value": { + "$id": "1139", + "kind": "string", + "type": { + "$ref": "1124" + }, + "value": "tc1" + } + }, + { + "$id": "1140", + "parameter": { + "$ref": "1125" + }, + "value": { + "$id": "1141", + "kind": "string", + "type": { + "$ref": "1126" + }, + "value": "sp1" + } + } + ], + "responses": [ + { + "$id": "1142", + "response": { + "$ref": "1130" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1143", + "kind": "model", + "type": { + "$ref": "299" + }, + "value": { + "$id": "1144", + "name": { + "$id": "1145", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "waf-0" + }, + "type": { + "$id": "1146", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/securityPolicies" + }, + "id": { + "$id": "1147", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/sample-tc/securityPolicies/waf-0" + }, + "location": { + "$id": "1148", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "eastus" + }, + "properties": { + "$id": "1149", + "kind": "model", + "type": { + "$ref": "301" + }, + "value": { + "$id": "1150", + "policyType": { + "$id": "1151", + "kind": "string", + "type": { + "$ref": "40" + }, + "value": "waf" + }, + "wafPolicy": { + "$id": "1152", + "kind": "model", + "type": { + "$ref": "306" + }, + "value": { + "$id": "1153", + "id": { + "$id": "1154", + "kind": "string", + "type": { + "$ref": "308" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Networking/applicationGatewayWebApplicationFirewallPolicies/wp-0" + } + } + }, + "provisioningState": { + "$id": "1155", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1156", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1157", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1158", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1159", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1160", + "name": "securityPolicyName", + "nameInRequest": "securityPolicyName", + "doc": "SecurityPolicy", + "type": { + "$id": "1161", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1162", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1128" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1163", + "type": { + "$ref": "299" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.get" + }, + { + "$id": "1164", + "kind": "lro", + "name": "createOrUpdate", + "accessibility": "public", + "apiVersions": [ + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Create a SecurityPolicy", + "operation": { + "$id": "1165", + "name": "createOrUpdate", + "resourceName": "SecurityPolicy", + "doc": "Create a SecurityPolicy", + "accessibility": "public", + "parameters": [ + { + "$id": "1166", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1167", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1168", + "type": { + "$id": "1169", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1170", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1171", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1172", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1173", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1174", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1176", + "name": "securityPolicyName", + "nameInRequest": "securityPolicyName", + "doc": "SecurityPolicy", + "type": { + "$id": "1177", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1178", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "1179", + "kind": "constant", + "valueType": { + "$id": "1180", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1181", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1182", + "kind": "constant", + "valueType": { + "$id": "1183", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1184", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "299" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1185", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "299" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "1186", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "299" + }, + "headers": [ + { + "$id": "1187", + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "1188", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.createOrUpdate", + "decorators": [ + { + "$id": "1189", + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "$id": "1190", + "finalState": "azure-async-operation" + } + } + ], + "examples": [ + { + "$id": "1191", + "kind": "http", + "name": "Put IpAccessRules SecurityPolicy", + "description": "Put IpAccessRules SecurityPolicy", + "filePath": "2025-03-01-preview/IpAccessRulesSecurityPolicyPut.json", + "parameters": [ + { + "$id": "1192", + "parameter": { + "$ref": "1166" + }, + "value": { + "$id": "1193", + "kind": "string", + "type": { + "$ref": "1167" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1194", + "parameter": { + "$ref": "1170" + }, + "value": { + "$id": "1195", + "kind": "string", + "type": { + "$ref": "1171" + }, + "value": "subid" + } + }, + { + "$id": "1196", + "parameter": { + "$ref": "1172" + }, + "value": { + "$id": "1197", + "kind": "string", + "type": { + "$ref": "1173" + }, + "value": "rg1" + } + }, + { + "$id": "1198", + "parameter": { + "$ref": "1174" + }, + "value": { + "$id": "1199", + "kind": "string", + "type": { + "$ref": "1175" + }, + "value": "tc1" + } + }, + { + "$id": "1200", + "parameter": { + "$ref": "1176" + }, + "value": { + "$id": "1201", + "kind": "string", + "type": { + "$ref": "1177" + }, + "value": "sp1" + } + }, + { + "$id": "1202", + "parameter": { + "$ref": "1184" + }, + "value": { + "$id": "1203", + "kind": "model", + "type": { + "$ref": "299" + }, + "value": { + "$id": "1204", + "location": { + "$id": "1205", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "properties": { + "$id": "1206", + "kind": "model", + "type": { + "$ref": "301" + }, + "value": { + "$id": "1207", + "ipAccessRulesPolicy": { + "$id": "1208", + "kind": "model", + "type": { + "$ref": "314" + }, + "value": { + "$id": "1209", + "rules": { + "$id": "1210", + "kind": "array", + "type": { + "$ref": "316" + }, + "value": [] + } + } + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "1211", + "response": { + "$ref": "1185" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1212", + "kind": "model", + "type": { + "$ref": "299" + }, + "value": { + "$id": "1213", + "name": { + "$id": "1214", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "ipAccessRules-0" + }, + "type": { + "$id": "1215", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/securityPolicies" + }, + "id": { + "$id": "1216", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/sample-tc/securityPolicies/ipAccessRules-0" + }, + "location": { + "$id": "1217", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "eastus" + }, + "properties": { + "$id": "1218", + "kind": "model", + "type": { + "$ref": "301" + }, + "value": { + "$id": "1219", + "policyType": { + "$id": "1220", + "kind": "string", + "type": { + "$ref": "40" + }, + "value": "ipAccessRules" + }, + "ipAccessRulesPolicy": { + "$id": "1221", + "kind": "model", + "type": { + "$ref": "314" + }, + "value": { + "$id": "1222", + "rules": { + "$id": "1223", + "kind": "array", + "type": { + "$ref": "316" + }, + "value": [] + } + } + }, + "provisioningState": { + "$id": "1224", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + }, + { + "$id": "1225", + "response": { + "$ref": "1186" + }, + "statusCode": 201, + "bodyValue": { + "$id": "1226", + "kind": "model", + "type": { + "$ref": "299" + }, + "value": { + "$id": "1227", + "name": { + "$id": "1228", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "ipAccessRules-0" + }, + "type": { + "$id": "1229", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/securityPolicies" + }, + "id": { + "$id": "1230", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/sample-tc/securityPolicies/ipAccessRules-0" + }, + "location": { + "$id": "1231", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "eastus" + }, + "properties": { + "$id": "1232", + "kind": "model", + "type": { + "$ref": "301" + }, + "value": { + "$id": "1233", + "policyType": { + "$id": "1234", + "kind": "string", + "type": { + "$ref": "40" + }, + "value": "ipAccessRules" + }, + "ipAccessRulesPolicy": { + "$id": "1235", + "kind": "model", + "type": { + "$ref": "314" + }, + "value": { + "$id": "1236", + "rules": { + "$id": "1237", + "kind": "array", + "type": { + "$ref": "316" + }, + "value": [] + } + } + }, + "provisioningState": { + "$id": "1238", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + }, + { + "$id": "1239", + "kind": "http", + "name": "Put WAF SecurityPolicy", + "description": "Put WAF SecurityPolicy", + "filePath": "2025-03-01-preview/WafSecurityPolicyPut.json", + "parameters": [ + { + "$id": "1240", + "parameter": { + "$ref": "1166" + }, + "value": { + "$id": "1241", + "kind": "string", + "type": { + "$ref": "1167" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1242", + "parameter": { + "$ref": "1170" + }, + "value": { + "$id": "1243", + "kind": "string", + "type": { + "$ref": "1171" + }, + "value": "subid" + } + }, + { + "$id": "1244", + "parameter": { + "$ref": "1172" + }, + "value": { + "$id": "1245", + "kind": "string", + "type": { + "$ref": "1173" + }, + "value": "rg1" + } + }, + { + "$id": "1246", + "parameter": { + "$ref": "1174" + }, + "value": { + "$id": "1247", + "kind": "string", + "type": { + "$ref": "1175" + }, + "value": "tc1" + } + }, + { + "$id": "1248", + "parameter": { + "$ref": "1176" + }, + "value": { + "$id": "1249", + "kind": "string", + "type": { + "$ref": "1177" + }, + "value": "sp1" + } + }, + { + "$id": "1250", + "parameter": { + "$ref": "1184" + }, + "value": { + "$id": "1251", + "kind": "model", + "type": { + "$ref": "299" + }, + "value": { + "$id": "1252", + "location": { + "$id": "1253", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "properties": { + "$id": "1254", + "kind": "model", + "type": { + "$ref": "301" + }, + "value": { + "$id": "1255", + "wafPolicy": { + "$id": "1256", + "kind": "model", + "type": { + "$ref": "306" + }, + "value": { + "$id": "1257", + "id": { + "$id": "1258", + "kind": "string", + "type": { + "$ref": "308" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Networking/applicationGatewayWebApplicationFirewallPolicies/wp-0" + } + } + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "1259", + "response": { + "$ref": "1185" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1260", + "kind": "model", + "type": { + "$ref": "299" + }, + "value": { + "$id": "1261", + "name": { + "$id": "1262", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "waf-0" + }, + "type": { + "$id": "1263", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/securityPolicies" + }, + "id": { + "$id": "1264", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/sample-tc/securityPolicies/waf-0" + }, + "location": { + "$id": "1265", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "eastus" + }, + "properties": { + "$id": "1266", + "kind": "model", + "type": { + "$ref": "301" + }, + "value": { + "$id": "1267", + "policyType": { + "$id": "1268", + "kind": "string", + "type": { + "$ref": "40" + }, + "value": "waf" + }, + "wafPolicy": { + "$id": "1269", + "kind": "model", + "type": { + "$ref": "306" + }, + "value": { + "$id": "1270", + "id": { + "$id": "1271", + "kind": "string", + "type": { + "$ref": "308" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Networking/applicationGatewayWebApplicationFirewallPolicies/wp-0" + } + } + }, + "provisioningState": { + "$id": "1272", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + }, + { + "$id": "1273", + "response": { + "$ref": "1186" + }, + "statusCode": 201, + "bodyValue": { + "$id": "1274", + "kind": "model", + "type": { + "$ref": "299" + }, + "value": { + "$id": "1275", + "name": { + "$id": "1276", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "waf-0" + }, + "type": { + "$id": "1277", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/securityPolicies" + }, + "id": { + "$id": "1278", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/sample-tc/securityPolicies/waf-0" + }, + "location": { + "$id": "1279", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "eastus" + }, + "properties": { + "$id": "1280", + "kind": "model", + "type": { + "$ref": "301" + }, + "value": { + "$id": "1281", + "policyType": { + "$id": "1282", + "kind": "string", + "type": { + "$ref": "40" + }, + "value": "waf" + }, + "wafPolicy": { + "$id": "1283", + "kind": "model", + "type": { + "$ref": "306" + }, + "value": { + "$id": "1284", + "id": { + "$id": "1285", + "kind": "string", + "type": { + "$ref": "308" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Networking/applicationGatewayWebApplicationFirewallPolicies/wp-0" + } + } + }, + "provisioningState": { + "$id": "1286", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1287", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1288", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1289", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1290", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1291", + "name": "securityPolicyName", + "nameInRequest": "securityPolicyName", + "doc": "SecurityPolicy", + "type": { + "$id": "1292", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1293", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "299" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1294", + "name": "contentType", + "nameInRequest": "contentType", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "1295", + "kind": "constant", + "valueType": { + "$id": "1296", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1297", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$id": "1298", + "kind": "constant", + "valueType": { + "$id": "1299", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1300", + "type": { + "$ref": "299" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.createOrUpdate", + "lroMetadata": { + "$id": "1301", + "finalStateVia": 0, + "finalResponse": { + "$id": "1302", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "299" + } + } + } + }, + { + "$id": "1303", + "kind": "basic", + "name": "update", + "accessibility": "public", + "apiVersions": [ + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Update a SecurityPolicy", + "operation": { + "$id": "1304", + "name": "update", + "resourceName": "SecurityPolicy", + "doc": "Update a SecurityPolicy", + "accessibility": "public", + "parameters": [ + { + "$id": "1305", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1306", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1307", + "type": { + "$id": "1308", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1309", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1310", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1311", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1312", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1313", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1314", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1315", + "name": "securityPolicyName", + "nameInRequest": "securityPolicyName", + "doc": "SecurityPolicy", + "type": { + "$id": "1316", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1317", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "1318", + "kind": "constant", + "valueType": { + "$id": "1319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1320", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1321", + "kind": "constant", + "valueType": { + "$id": "1322", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1323", + "name": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "345" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1324", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "299" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PATCH", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": false, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.update", + "decorators": [], + "examples": [ + { + "$id": "1325", + "kind": "http", + "name": "Update IpAccessRules SecurityPolicy", + "description": "Update IpAccessRules SecurityPolicy", + "filePath": "2025-03-01-preview/IpAccessRulesSecurityPolicyPatch.json", + "parameters": [ + { + "$id": "1326", + "parameter": { + "$ref": "1305" + }, + "value": { + "$id": "1327", + "kind": "string", + "type": { + "$ref": "1306" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1328", + "parameter": { + "$ref": "1309" + }, + "value": { + "$id": "1329", + "kind": "string", + "type": { + "$ref": "1310" + }, + "value": "subid" + } + }, + { + "$id": "1330", + "parameter": { + "$ref": "1311" + }, + "value": { + "$id": "1331", + "kind": "string", + "type": { + "$ref": "1312" + }, + "value": "rg1" + } + }, + { + "$id": "1332", + "parameter": { + "$ref": "1313" + }, + "value": { + "$id": "1333", + "kind": "string", + "type": { + "$ref": "1314" + }, + "value": "tc1" + } + }, + { + "$id": "1334", + "parameter": { + "$ref": "1315" + }, + "value": { + "$id": "1335", + "kind": "string", + "type": { + "$ref": "1316" + }, + "value": "sp1" + } + }, + { + "$id": "1336", + "parameter": { + "$ref": "1323" + }, + "value": { + "$id": "1337", + "kind": "model", + "type": { + "$ref": "345" + }, + "value": { + "$id": "1338", + "properties": { + "$id": "1339", + "kind": "model", + "type": { + "$ref": "353" + }, + "value": { + "$id": "1340", + "ipAccessRulesPolicy": { + "$id": "1341", + "kind": "model", + "type": { + "$ref": "314" + }, + "value": { + "$id": "1342", + "rules": { + "$id": "1343", + "kind": "array", + "type": { + "$ref": "316" + }, + "value": [] + } + } + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "1344", + "response": { + "$ref": "1324" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1345", + "kind": "model", + "type": { + "$ref": "299" + }, + "value": { + "$id": "1346", + "name": { + "$id": "1347", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "ipAccessRules-0" + }, + "type": { + "$id": "1348", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/securityPolicies" + }, + "id": { + "$id": "1349", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/sample-tc/securityPolicies/ipAccessRules-0" + }, + "location": { + "$id": "1350", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "eastus" + }, + "properties": { + "$id": "1351", + "kind": "model", + "type": { + "$ref": "301" + }, + "value": { + "$id": "1352", + "policyType": { + "$id": "1353", + "kind": "string", + "type": { + "$ref": "40" + }, + "value": "ipAccessRules" + }, + "ipAccessRulesPolicy": { + "$id": "1354", + "kind": "model", + "type": { + "$ref": "314" + }, + "value": { + "$id": "1355", + "rules": { + "$id": "1356", + "kind": "array", + "type": { + "$ref": "316" + }, + "value": [] + } + } + }, + "provisioningState": { + "$id": "1357", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + }, + { + "$id": "1358", + "kind": "http", + "name": "Update WAF SecurityPolicy", + "description": "Update WAF SecurityPolicy", + "filePath": "2025-03-01-preview/WafSecurityPolicyPatch.json", + "parameters": [ + { + "$id": "1359", + "parameter": { + "$ref": "1305" + }, + "value": { + "$id": "1360", + "kind": "string", + "type": { + "$ref": "1306" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1361", + "parameter": { + "$ref": "1309" + }, + "value": { + "$id": "1362", + "kind": "string", + "type": { + "$ref": "1310" + }, + "value": "subid" + } + }, + { + "$id": "1363", + "parameter": { + "$ref": "1311" + }, + "value": { + "$id": "1364", + "kind": "string", + "type": { + "$ref": "1312" + }, + "value": "rg1" + } + }, + { + "$id": "1365", + "parameter": { + "$ref": "1313" + }, + "value": { + "$id": "1366", + "kind": "string", + "type": { + "$ref": "1314" + }, + "value": "tc1" + } + }, + { + "$id": "1367", + "parameter": { + "$ref": "1315" + }, + "value": { + "$id": "1368", + "kind": "string", + "type": { + "$ref": "1316" + }, + "value": "sp1" + } + }, + { + "$id": "1369", + "parameter": { + "$ref": "1323" + }, + "value": { + "$id": "1370", + "kind": "model", + "type": { + "$ref": "345" + }, + "value": { + "$id": "1371", + "properties": { + "$id": "1372", + "kind": "model", + "type": { + "$ref": "353" + }, + "value": { + "$id": "1373", + "wafPolicy": { + "$id": "1374", + "kind": "model", + "type": { + "$ref": "306" + }, + "value": { + "$id": "1375", + "id": { + "$id": "1376", + "kind": "string", + "type": { + "$ref": "308" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Networking/applicationGatewayWebApplicationFirewallPolicies/wp-0" + } + } + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "1377", + "response": { + "$ref": "1324" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1378", + "kind": "model", + "type": { + "$ref": "299" + }, + "value": { + "$id": "1379", + "name": { + "$id": "1380", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "waf-0" + }, + "type": { + "$id": "1381", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/securityPolicies" + }, + "id": { + "$id": "1382", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/sample-tc/securityPolicies/waf-0" + }, + "location": { + "$id": "1383", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "eastus" + }, + "properties": { + "$id": "1384", + "kind": "model", + "type": { + "$ref": "301" + }, + "value": { + "$id": "1385", + "policyType": { + "$id": "1386", + "kind": "string", + "type": { + "$ref": "40" + }, + "value": "waf" + }, + "wafPolicy": { + "$id": "1387", + "kind": "model", + "type": { + "$ref": "306" + }, + "value": { + "$id": "1388", + "id": { + "$id": "1389", + "kind": "string", + "type": { + "$ref": "308" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Networking/applicationGatewayWebApplicationFirewallPolicies/wp-0" + } + } + }, + "provisioningState": { + "$id": "1390", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1391", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1392", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1393", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1394", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1395", + "name": "securityPolicyName", + "nameInRequest": "securityPolicyName", + "doc": "SecurityPolicy", + "type": { + "$id": "1396", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1397", + "name": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "345" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1398", + "name": "contentType", + "nameInRequest": "contentType", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "1318" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1399", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1321" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1400", + "type": { + "$ref": "299" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.update" + }, + { + "$id": "1401", + "kind": "lro", + "name": "delete", + "accessibility": "public", + "apiVersions": [ + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Delete a SecurityPolicy", + "operation": { + "$id": "1402", + "name": "delete", + "resourceName": "SecurityPolicy", + "doc": "Delete a SecurityPolicy", + "accessibility": "public", + "parameters": [ + { + "$id": "1403", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1404", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1405", + "type": { + "$id": "1406", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1407", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1408", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1409", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1410", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1411", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1412", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1413", + "name": "securityPolicyName", + "nameInRequest": "securityPolicyName", + "doc": "SecurityPolicy", + "type": { + "$id": "1414", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1415", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1416", + "kind": "constant", + "valueType": { + "$id": "1417", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1418", + "statusCodes": [ + 202 + ], + "headers": [ + { + "$id": "1419", + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "1420", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1421", + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "1422", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "$id": "1423", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.delete", + "decorators": [], + "examples": [ + { + "$id": "1424", + "kind": "http", + "name": "Delete SecurityPolicy", + "description": "Delete SecurityPolicy", + "filePath": "2025-03-01-preview/SecurityPolicyDelete.json", + "parameters": [ + { + "$id": "1425", + "parameter": { + "$ref": "1403" + }, + "value": { + "$id": "1426", + "kind": "string", + "type": { + "$ref": "1404" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1427", + "parameter": { + "$ref": "1407" + }, + "value": { + "$id": "1428", + "kind": "string", + "type": { + "$ref": "1408" + }, + "value": "subid" + } + }, + { + "$id": "1429", + "parameter": { + "$ref": "1409" + }, + "value": { + "$id": "1430", + "kind": "string", + "type": { + "$ref": "1410" + }, + "value": "rg1" + } + }, + { + "$id": "1431", + "parameter": { + "$ref": "1411" + }, + "value": { + "$id": "1432", + "kind": "string", + "type": { + "$ref": "1412" + }, + "value": "tc1" + } + }, + { + "$id": "1433", + "parameter": { + "$ref": "1413" + }, + "value": { + "$id": "1434", + "kind": "string", + "type": { + "$ref": "1414" + }, + "value": "sp1" + } + } + ], + "responses": [ + { + "$id": "1435", + "response": { + "$ref": "1418" + }, + "statusCode": 202 + }, + { + "$id": "1436", + "response": { + "$ref": "1423" + }, + "statusCode": 204 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1437", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1438", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1439", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1440", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1441", + "name": "securityPolicyName", + "nameInRequest": "securityPolicyName", + "doc": "SecurityPolicy", + "type": { + "$id": "1442", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1443", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$id": "1444", + "kind": "constant", + "valueType": { + "$id": "1445", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1446" + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.delete", + "lroMetadata": { + "$id": "1447", + "finalStateVia": 1, + "finalResponse": { + "$id": "1448", + "statusCodes": [ + 204 + ] + } + } + }, + { + "$id": "1449", + "kind": "paging", + "name": "listByTrafficController", + "accessibility": "public", + "apiVersions": [ + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "List SecurityPolicy resources by TrafficController", + "operation": { + "$id": "1450", + "name": "listByTrafficController", + "resourceName": "SecurityPolicy", + "doc": "List SecurityPolicy resources by TrafficController", + "accessibility": "public", + "parameters": [ + { + "$id": "1451", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1452", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1453", + "type": { + "$id": "1454", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1455", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1456", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1457", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1458", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1459", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1460", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1461", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1462", + "kind": "constant", + "valueType": { + "$id": "1463", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1464", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "362" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.listByTrafficController", + "decorators": [], + "examples": [ + { + "$id": "1465", + "kind": "http", + "name": "Get SecurityPolicies", + "description": "Get SecurityPolicies", + "filePath": "2025-03-01-preview/SecurityPoliciesGetList.json", + "parameters": [ + { + "$id": "1466", + "parameter": { + "$ref": "1451" + }, + "value": { + "$id": "1467", + "kind": "string", + "type": { + "$ref": "1452" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1468", + "parameter": { + "$ref": "1455" + }, + "value": { + "$id": "1469", + "kind": "string", + "type": { + "$ref": "1456" + }, + "value": "subid" + } + }, + { + "$id": "1470", + "parameter": { + "$ref": "1457" + }, + "value": { + "$id": "1471", + "kind": "string", + "type": { + "$ref": "1458" + }, + "value": "rg1" + } + }, + { + "$id": "1472", + "parameter": { + "$ref": "1459" + }, + "value": { + "$id": "1473", + "kind": "string", + "type": { + "$ref": "1460" + }, + "value": "tc1" + } + } + ], + "responses": [ + { + "$id": "1474", + "response": { + "$ref": "1464" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1475", + "kind": "model", + "type": { + "$ref": "362" + }, + "value": { + "$id": "1476", + "value": { + "$id": "1477", + "kind": "array", + "type": { + "$ref": "364" + }, + "value": [ + { + "$id": "1478", + "kind": "model", + "type": { + "$ref": "299" + }, + "value": { + "$id": "1479", + "name": { + "$id": "1480", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "waf-0" + }, + "type": { + "$id": "1481", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/securityPolicies" + }, + "id": { + "$id": "1482", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/sample-tc/securityPolicies/waf-0" + }, + "location": { + "$id": "1483", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "eastus" + }, + "properties": { + "$id": "1484", + "kind": "model", + "type": { + "$ref": "301" + }, + "value": { + "$id": "1485", + "policyType": { + "$id": "1486", + "kind": "string", + "type": { + "$ref": "40" + }, + "value": "waf" + }, + "wafPolicy": { + "$id": "1487", + "kind": "model", + "type": { + "$ref": "306" + }, + "value": { + "$id": "1488", + "id": { + "$id": "1489", + "kind": "string", + "type": { + "$ref": "308" + }, + "value": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Networking/applicationGatewayWebApplicationFirewallPolicies/wp-0" + } + } + }, + "provisioningState": { + "$id": "1490", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1491", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1492", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1493", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1494", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1495", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1462" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1496", + "type": { + "$id": "1497", + "kind": "array", + "name": "ArraySecurityPolicy", + "valueType": { + "$ref": "299" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.listByTrafficController", + "pagingMetadata": { + "$id": "1498", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1499", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "1500", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "1501", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client", + "defaultValue": { + "$id": "1502", + "type": { + "$id": "1503", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [ + { + "$id": "1504", + "name": "Azure.ResourceManager.@armResourceOperations", + "arguments": { + "$id": "1505" + } + } + ], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.SecurityPoliciesInterface", + "apiVersions": [ + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "parent": { + "$ref": "476" + } + }, + { + "$id": "1506", + "kind": "client", + "name": "TrafficControllerInterface", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "methods": [ + { + "$id": "1507", + "kind": "basic", + "name": "get", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Get a TrafficController", + "operation": { + "$id": "1508", + "name": "get", + "resourceName": "TrafficController", + "doc": "Get a TrafficController", + "accessibility": "public", + "parameters": [ + { + "$id": "1509", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1510", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1511", + "type": { + "$id": "1512", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1513", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1514", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1515", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1516", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1517", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1518", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1519", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1520", + "kind": "constant", + "valueType": { + "$id": "1521", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1522", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "372" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerInterface.get", + "decorators": [], + "examples": [ + { + "$id": "1523", + "kind": "http", + "name": "Get Traffic Controller", + "description": "Get Traffic Controller", + "filePath": "2025-03-01-preview/TrafficControllerGet.json", + "parameters": [ + { + "$id": "1524", + "parameter": { + "$ref": "1509" + }, + "value": { + "$id": "1525", + "kind": "string", + "type": { + "$ref": "1510" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1526", + "parameter": { + "$ref": "1513" + }, + "value": { + "$id": "1527", + "kind": "string", + "type": { + "$ref": "1514" + }, + "value": "subid" + } + }, + { + "$id": "1528", + "parameter": { + "$ref": "1515" + }, + "value": { + "$id": "1529", + "kind": "string", + "type": { + "$ref": "1516" + }, + "value": "rg1" + } + }, + { + "$id": "1530", + "parameter": { + "$ref": "1517" + }, + "value": { + "$id": "1531", + "kind": "string", + "type": { + "$ref": "1518" + }, + "value": "tc1" + } + } + ], + "responses": [ + { + "$id": "1532", + "response": { + "$ref": "1522" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1533", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "1534", + "name": { + "$id": "1535", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "tc1" + }, + "id": { + "$id": "1536", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1" + }, + "type": { + "$id": "1537", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers" + }, + "location": { + "$id": "1538", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "tags": { + "$id": "1539", + "kind": "dict", + "type": { + "$ref": "119" + }, + "value": { + "$id": "1540", + "key1": { + "$id": "1541", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "value1" + } + } + }, + "properties": { + "$id": "1542", + "kind": "model", + "type": { + "$ref": "374" + }, + "value": { + "$id": "1543", + "configurationEndpoints": { + "$id": "1544", + "kind": "array", + "type": { + "$ref": "376" + }, + "value": [ + { + "$id": "1545", + "kind": "string", + "type": { + "$ref": "377" + }, + "value": "abc.trafficcontroller.azure.net" + } + ] + }, + "frontends": { + "$id": "1546", + "kind": "array", + "type": { + "$ref": "381" + }, + "value": [ + { + "$id": "1547", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1548", + "id": { + "$id": "1549", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1" + } + } + } + ] + }, + "associations": { + "$id": "1550", + "kind": "array", + "type": { + "$ref": "390" + }, + "value": [ + { + "$id": "1551", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1552", + "id": { + "$id": "1553", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/association/as1" + } + } + } + ] + }, + "provisioningState": { + "$id": "1554", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1555", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1556", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1557", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1558", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1559", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1520" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1560", + "type": { + "$ref": "372" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerInterface.get" + }, + { + "$id": "1561", + "kind": "lro", + "name": "createOrUpdate", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Create a TrafficController", + "operation": { + "$id": "1562", + "name": "createOrUpdate", + "resourceName": "TrafficController", + "doc": "Create a TrafficController", + "accessibility": "public", + "parameters": [ + { + "$id": "1563", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1564", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1565", + "type": { + "$id": "1566", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1567", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1568", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1569", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1570", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1571", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1572", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1573", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "1574", + "kind": "constant", + "valueType": { + "$id": "1575", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1576", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1577", + "kind": "constant", + "valueType": { + "$id": "1578", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1579", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "372" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1580", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "372" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "1581", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "372" + }, + "headers": [ + { + "$id": "1582", + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "1583", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerInterface.createOrUpdate", + "decorators": [ + { + "$id": "1584", + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "$id": "1585", + "finalState": "azure-async-operation" + } + } + ], + "examples": [ + { + "$id": "1586", + "kind": "http", + "name": "Put Traffic Controller", + "description": "Put Traffic Controller", + "filePath": "2025-03-01-preview/TrafficControllerPut.json", + "parameters": [ + { + "$id": "1587", + "parameter": { + "$ref": "1563" + }, + "value": { + "$id": "1588", + "kind": "string", + "type": { + "$ref": "1564" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1589", + "parameter": { + "$ref": "1567" + }, + "value": { + "$id": "1590", + "kind": "string", + "type": { + "$ref": "1568" + }, + "value": "subid" + } + }, + { + "$id": "1591", + "parameter": { + "$ref": "1569" + }, + "value": { + "$id": "1592", + "kind": "string", + "type": { + "$ref": "1570" + }, + "value": "rg1" + } + }, + { + "$id": "1593", + "parameter": { + "$ref": "1571" + }, + "value": { + "$id": "1594", + "kind": "string", + "type": { + "$ref": "1572" + }, + "value": "tc1" + } + }, + { + "$id": "1595", + "parameter": { + "$ref": "1579" + }, + "value": { + "$id": "1596", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "1597", + "location": { + "$id": "1598", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "tags": { + "$id": "1599", + "kind": "dict", + "type": { + "$ref": "119" + }, + "value": { + "$id": "1600", + "key1": { + "$id": "1601", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "value1" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "1602", + "response": { + "$ref": "1580" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1603", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "1604", + "name": { + "$id": "1605", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "tc1" + }, + "id": { + "$id": "1606", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1" + }, + "type": { + "$id": "1607", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers" + }, + "location": { + "$id": "1608", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "tags": { + "$id": "1609", + "kind": "dict", + "type": { + "$ref": "119" + }, + "value": { + "$id": "1610", + "key1": { + "$id": "1611", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "value1" + } + } + }, + "properties": { + "$id": "1612", + "kind": "model", + "type": { + "$ref": "374" + }, + "value": { + "$id": "1613", + "configurationEndpoints": { + "$id": "1614", + "kind": "array", + "type": { + "$ref": "376" + }, + "value": [ + { + "$id": "1615", + "kind": "string", + "type": { + "$ref": "377" + }, + "value": "abc.trafficcontroller.azure.net" + } + ] + }, + "frontends": { + "$id": "1616", + "kind": "array", + "type": { + "$ref": "381" + }, + "value": [ + { + "$id": "1617", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1618", + "id": { + "$id": "1619", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1" + } + } + } + ] + }, + "associations": { + "$id": "1620", + "kind": "array", + "type": { + "$ref": "390" + }, + "value": [ + { + "$id": "1621", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1622", + "id": { + "$id": "1623", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/association/as1" + } + } + } + ] + }, + "securityPolicies": { + "$id": "1624", + "kind": "array", + "type": { + "$ref": "394" + }, + "value": [ + { + "$id": "1625", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1626", + "id": { + "$id": "1627", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/securityPolicies/sp1" + } + } + } + ] + }, + "securityPolicyConfigurations": { + "$id": "1628", + "kind": "model", + "type": { + "$ref": "249" + }, + "value": { + "$id": "1629", + "wafSecurityPolicy": { + "$id": "1630", + "kind": "model", + "type": { + "$ref": "251" + }, + "value": { + "$id": "1631", + "id": { + "$id": "1632", + "kind": "string", + "type": { + "$ref": "253" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/securityPolicies/waf-0" + } + } + } + } + }, + "provisioningState": { + "$id": "1633", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + }, + { + "$id": "1634", + "response": { + "$ref": "1581" + }, + "statusCode": 201, + "bodyValue": { + "$id": "1635", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "1636", + "name": { + "$id": "1637", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "tc1" + }, + "id": { + "$id": "1638", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1" + }, + "type": { + "$id": "1639", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers" + }, + "location": { + "$id": "1640", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "tags": { + "$id": "1641", + "kind": "dict", + "type": { + "$ref": "119" + }, + "value": { + "$id": "1642", + "key1": { + "$id": "1643", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "value1" + } + } + }, + "properties": { + "$id": "1644", + "kind": "model", + "type": { + "$ref": "374" + }, + "value": { + "$id": "1645", + "configurationEndpoints": { + "$id": "1646", + "kind": "array", + "type": { + "$ref": "376" + }, + "value": [ + { + "$id": "1647", + "kind": "string", + "type": { + "$ref": "377" + }, + "value": "abc.trafficcontroller.azure.net" + } + ] + }, + "frontends": { + "$id": "1648", + "kind": "array", + "type": { + "$ref": "381" + }, + "value": [ + { + "$id": "1649", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1650", + "id": { + "$id": "1651", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1" + } + } + } + ] + }, + "associations": { + "$id": "1652", + "kind": "array", + "type": { + "$ref": "390" + }, + "value": [ + { + "$id": "1653", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1654", + "id": { + "$id": "1655", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/association/as1" + } + } + } + ] + }, + "securityPolicies": { + "$id": "1656", + "kind": "array", + "type": { + "$ref": "394" + }, + "value": [ + { + "$id": "1657", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1658", + "id": { + "$id": "1659", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/securityPolicies/sp1" + } + } + } + ] + }, + "securityPolicyConfigurations": { + "$id": "1660", + "kind": "model", + "type": { + "$ref": "249" + }, + "value": { + "$id": "1661", + "wafSecurityPolicy": { + "$id": "1662", + "kind": "model", + "type": { + "$ref": "251" + }, + "value": { + "$id": "1663", + "id": { + "$id": "1664", + "kind": "string", + "type": { + "$ref": "253" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/securityPolicies/waf-0" + } + } + } + } + }, + "provisioningState": { + "$id": "1665", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1666", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1667", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1668", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1669", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1670", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "372" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1671", + "name": "contentType", + "nameInRequest": "contentType", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "1672", + "kind": "constant", + "valueType": { + "$id": "1673", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1674", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$id": "1675", + "kind": "constant", + "valueType": { + "$id": "1676", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1677", + "type": { + "$ref": "372" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerInterface.createOrUpdate", + "lroMetadata": { + "$id": "1678", + "finalStateVia": 0, + "finalResponse": { + "$id": "1679", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "372" + } + } + } + }, + { + "$id": "1680", + "kind": "basic", + "name": "update", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Update a TrafficController", + "operation": { + "$id": "1681", + "name": "update", + "resourceName": "TrafficController", + "doc": "Update a TrafficController", + "accessibility": "public", + "parameters": [ + { + "$id": "1682", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1683", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1684", + "type": { + "$id": "1685", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1686", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1687", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1688", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1689", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1690", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1691", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1692", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "1693", + "kind": "constant", + "valueType": { + "$id": "1694", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1695", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1696", + "kind": "constant", + "valueType": { + "$id": "1697", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1698", + "name": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "407" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1699", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "372" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PATCH", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": false, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerInterface.update", + "decorators": [], + "examples": [ + { + "$id": "1700", + "kind": "http", + "name": "Patch Traffic Controller", + "description": "Patch Traffic Controller", + "filePath": "2025-03-01-preview/TrafficControllerPatch.json", + "parameters": [ + { + "$id": "1701", + "parameter": { + "$ref": "1682" + }, + "value": { + "$id": "1702", + "kind": "string", + "type": { + "$ref": "1683" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1703", + "parameter": { + "$ref": "1686" + }, + "value": { + "$id": "1704", + "kind": "string", + "type": { + "$ref": "1687" + }, + "value": "subid" + } + }, + { + "$id": "1705", + "parameter": { + "$ref": "1688" + }, + "value": { + "$id": "1706", + "kind": "string", + "type": { + "$ref": "1689" + }, + "value": "rg1" + } + }, + { + "$id": "1707", + "parameter": { + "$ref": "1690" + }, + "value": { + "$id": "1708", + "kind": "string", + "type": { + "$ref": "1691" + }, + "value": "tc1" + } + }, + { + "$id": "1709", + "parameter": { + "$ref": "1698" + }, + "value": { + "$id": "1710", + "kind": "model", + "type": { + "$ref": "407" + }, + "value": { + "$id": "1711", + "tags": { + "$id": "1712", + "kind": "dict", + "type": { + "$ref": "409" + }, + "value": { + "$id": "1713", + "key1": { + "$id": "1714", + "kind": "string", + "type": { + "$ref": "411" + }, + "value": "value1" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "1715", + "response": { + "$ref": "1699" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1716", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "1717", + "name": { + "$id": "1718", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "tc1" + }, + "id": { + "$id": "1719", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1" + }, + "type": { + "$id": "1720", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers" + }, + "location": { + "$id": "1721", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "tags": { + "$id": "1722", + "kind": "dict", + "type": { + "$ref": "119" + }, + "value": { + "$id": "1723", + "key1": { + "$id": "1724", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "value1" + } + } + }, + "properties": { + "$id": "1725", + "kind": "model", + "type": { + "$ref": "374" + }, + "value": { + "$id": "1726", + "configurationEndpoints": { + "$id": "1727", + "kind": "array", + "type": { + "$ref": "376" + }, + "value": [ + { + "$id": "1728", + "kind": "string", + "type": { + "$ref": "377" + }, + "value": "abc.trafficcontroller.azure.net" + } + ] + }, + "frontends": { + "$id": "1729", + "kind": "array", + "type": { + "$ref": "381" + }, + "value": [ + { + "$id": "1730", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1731", + "id": { + "$id": "1732", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1" + } + } + } + ] + }, + "associations": { + "$id": "1733", + "kind": "array", + "type": { + "$ref": "390" + }, + "value": [ + { + "$id": "1734", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1735", + "id": { + "$id": "1736", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/association/as1" + } + } + } + ] + }, + "securityPolicies": { + "$id": "1737", + "kind": "array", + "type": { + "$ref": "394" + }, + "value": [ + { + "$id": "1738", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1739", + "id": { + "$id": "1740", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/securityPolicies/sp1" + } + } + } + ] + }, + "securityPolicyConfigurations": { + "$id": "1741", + "kind": "model", + "type": { + "$ref": "249" + }, + "value": { + "$id": "1742", + "wafSecurityPolicy": { + "$id": "1743", + "kind": "model", + "type": { + "$ref": "251" + }, + "value": { + "$id": "1744", + "id": { + "$id": "1745", + "kind": "string", + "type": { + "$ref": "253" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/securityPolicies/waf-0" + } + } + } + } + }, + "provisioningState": { + "$id": "1746", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1747", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1748", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1749", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1750", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1751", + "name": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "407" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1752", + "name": "contentType", + "nameInRequest": "contentType", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "1693" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1753", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1696" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1754", + "type": { + "$ref": "372" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerInterface.update" + }, + { + "$id": "1755", + "kind": "lro", + "name": "delete", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "Delete a TrafficController", + "operation": { + "$id": "1756", + "name": "delete", + "resourceName": "TrafficController", + "doc": "Delete a TrafficController", + "accessibility": "public", + "parameters": [ + { + "$id": "1757", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1758", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1759", + "type": { + "$id": "1760", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1761", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1762", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1763", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1764", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1765", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1766", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1767", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1768", + "kind": "constant", + "valueType": { + "$id": "1769", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1770", + "statusCodes": [ + 202 + ], + "headers": [ + { + "$id": "1771", + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "1772", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1773", + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "1774", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "$id": "1775", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerInterface.delete", + "decorators": [], + "examples": [ + { + "$id": "1776", + "kind": "http", + "name": "Delete Traffic Controller", + "description": "Delete Traffic Controller", + "filePath": "2025-03-01-preview/TrafficControllerDelete.json", + "parameters": [ + { + "$id": "1777", + "parameter": { + "$ref": "1757" + }, + "value": { + "$id": "1778", + "kind": "string", + "type": { + "$ref": "1758" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1779", + "parameter": { + "$ref": "1761" + }, + "value": { + "$id": "1780", + "kind": "string", + "type": { + "$ref": "1762" + }, + "value": "subid" + } + }, + { + "$id": "1781", + "parameter": { + "$ref": "1763" + }, + "value": { + "$id": "1782", + "kind": "string", + "type": { + "$ref": "1764" + }, + "value": "rg1" + } + }, + { + "$id": "1783", + "parameter": { + "$ref": "1765" + }, + "value": { + "$id": "1784", + "kind": "string", + "type": { + "$ref": "1766" + }, + "value": "tc1" + } + } + ], + "responses": [ + { + "$id": "1785", + "response": { + "$ref": "1770" + }, + "statusCode": 202 + }, + { + "$id": "1786", + "response": { + "$ref": "1775" + }, + "statusCode": 204 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1787", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1788", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1789", + "name": "trafficControllerName", + "nameInRequest": "trafficControllerName", + "doc": "traffic controller name for path", + "type": { + "$id": "1790", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1791", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$id": "1792", + "kind": "constant", + "valueType": { + "$id": "1793", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1794" + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerInterface.delete", + "lroMetadata": { + "$id": "1795", + "finalStateVia": 1, + "finalResponse": { + "$id": "1796", + "statusCodes": [ + 204 + ] + } + } + }, + { + "$id": "1797", + "kind": "paging", + "name": "listByResourceGroup", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "List TrafficController resources by resource group", + "operation": { + "$id": "1798", + "name": "listByResourceGroup", + "resourceName": "TrafficController", + "doc": "List TrafficController resources by resource group", + "accessibility": "public", + "parameters": [ + { + "$id": "1799", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1800", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1801", + "type": { + "$id": "1802", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1803", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1804", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1805", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1806", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1807", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1808", + "kind": "constant", + "valueType": { + "$id": "1809", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1810", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "421" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerInterface.listByResourceGroup", + "decorators": [], + "examples": [ + { + "$id": "1811", + "kind": "http", + "name": "Get Traffic Controllers", + "description": "Get Traffic Controllers", + "filePath": "2025-03-01-preview/TrafficControllersGet.json", + "parameters": [ + { + "$id": "1812", + "parameter": { + "$ref": "1799" + }, + "value": { + "$id": "1813", + "kind": "string", + "type": { + "$ref": "1800" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1814", + "parameter": { + "$ref": "1803" + }, + "value": { + "$id": "1815", + "kind": "string", + "type": { + "$ref": "1804" + }, + "value": "subid" + } + }, + { + "$id": "1816", + "parameter": { + "$ref": "1805" + }, + "value": { + "$id": "1817", + "kind": "string", + "type": { + "$ref": "1806" + }, + "value": "rg1" + } + } + ], + "responses": [ + { + "$id": "1818", + "response": { + "$ref": "1810" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1819", + "kind": "model", + "type": { + "$ref": "421" + }, + "value": { + "$id": "1820", + "value": { + "$id": "1821", + "kind": "array", + "type": { + "$ref": "423" + }, + "value": [ + { + "$id": "1822", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "1823", + "name": { + "$id": "1824", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "tc1" + }, + "id": { + "$id": "1825", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1" + }, + "type": { + "$id": "1826", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers" + }, + "location": { + "$id": "1827", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "tags": { + "$id": "1828", + "kind": "dict", + "type": { + "$ref": "119" + }, + "value": { + "$id": "1829", + "key1": { + "$id": "1830", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "value1" + } + } + }, + "properties": { + "$id": "1831", + "kind": "model", + "type": { + "$ref": "374" + }, + "value": { + "$id": "1832", + "configurationEndpoints": { + "$id": "1833", + "kind": "array", + "type": { + "$ref": "376" + }, + "value": [ + { + "$id": "1834", + "kind": "string", + "type": { + "$ref": "377" + }, + "value": "abc.trafficcontroller.azure.net" + } + ] + }, + "frontends": { + "$id": "1835", + "kind": "array", + "type": { + "$ref": "381" + }, + "value": [ + { + "$id": "1836", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1837", + "id": { + "$id": "1838", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1" + } + } + } + ] + }, + "associations": { + "$id": "1839", + "kind": "array", + "type": { + "$ref": "390" + }, + "value": [ + { + "$id": "1840", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1841", + "id": { + "$id": "1842", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/association/as1" + } + } + } + ] + }, + "securityPolicies": { + "$id": "1843", + "kind": "array", + "type": { + "$ref": "394" + }, + "value": [ + { + "$id": "1844", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1845", + "id": { + "$id": "1846", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/securityPolicies/sp1" + } + } + } + ] + }, + "securityPolicyConfigurations": { + "$id": "1847", + "kind": "model", + "type": { + "$ref": "249" + }, + "value": { + "$id": "1848", + "wafSecurityPolicy": { + "$id": "1849", + "kind": "model", + "type": { + "$ref": "251" + }, + "value": { + "$id": "1850", + "id": { + "$id": "1851", + "kind": "string", + "type": { + "$ref": "253" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/securityPolicies/waf-0" + } + } + } + } + }, + "provisioningState": { + "$id": "1852", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1853", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1854", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1855", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1808" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1856", + "type": { + "$id": "1857", + "kind": "array", + "name": "ArrayTrafficController", + "valueType": { + "$ref": "372" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerInterface.listByResourceGroup", + "pagingMetadata": { + "$id": "1858", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1859", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + }, + { + "$id": "1860", + "kind": "paging", + "name": "listBySubscription", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "List TrafficController resources by subscription ID", + "operation": { + "$id": "1861", + "name": "listBySubscription", + "resourceName": "TrafficController", + "doc": "List TrafficController resources by subscription ID", + "accessibility": "public", + "parameters": [ + { + "$id": "1862", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1863", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1864", + "type": { + "$id": "1865", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1866", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1867", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1868", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1869", + "kind": "constant", + "valueType": { + "$id": "1870", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1871", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "421" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceNetworking/trafficControllers", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerInterface.listBySubscription", + "decorators": [], + "examples": [ + { + "$id": "1872", + "kind": "http", + "name": "Get Traffic Controllers List", + "description": "Get Traffic Controllers List", + "filePath": "2025-03-01-preview/TrafficControllersGetList.json", + "parameters": [ + { + "$id": "1873", + "parameter": { + "$ref": "1862" + }, + "value": { + "$id": "1874", + "kind": "string", + "type": { + "$ref": "1863" + }, + "value": "2025-03-01-preview" + } + }, + { + "$id": "1875", + "parameter": { + "$ref": "1866" + }, + "value": { + "$id": "1876", + "kind": "string", + "type": { + "$ref": "1867" + }, + "value": "subid" + } + } + ], + "responses": [ + { + "$id": "1877", + "response": { + "$ref": "1871" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1878", + "kind": "model", + "type": { + "$ref": "421" + }, + "value": { + "$id": "1879", + "value": { + "$id": "1880", + "kind": "array", + "type": { + "$ref": "423" + }, + "value": [ + { + "$id": "1881", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "1882", + "name": { + "$id": "1883", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "tc1" + }, + "id": { + "$id": "1884", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1" + }, + "type": { + "$id": "1885", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers" + }, + "location": { + "$id": "1886", + "kind": "string", + "type": { + "$ref": "125" + }, + "value": "NorthCentralUS" + }, + "tags": { + "$id": "1887", + "kind": "dict", + "type": { + "$ref": "119" + }, + "value": { + "$id": "1888", + "key1": { + "$id": "1889", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "value1" + } + } + }, + "properties": { + "$id": "1890", + "kind": "model", + "type": { + "$ref": "374" + }, + "value": { + "$id": "1891", + "configurationEndpoints": { + "$id": "1892", + "kind": "array", + "type": { + "$ref": "376" + }, + "value": [ + { + "$id": "1893", + "kind": "string", + "type": { + "$ref": "377" + }, + "value": "abc.trafficcontroller.azure.net" + } + ] + }, + "frontends": { + "$id": "1894", + "kind": "array", + "type": { + "$ref": "381" + }, + "value": [ + { + "$id": "1895", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1896", + "id": { + "$id": "1897", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/frontends/fe1" + } + } + } + ] + }, + "associations": { + "$id": "1898", + "kind": "array", + "type": { + "$ref": "390" + }, + "value": [ + { + "$id": "1899", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1900", + "id": { + "$id": "1901", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/association/as1" + } + } + } + ] + }, + "securityPolicies": { + "$id": "1902", + "kind": "array", + "type": { + "$ref": "394" + }, + "value": [ + { + "$id": "1903", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "1904", + "id": { + "$id": "1905", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/securityPolicies/sp1" + } + } + } + ] + }, + "securityPolicyConfigurations": { + "$id": "1906", + "kind": "model", + "type": { + "$ref": "249" + }, + "value": { + "$id": "1907", + "wafSecurityPolicy": { + "$id": "1908", + "kind": "model", + "type": { + "$ref": "251" + }, + "value": { + "$id": "1909", + "id": { + "$id": "1910", + "kind": "string", + "type": { + "$ref": "253" + }, + "value": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ServiceNetworking/trafficControllers/tc1/securityPolicies/waf-0" + } + } + } + } + }, + "provisioningState": { + "$id": "1911", + "kind": "string", + "type": { + "$ref": "6" + }, + "value": "Succeeded" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1912", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1869" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1913", + "type": { + "$id": "1914", + "kind": "array", + "name": "ArrayTrafficController", + "valueType": { + "$ref": "372" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerInterface.listBySubscription", + "pagingMetadata": { + "$id": "1915", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1916", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "1917", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "1918", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client", + "defaultValue": { + "$id": "1919", + "type": { + "$id": "1920", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [ + { + "$id": "1921", + "name": "Azure.ResourceManager.@armResourceOperations", + "arguments": { + "$id": "1922" + } + } + ], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.TrafficControllerInterface", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "parent": { + "$ref": "476" + } + }, + { + "$id": "1923", + "kind": "client", + "name": "Operations", + "namespace": "Azure.ResourceManager.ServiceNetworking", + "methods": [ + { + "$id": "1924", + "kind": "paging", + "name": "list", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "doc": "List the operations for the provider", + "operation": { + "$id": "1925", + "name": "list", + "resourceName": "Operations", + "doc": "List the operations for the provider", + "accessibility": "public", + "parameters": [ + { + "$id": "1926", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1927", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1928", + "type": { + "$id": "1929", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01-preview" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1930", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1931", + "kind": "constant", + "valueType": { + "$id": "1932", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1933", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "431" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/providers/Microsoft.ServiceNetworking/operations", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "decorators": [], + "examples": [ + { + "$id": "1934", + "kind": "http", + "name": "Get Operations List", + "description": "Get Operations List", + "filePath": "2025-03-01-preview/OperationsList.json", + "parameters": [ + { + "$id": "1935", + "parameter": { + "$ref": "1926" + }, + "value": { + "$id": "1936", + "kind": "string", + "type": { + "$ref": "1927" + }, + "value": "2025-03-01-preview" + } + } + ], + "responses": [ + { + "$id": "1937", + "response": { + "$ref": "1933" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1938", + "kind": "model", + "type": { + "$ref": "431" + }, + "value": { + "$id": "1939", + "value": { + "$id": "1940", + "kind": "array", + "type": { + "$ref": "433" + }, + "value": [ + { + "$id": "1941", + "kind": "model", + "type": { + "$ref": "434" + }, + "value": { + "$id": "1942", + "name": { + "$id": "1943", + "kind": "string", + "type": { + "$ref": "436" + }, + "value": "Microsoft.ServiceNetworking/trafficControllers/read" + }, + "isDataAction": { + "$id": "1944", + "kind": "boolean", + "type": { + "$ref": "440" + }, + "value": false + }, + "display": { + "$id": "1945", + "kind": "model", + "type": { + "$ref": "444" + }, + "value": { + "$id": "1946", + "provider": { + "$id": "1947", + "kind": "string", + "type": { + "$ref": "446" + }, + "value": "Microsoft Service Networking" + }, + "resource": { + "$id": "1948", + "kind": "string", + "type": { + "$ref": "450" + }, + "value": "Traffic Controller" + }, + "operation": { + "$id": "1949", + "kind": "string", + "type": { + "$ref": "454" + }, + "value": "Get Traffic Controller configuration" + }, + "description": { + "$id": "1950", + "kind": "string", + "type": { + "$ref": "458" + }, + "value": "Traffic Controller is a L7 Load Balancing solution for a Multi Cluster setup" + } + } + }, + "origin": { + "$id": "1951", + "kind": "string", + "type": { + "$ref": "52" + }, + "value": "user,system" + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1952", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1931" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1953", + "type": { + "$id": "1954", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$ref": "434" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "pagingMetadata": { + "$id": "1955", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1956", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "1957", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "1958", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client", + "defaultValue": { + "$id": "1959", + "type": { + "$id": "1960", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.ServiceNetworking.Operations", + "apiVersions": [ + "2023-11-01", + "2024-05-01-preview", + "2025-01-01", + "2025-03-01-preview" + ], + "parent": { + "$ref": "476" + } + } + ] + } + ], + "auth": { + "$id": "1961", + "oAuth2": { + "$id": "1962", + "scopes": [ + "user_impersonation" + ] + } + } +} diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/Configuration.json b/sdk/standbypool/Azure.ResourceManager.StandbyPool/Configuration.json new file mode 100644 index 000000000000..0a2d1af62ece --- /dev/null +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/Configuration.json @@ -0,0 +1,12 @@ +{ + "output-folder": ".", + "namespace": "Azure.ResourceManager.StandbyPool", + "library-name": "Azure.ResourceManager.StandbyPool", + "flavor": "azure", + "use-model-reader-writer": true, + "shared-source-folders": [ + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Generator.Shared", + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Azure.Core.Shared" + ], + "azure-arm": true +} diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/tsp-location.yaml b/sdk/standbypool/Azure.ResourceManager.StandbyPool/tsp-location.yaml index db59ec6f9183..3847416628ff 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: 47fb75e55cbbcaf8d65602ad991885e7dfd49a1e repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/tspCodeModel.json b/sdk/standbypool/Azure.ResourceManager.StandbyPool/tspCodeModel.json new file mode 100644 index 000000000000..047a8c553d4c --- /dev/null +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/tspCodeModel.json @@ -0,0 +1,18304 @@ +{ + "$id": "1", + "name": "Microsoft.StandbyPool", + "apiVersions": [ + "2024-03-01", + "2025-03-01" + ], + "enums": [ + { + "$id": "2", + "kind": "enum", + "name": "Origin", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Origin", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Indicates the operation is initiated by a user.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "system", + "value": "system", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Indicates the operation is initiated by a system.", + "decorators": [] + }, + { + "$id": "8", + "kind": "enumvalue", + "name": "user,system", + "value": "user,system", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "Indicates the operation is initiated by a user or system.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.StandbyPool", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "10", + "kind": "enum", + "name": "ActionType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ActionType", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "12", + "kind": "enumvalue", + "name": "Internal", + "value": "Internal", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "doc": "Actions are for internal-only APIs.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.StandbyPool", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "14", + "kind": "enum", + "name": "StandbyVirtualMachineState", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineState", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "16", + "kind": "enumvalue", + "name": "Running", + "value": "Running", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "14" + }, + "doc": "The virtual machine is up and running.", + "decorators": [] + }, + { + "$id": "18", + "kind": "enumvalue", + "name": "Deallocated", + "value": "Deallocated", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "14" + }, + "doc": "The virtual machine has released the lease on the underlying hardware and is powered off.", + "decorators": [] + }, + { + "$id": "20", + "kind": "enumvalue", + "name": "Hibernated", + "value": "Hibernated", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "14" + }, + "doc": "The virtual machine has released the lease on the underlying hardware and is powered off. Memory contents of the VM are stored in the OS disk. When started again, applications and processes that were previously running in your VM resume from the state prior to hibernation.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.StandbyPool", + "doc": "State of standby virtual machines", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "22", + "kind": "enum", + "name": "StandbyProvisioningState", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ProvisioningState", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "24", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "26", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "28", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + }, + { + "$id": "30", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "22" + }, + "doc": "Resource is being deleted.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.StandbyPool", + "doc": "Provisioning state", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "32", + "kind": "enum", + "name": "createdByType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.createdByType", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "34", + "kind": "enumvalue", + "name": "User", + "value": "User", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "doc": "The entity was created by a user.", + "decorators": [] + }, + { + "$id": "36", + "kind": "enumvalue", + "name": "Application", + "value": "Application", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "doc": "The entity was created by an application.", + "decorators": [] + }, + { + "$id": "38", + "kind": "enumvalue", + "name": "ManagedIdentity", + "value": "ManagedIdentity", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "doc": "The entity was created by a managed identity.", + "decorators": [] + }, + { + "$id": "40", + "kind": "enumvalue", + "name": "Key", + "value": "Key", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "doc": "The entity was created by a key.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.StandbyPool", + "doc": "The kind of entity that created the resource.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "42", + "kind": "enum", + "name": "ResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceProvisioningState", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "44", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "46", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "48", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "42" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.StandbyPool", + "doc": "The provisioning state of a resource type.", + "isFixed": false, + "isFlags": false, + "usage": "LroPolling", + "decorators": [] + }, + { + "$id": "50", + "kind": "enum", + "name": "PoolVirtualMachineState", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolVirtualMachineState", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "52", + "kind": "enumvalue", + "name": "Running", + "value": "Running", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "doc": "The virtual machine is up and running.", + "decorators": [] + }, + { + "$id": "54", + "kind": "enumvalue", + "name": "Creating", + "value": "Creating", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "doc": "The virtual machine is creating.", + "decorators": [] + }, + { + "$id": "56", + "kind": "enumvalue", + "name": "Starting", + "value": "Starting", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "doc": "The virtual machine is starting.", + "decorators": [] + }, + { + "$id": "58", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "doc": "The virtual machine is deleting.", + "decorators": [] + }, + { + "$id": "60", + "kind": "enumvalue", + "name": "Deallocated", + "value": "Deallocated", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "doc": "The virtual machine has released the lease on the underlying hardware and is powered off.", + "decorators": [] + }, + { + "$id": "62", + "kind": "enumvalue", + "name": "Deallocating", + "value": "Deallocating", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "doc": "The virtual machine is releasing the lease on the underlying hardware and is powered off.", + "decorators": [] + }, + { + "$id": "64", + "kind": "enumvalue", + "name": "Hibernated", + "value": "Hibernated", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "doc": "The virtual machine has released the lease on the underlying hardware and is powered off. Memory contents of the VM are stored in the OS disk. When started again, applications and processes that were previously running in your VM resume from the state prior to hibernation.", + "decorators": [] + }, + { + "$id": "66", + "kind": "enumvalue", + "name": "Hibernating", + "value": "Hibernating", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "doc": "The virtual machine is hibernating.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.StandbyPool", + "doc": "The state of the pooled virtual machines.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "68", + "kind": "enum", + "name": "StandbyPoolHealthStateCode", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.HealthStateCode", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "70", + "kind": "enumvalue", + "name": "healthy", + "value": "HealthState/healthy", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "68" + }, + "doc": "StandbyPool is in healthy state.", + "decorators": [] + }, + { + "$id": "72", + "kind": "enumvalue", + "name": "degraded", + "value": "HealthState/degraded", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "68" + }, + "doc": "StandbyPool is in degraded state.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.StandbyPool", + "doc": "StandbyPool health state.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "74", + "kind": "enum", + "name": "StandbyRefillPolicy", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.RefillPolicy", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "76", + "kind": "enumvalue", + "name": "always", + "value": "always", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "74" + }, + "doc": "A refill policy that standby pool is automatically refilled to maintain maxReadyCapacity.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.StandbyPool", + "doc": "Refill policy of standby pool", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "78", + "kind": "enum", + "name": "PoolContainerGroupState", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolContainerGroupState", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "80", + "kind": "enumvalue", + "name": "Running", + "value": "Running", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "78" + }, + "doc": "The container group is up and running.", + "decorators": [] + }, + { + "$id": "82", + "kind": "enumvalue", + "name": "Creating", + "value": "Creating", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "78" + }, + "doc": "The container group is creating.", + "decorators": [] + }, + { + "$id": "84", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "85", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "78" + }, + "doc": "The container group is deleting.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.StandbyPool", + "doc": "The state of the pooled container groups.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "86", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.Versions", + "valueType": { + "$id": "87", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "88", + "kind": "enumvalue", + "name": "2024-03-01", + "value": "2024-03-01", + "valueType": { + "$id": "89", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "86" + }, + "doc": "API Version 2024-03-01.", + "decorators": [] + }, + { + "$id": "90", + "kind": "enumvalue", + "name": "2025-03-01", + "value": "2025-03-01", + "valueType": { + "$id": "91", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "86" + }, + "doc": "API Version 2025-03-01.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.StandbyPool", + "doc": "Supported API Versions for Microsoft.StandbyPool", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "models": [ + { + "$id": "92", + "kind": "model", + "name": "OperationListResult", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult", + "usage": "Output,Json", + "doc": "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.", + "decorators": [], + "properties": [ + { + "$id": "93", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Operation items on this page", + "type": { + "$id": "94", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$id": "95", + "kind": "model", + "name": "Operation", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation", + "usage": "Output,Json", + "doc": "Details of a REST API operation, returned from the Resource Provider Operations API", + "decorators": [], + "properties": [ + { + "$id": "96", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\"", + "type": { + "$id": "97", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.name", + "serializationOptions": { + "$id": "98", + "json": { + "$id": "99", + "name": "name" + } + } + }, + { + "$id": "100", + "kind": "property", + "name": "isDataAction", + "serializedName": "isDataAction", + "doc": "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.", + "type": { + "$id": "101", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.isDataAction", + "serializationOptions": { + "$id": "102", + "json": { + "$id": "103", + "name": "isDataAction" + } + } + }, + { + "$id": "104", + "kind": "property", + "name": "display", + "serializedName": "display", + "doc": "Localized display information for this particular operation.", + "type": { + "$id": "105", + "kind": "model", + "name": "OperationDisplay", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "usage": "Output,Json", + "doc": "Localized display information for and operation.", + "decorators": [], + "properties": [ + { + "$id": "106", + "kind": "property", + "name": "provider", + "serializedName": "provider", + "doc": "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\".", + "type": { + "$id": "107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.provider", + "serializationOptions": { + "$id": "108", + "json": { + "$id": "109", + "name": "provider" + } + } + }, + { + "$id": "110", + "kind": "property", + "name": "resource", + "serializedName": "resource", + "doc": "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\".", + "type": { + "$id": "111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.resource", + "serializationOptions": { + "$id": "112", + "json": { + "$id": "113", + "name": "resource" + } + } + }, + { + "$id": "114", + "kind": "property", + "name": "operation", + "serializedName": "operation", + "doc": "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\".", + "type": { + "$id": "115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.operation", + "serializationOptions": { + "$id": "116", + "json": { + "$id": "117", + "name": "operation" + } + } + }, + { + "$id": "118", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + "type": { + "$id": "119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.description", + "serializationOptions": { + "$id": "120", + "json": { + "$id": "121", + "name": "description" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display", + "serializationOptions": { + "$id": "122", + "json": { + "$id": "123", + "name": "display" + } + } + }, + { + "$id": "124", + "kind": "property", + "name": "origin", + "serializedName": "origin", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin", + "serializationOptions": { + "$id": "125", + "json": { + "$id": "126", + "name": "origin" + } + } + }, + { + "$id": "127", + "kind": "property", + "name": "actionType", + "serializedName": "actionType", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "type": { + "$ref": "10" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType", + "serializationOptions": { + "$id": "128", + "json": { + "$id": "129", + "name": "actionType" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.value", + "serializationOptions": { + "$id": "130", + "json": { + "$id": "131", + "name": "value" + } + } + }, + { + "$id": "132", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "133", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "134", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.nextLink", + "serializationOptions": { + "$id": "135", + "json": { + "$id": "136", + "name": "nextLink" + } + } + } + ] + }, + { + "$ref": "95" + }, + { + "$ref": "105" + }, + { + "$id": "137", + "kind": "model", + "name": "ErrorResponse", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "usage": "Json,Exception", + "doc": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", + "decorators": [], + "properties": [ + { + "$id": "138", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error object.", + "type": { + "$id": "139", + "kind": "model", + "name": "ErrorDetail", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "usage": "Json,Exception,LroPolling", + "doc": "The error detail.", + "decorators": [], + "properties": [ + { + "$id": "140", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.code", + "serializationOptions": { + "$id": "142", + "json": { + "$id": "143", + "name": "code" + } + } + }, + { + "$id": "144", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.message", + "serializationOptions": { + "$id": "146", + "json": { + "$id": "147", + "name": "message" + } + } + }, + { + "$id": "148", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The error target.", + "type": { + "$id": "149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.target", + "serializationOptions": { + "$id": "150", + "json": { + "$id": "151", + "name": "target" + } + } + }, + { + "$id": "152", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The error details.", + "type": { + "$id": "153", + "kind": "array", + "name": "ArrayErrorDetail", + "valueType": { + "$ref": "139" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details", + "serializationOptions": { + "$id": "154", + "json": { + "$id": "155", + "name": "details" + } + } + }, + { + "$id": "156", + "kind": "property", + "name": "additionalInfo", + "serializedName": "additionalInfo", + "doc": "The error additional info.", + "type": { + "$id": "157", + "kind": "array", + "name": "ArrayErrorAdditionalInfo", + "valueType": { + "$id": "158", + "kind": "model", + "name": "ErrorAdditionalInfo", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "usage": "Json,Exception,LroPolling", + "doc": "The resource management error additional info.", + "decorators": [], + "properties": [ + { + "$id": "159", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The additional info type.", + "type": { + "$id": "160", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.type", + "serializationOptions": { + "$id": "161", + "json": { + "$id": "162", + "name": "type" + } + } + }, + { + "$id": "163", + "kind": "property", + "name": "info", + "serializedName": "info", + "doc": "The additional info.", + "type": { + "$id": "164", + "kind": "model", + "name": "ErrorAdditionalInfoInfo", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info.anonymous", + "usage": "Json,Exception,LroPolling", + "decorators": [], + "properties": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info", + "serializationOptions": { + "$id": "165", + "json": { + "$id": "166", + "name": "info" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo", + "serializationOptions": { + "$id": "167", + "json": { + "$id": "168", + "name": "additionalInfo" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error", + "serializationOptions": { + "$id": "169", + "json": { + "$id": "170", + "name": "error" + } + } + } + ] + }, + { + "$ref": "139" + }, + { + "$ref": "158" + }, + { + "$ref": "164" + }, + { + "$id": "171", + "kind": "model", + "name": "StandbyVirtualMachinePool", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "A StandbyVirtualMachinePoolResource.", + "decorators": [], + "baseModel": { + "$id": "172", + "kind": "model", + "name": "TrackedResource", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", + "decorators": [], + "baseModel": { + "$id": "173", + "kind": "model", + "name": "Resource", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Common fields that are returned in the response for all Azure Resource Manager resources", + "decorators": [], + "properties": [ + { + "$id": "174", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", + "type": { + "$id": "175", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "176", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.id", + "serializationOptions": { + "$id": "177", + "json": { + "$id": "178", + "name": "id" + } + } + }, + { + "$id": "179", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the resource", + "type": { + "$id": "180", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.name", + "serializationOptions": { + "$id": "181", + "json": { + "$id": "182", + "name": "name" + } + } + }, + { + "$id": "183", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"", + "type": { + "$id": "184", + "kind": "string", + "name": "armResourceType", + "crossLanguageDefinitionId": "Azure.Core.armResourceType", + "baseType": { + "$id": "185", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.type", + "serializationOptions": { + "$id": "186", + "json": { + "$id": "187", + "name": "type" + } + } + }, + { + "$id": "188", + "kind": "property", + "name": "systemData", + "serializedName": "systemData", + "doc": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "type": { + "$id": "189", + "kind": "model", + "name": "SystemData", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData", + "usage": "Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Metadata pertaining to creation and last modification of the resource.", + "decorators": [], + "properties": [ + { + "$id": "190", + "kind": "property", + "name": "createdBy", + "serializedName": "createdBy", + "doc": "The identity that created the resource.", + "type": { + "$id": "191", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdBy", + "serializationOptions": { + "$id": "192", + "json": { + "$id": "193", + "name": "createdBy" + } + } + }, + { + "$id": "194", + "kind": "property", + "name": "createdByType", + "serializedName": "createdByType", + "doc": "The type of identity that created the resource.", + "type": { + "$ref": "32" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdByType", + "serializationOptions": { + "$id": "195", + "json": { + "$id": "196", + "name": "createdByType" + } + } + }, + { + "$id": "197", + "kind": "property", + "name": "createdAt", + "serializedName": "createdAt", + "doc": "The timestamp of resource creation (UTC).", + "type": { + "$id": "198", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "199", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdAt", + "serializationOptions": { + "$id": "200", + "json": { + "$id": "201", + "name": "createdAt" + } + } + }, + { + "$id": "202", + "kind": "property", + "name": "lastModifiedBy", + "serializedName": "lastModifiedBy", + "doc": "The identity that last modified the resource.", + "type": { + "$id": "203", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedBy", + "serializationOptions": { + "$id": "204", + "json": { + "$id": "205", + "name": "lastModifiedBy" + } + } + }, + { + "$id": "206", + "kind": "property", + "name": "lastModifiedByType", + "serializedName": "lastModifiedByType", + "doc": "The type of identity that last modified the resource.", + "type": { + "$ref": "32" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedByType", + "serializationOptions": { + "$id": "207", + "json": { + "$id": "208", + "name": "lastModifiedByType" + } + } + }, + { + "$id": "209", + "kind": "property", + "name": "lastModifiedAt", + "serializedName": "lastModifiedAt", + "doc": "The timestamp of resource last modification (UTC)", + "type": { + "$id": "210", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "211", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedAt", + "serializationOptions": { + "$id": "212", + "json": { + "$id": "213", + "name": "lastModifiedAt" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.systemData", + "serializationOptions": { + "$id": "214", + "json": { + "$id": "215", + "name": "systemData" + } + } + } + ] + }, + "properties": [ + { + "$id": "216", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "217", + "kind": "dict", + "keyType": { + "$id": "218", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "219", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.tags", + "serializationOptions": { + "$id": "220", + "json": { + "$id": "221", + "name": "tags" + } + } + }, + { + "$id": "222", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The geo-location where the resource lives", + "type": { + "$id": "223", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.location", + "serializationOptions": { + "$id": "224", + "json": { + "$id": "225", + "name": "location" + } + } + } + ] + }, + "properties": [ + { + "$id": "226", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "227", + "kind": "model", + "name": "StandbyVirtualMachinePoolProperties", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the StandbyVirtualMachinePool.", + "decorators": [], + "properties": [ + { + "$id": "228", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies the elasticity profile of the standby virtual machine pools.", + "type": { + "$id": "229", + "kind": "model", + "name": "StandbyVirtualMachinePoolElasticityProfile", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolElasticityProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the elasticity profile.", + "decorators": [], + "properties": [ + { + "$id": "230", + "kind": "property", + "name": "maxReadyCapacity", + "serializedName": "maxReadyCapacity", + "doc": "Specifies the maximum number of virtual machines in the standby virtual machine pool.", + "type": { + "$id": "231", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolElasticityProfile.maxReadyCapacity", + "serializationOptions": { + "$id": "232", + "json": { + "$id": "233", + "name": "maxReadyCapacity" + } + } + }, + { + "$id": "234", + "kind": "property", + "name": "minReadyCapacity", + "serializedName": "minReadyCapacity", + "doc": "Specifies the desired minimum number of virtual machines in the standby virtual machine pool. MinReadyCapacity cannot exceed MaxReadyCapacity.", + "type": { + "$id": "235", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolElasticityProfile.minReadyCapacity", + "serializationOptions": { + "$id": "236", + "json": { + "$id": "237", + "name": "minReadyCapacity" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.elasticityProfile", + "serializationOptions": { + "$id": "238", + "json": { + "$id": "239", + "name": "elasticityProfile" + } + } + }, + { + "$id": "240", + "kind": "property", + "name": "virtualMachineState", + "serializedName": "virtualMachineState", + "doc": "Specifies the desired state of virtual machines in the pool.", + "type": { + "$ref": "14" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.virtualMachineState", + "serializationOptions": { + "$id": "241", + "json": { + "$id": "242", + "name": "virtualMachineState" + } + } + }, + { + "$id": "243", + "kind": "property", + "name": "attachedVirtualMachineScaleSetId", + "serializedName": "attachedVirtualMachineScaleSetId", + "doc": "Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to.", + "type": { + "$id": "244", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "245", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.attachedVirtualMachineScaleSetId", + "serializationOptions": { + "$id": "246", + "json": { + "$id": "247", + "name": "attachedVirtualMachineScaleSetId" + } + } + }, + { + "$id": "248", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "22" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.provisioningState", + "serializationOptions": { + "$id": "249", + "json": { + "$id": "250", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResource.properties", + "serializationOptions": { + "$id": "251", + "json": { + "$id": "252", + "name": "properties" + } + } + }, + { + "$id": "253", + "kind": "path", + "name": "name", + "serializedName": "name", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "254", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResource.name", + "discriminator": false, + "flatten": false + } + ] + }, + { + "$ref": "227" + }, + { + "$ref": "229" + }, + { + "$ref": "172" + }, + { + "$ref": "173" + }, + { + "$ref": "189" + }, + { + "$id": "255", + "kind": "model", + "name": "ArmOperationStatusResourceProvisioningState", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus", + "usage": "LroPolling", + "doc": "Standard Azure Resource Manager operation status response", + "decorators": [], + "properties": [ + { + "$id": "256", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The operation status", + "type": { + "$ref": "42" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.status", + "serializationOptions": { + "$id": "257", + "json": { + "$id": "258", + "name": "status" + } + } + }, + { + "$id": "259", + "kind": "path", + "name": "id", + "serializedName": "id", + "doc": "The unique identifier for the operationStatus resource", + "type": { + "$id": "260", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.id", + "discriminator": false, + "flatten": false + }, + { + "$id": "261", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operationStatus resource", + "type": { + "$id": "262", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.name", + "serializationOptions": { + "$id": "263", + "json": { + "$id": "264", + "name": "name" + } + } + }, + { + "$id": "265", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "Operation start time", + "type": { + "$id": "266", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.startTime", + "serializationOptions": { + "$id": "268", + "json": { + "$id": "269", + "name": "startTime" + } + } + }, + { + "$id": "270", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "Operation complete time", + "type": { + "$id": "271", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "272", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.endTime", + "serializationOptions": { + "$id": "273", + "json": { + "$id": "274", + "name": "endTime" + } + } + }, + { + "$id": "275", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "doc": "The progress made toward completing the operation", + "type": { + "$id": "276", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.percentComplete", + "serializationOptions": { + "$id": "277", + "json": { + "$id": "278", + "name": "percentComplete" + } + } + }, + { + "$id": "279", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Errors that occurred if the operation ended with Canceled or Failed status", + "type": { + "$ref": "139" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.error", + "serializationOptions": { + "$id": "280", + "json": { + "$id": "281", + "name": "error" + } + } + } + ] + }, + { + "$id": "282", + "kind": "model", + "name": "StandbyVirtualMachinePoolResourceUpdate", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "usage": "Input,Json", + "doc": "The type used for update operations of the StandbyVirtualMachinePoolResource.", + "decorators": [], + "properties": [ + { + "$id": "283", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "284", + "kind": "dict", + "keyType": { + "$id": "285", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "286", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.tags", + "serializationOptions": { + "$id": "287", + "json": { + "$id": "288", + "name": "tags" + } + } + }, + { + "$id": "289", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "290", + "kind": "model", + "name": "StandbyVirtualMachinePoolResourceUpdateProperties", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "usage": "Input,Json", + "doc": "The updatable properties of the StandbyVirtualMachinePoolResource.", + "decorators": [], + "properties": [ + { + "$id": "291", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies the elasticity profile of the standby virtual machine pools.", + "type": { + "$ref": "229" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.elasticityProfile", + "serializationOptions": { + "$id": "292", + "json": { + "$id": "293", + "name": "elasticityProfile" + } + } + }, + { + "$id": "294", + "kind": "property", + "name": "virtualMachineState", + "serializedName": "virtualMachineState", + "doc": "Specifies the desired state of virtual machines in the pool.", + "type": { + "$ref": "14" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.virtualMachineState", + "serializationOptions": { + "$id": "295", + "json": { + "$id": "296", + "name": "virtualMachineState" + } + } + }, + { + "$id": "297", + "kind": "property", + "name": "attachedVirtualMachineScaleSetId", + "serializedName": "attachedVirtualMachineScaleSetId", + "doc": "Specifies the fully qualified resource ID of a virtual machine scale set the pool is attached to.", + "type": { + "$id": "298", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "299", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.attachedVirtualMachineScaleSetId", + "serializationOptions": { + "$id": "300", + "json": { + "$id": "301", + "name": "attachedVirtualMachineScaleSetId" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.properties", + "serializationOptions": { + "$id": "302", + "json": { + "$id": "303", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "290" + }, + { + "$id": "304", + "kind": "model", + "name": "StandbyVirtualMachinePoolResourceListResult", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyVirtualMachinePoolResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "305", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyVirtualMachinePoolResource items on this page", + "type": { + "$id": "306", + "kind": "array", + "name": "ArrayStandbyVirtualMachinePoolResource", + "valueType": { + "$ref": "171" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "307", + "json": { + "$id": "308", + "name": "value" + } + } + }, + { + "$id": "309", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "310", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "311", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "312", + "json": { + "$id": "313", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "314", + "kind": "model", + "name": "StandbyVirtualMachine", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResource", + "usage": "Output,Json", + "doc": "Concrete proxy resource types can be created by aliasing this type using a specific property type.", + "decorators": [], + "baseModel": { + "$id": "315", + "kind": "model", + "name": "ProxyResource", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ProxyResource", + "usage": "Output,Json", + "doc": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", + "decorators": [], + "baseModel": { + "$ref": "173" + }, + "properties": [] + }, + "properties": [ + { + "$id": "316", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "317", + "kind": "model", + "name": "StandbyVirtualMachineProperties", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResourceProperties", + "usage": "Output,Json", + "doc": "Details of the StandbyVirtualMachine.", + "decorators": [], + "properties": [ + { + "$id": "318", + "kind": "property", + "name": "virtualMachineResourceId", + "serializedName": "virtualMachineResourceId", + "doc": "Resource id of the virtual machine.", + "type": { + "$id": "319", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "320", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResourceProperties.virtualMachineResourceId", + "serializationOptions": { + "$id": "321", + "json": { + "$id": "322", + "name": "virtualMachineResourceId" + } + } + }, + { + "$id": "323", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "22" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResourceProperties.provisioningState", + "serializationOptions": { + "$id": "324", + "json": { + "$id": "325", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResource.properties", + "serializationOptions": { + "$id": "326", + "json": { + "$id": "327", + "name": "properties" + } + } + }, + { + "$id": "328", + "kind": "path", + "name": "name", + "serializedName": "name", + "doc": "Name of the standby virtual machine", + "type": { + "$id": "329", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResource.name", + "discriminator": false, + "flatten": false + } + ] + }, + { + "$ref": "317" + }, + { + "$ref": "315" + }, + { + "$id": "330", + "kind": "model", + "name": "StandbyVirtualMachineResourceListResult", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyVirtualMachineResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "331", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyVirtualMachineResource items on this page", + "type": { + "$id": "332", + "kind": "array", + "name": "ArrayStandbyVirtualMachineResource", + "valueType": { + "$ref": "314" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "333", + "json": { + "$id": "334", + "name": "value" + } + } + }, + { + "$id": "335", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "336", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "337", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "338", + "json": { + "$id": "339", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "340", + "kind": "model", + "name": "StandbyVirtualMachinePoolRuntimeView", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResource", + "usage": "Output,Json", + "doc": "Contains information about a standby virtual machine pool as last known by the StandbyPool resource provider.", + "decorators": [], + "baseModel": { + "$ref": "315" + }, + "properties": [ + { + "$id": "341", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "342", + "kind": "model", + "name": "StandbyVirtualMachinePoolRuntimeViewProperties", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties", + "usage": "Output,Json", + "doc": "Contains information about a standby pool as last known by the StandbyPool resource provider.", + "decorators": [], + "properties": [ + { + "$id": "343", + "kind": "property", + "name": "instanceCountSummary", + "serializedName": "instanceCountSummary", + "doc": "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 without zone values. Note: any resources in the Running state may still be installing extensions / not fully provisioned.", + "type": { + "$id": "344", + "kind": "array", + "name": "ArrayVirtualMachineInstanceCountSummary", + "valueType": { + "$id": "345", + "kind": "model", + "name": "StandbyVirtualMachineInstanceCountSummary", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineInstanceCountSummary", + "usage": "Output,Json", + "doc": "Contains the counts of VMs in each power state in a given zone, fault domain, as known by the StandbyPool resource provider. Note: any resources in the Running state may still be installing extensions / not fully provisioned.", + "decorators": [], + "properties": [ + { + "$id": "346", + "kind": "property", + "name": "zone", + "serializedName": "zone", + "doc": "The zone that the provided counts are in. It will not have a value if zones are not enabled on the attached VMSS.", + "type": { + "$id": "347", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineInstanceCountSummary.zone", + "serializationOptions": { + "$id": "348", + "json": { + "$id": "349", + "name": "zone" + } + } + }, + { + "$id": "350", + "kind": "property", + "name": "StandbyVirtualMachineInstanceCountsByState", + "serializedName": "instanceCountsByState", + "doc": "The count of pooled virtual machines in each state for the given zone.", + "type": { + "$id": "351", + "kind": "array", + "name": "ArrayPoolVirtualMachineStateCount", + "valueType": { + "$id": "352", + "kind": "model", + "name": "PoolVirtualMachineStateCount", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolVirtualMachineStateCount", + "usage": "Output,Json", + "doc": "Displays the counts of pooled virtual machines in each state, as known by the StandbyPool resource provider.", + "decorators": [], + "properties": [ + { + "$id": "353", + "kind": "property", + "name": "state", + "serializedName": "state", + "doc": "The state that the pooled virtual machines count is for.", + "type": { + "$ref": "50" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolVirtualMachineStateCount.state", + "serializationOptions": { + "$id": "354", + "json": { + "$id": "355", + "name": "state" + } + } + }, + { + "$id": "356", + "kind": "property", + "name": "count", + "serializedName": "count", + "doc": "The count of pooled virtual machines in the given state.", + "type": { + "$id": "357", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolVirtualMachineStateCount.count", + "serializationOptions": { + "$id": "358", + "json": { + "$id": "359", + "name": "count" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineInstanceCountSummary.instanceCountsByState", + "serializationOptions": { + "$id": "360", + "json": { + "$id": "361", + "name": "instanceCountsByState" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties.instanceCountSummary", + "serializationOptions": { + "$id": "362", + "json": { + "$id": "363", + "name": "instanceCountSummary" + } + } + }, + { + "$id": "364", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "Display status of the standby pool", + "type": { + "$id": "365", + "kind": "model", + "name": "StandbyPoolStatus", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolStatus", + "usage": "Output,Json", + "doc": "Displays StandbyPool status.", + "decorators": [], + "properties": [ + { + "$id": "366", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "Displays the healthy state of the StandbyPool.", + "type": { + "$ref": "68" + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolStatus.code", + "serializationOptions": { + "$id": "367", + "json": { + "$id": "368", + "name": "code" + } + } + }, + { + "$id": "369", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "Displays the StandbyPool health state details.", + "type": { + "$id": "370", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolStatus.message", + "serializationOptions": { + "$id": "371", + "json": { + "$id": "372", + "name": "message" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties.status", + "serializationOptions": { + "$id": "373", + "json": { + "$id": "374", + "name": "status" + } + } + }, + { + "$id": "375", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Displays the provisioning state of the standby pool", + "type": { + "$ref": "22" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties.provisioningState", + "serializationOptions": { + "$id": "376", + "json": { + "$id": "377", + "name": "provisioningState" + } + } + }, + { + "$id": "378", + "kind": "property", + "name": "prediction", + "serializedName": "prediction", + "doc": "Displays prediction information of the standby pool", + "type": { + "$id": "379", + "kind": "model", + "name": "StandbyVirtualMachinePoolPrediction", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolPrediction", + "usage": "Output,Json", + "doc": "Displays prediction information of the standby pool.", + "decorators": [], + "properties": [ + { + "$id": "380", + "kind": "property", + "name": "forecastValues", + "serializedName": "forecastValues", + "doc": "Displays the forecast information of the standby pool.", + "type": { + "$id": "381", + "kind": "model", + "name": "StandbyVirtualMachinePoolForecastValues", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolForecastValues", + "usage": "Output,Json", + "doc": "Displays the forecast information of the standby pool.", + "decorators": [], + "properties": [ + { + "$id": "382", + "kind": "property", + "name": "instancesRequestedCount", + "serializedName": "instancesRequestedCount", + "doc": "Displays the predicted count of instances to be requested from the standby pool.", + "type": { + "$id": "383", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "384", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolForecastValues.instancesRequestedCount", + "serializationOptions": { + "$id": "385", + "json": { + "$id": "386", + "name": "instancesRequestedCount" + } + } + } + ] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolPrediction.forecastValues", + "serializationOptions": { + "$id": "387", + "json": { + "$id": "388", + "name": "forecastValues" + } + } + }, + { + "$id": "389", + "kind": "property", + "name": "forecastStartTime", + "serializedName": "forecastStartTime", + "doc": "Displays the UTC timestamp of when the prediction was retrieved for the standby pool.", + "type": { + "$id": "390", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "391", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolPrediction.forecastStartTime", + "serializationOptions": { + "$id": "392", + "json": { + "$id": "393", + "name": "forecastStartTime" + } + } + }, + { + "$id": "394", + "kind": "property", + "name": "forecastInfo", + "serializedName": "forecastInfo", + "doc": "Displays additional information for the prediction of the standby pool.", + "type": { + "$id": "395", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolPrediction.forecastInfo", + "serializationOptions": { + "$id": "396", + "json": { + "$id": "397", + "name": "forecastInfo" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties.prediction", + "serializationOptions": { + "$id": "398", + "json": { + "$id": "399", + "name": "prediction" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResource.properties", + "serializationOptions": { + "$id": "400", + "json": { + "$id": "401", + "name": "properties" + } + } + }, + { + "$id": "402", + "kind": "path", + "name": "name", + "serializedName": "name", + "doc": "The unique identifier for the runtime view. The input string should be the word 'latest', which will get the latest runtime view of the pool, otherwise the request will fail with NotFound exception.", + "type": { + "$id": "403", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResource.name", + "discriminator": false, + "flatten": false + } + ] + }, + { + "$ref": "342" + }, + { + "$ref": "345" + }, + { + "$ref": "352" + }, + { + "$ref": "365" + }, + { + "$ref": "379" + }, + { + "$ref": "381" + }, + { + "$id": "404", + "kind": "model", + "name": "StandbyVirtualMachinePoolRuntimeViewResourceListResult", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyVirtualMachinePoolRuntimeViewResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "405", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyVirtualMachinePoolRuntimeViewResource items on this page", + "type": { + "$id": "406", + "kind": "array", + "name": "ArrayStandbyVirtualMachinePoolRuntimeViewResource", + "valueType": { + "$ref": "340" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "407", + "json": { + "$id": "408", + "name": "value" + } + } + }, + { + "$id": "409", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "410", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "411", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "412", + "json": { + "$id": "413", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "414", + "kind": "model", + "name": "StandbyContainerGroupPool", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "A StandbyContainerGroupPoolResource.", + "decorators": [], + "baseModel": { + "$ref": "172" + }, + "properties": [ + { + "$id": "415", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "416", + "kind": "model", + "name": "StandbyContainerGroupPoolProperties", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the StandbyContainerGroupPool.", + "decorators": [], + "properties": [ + { + "$id": "417", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies elasticity profile of standby container group pools.", + "type": { + "$id": "418", + "kind": "model", + "name": "StandbyContainerGroupPoolElasticityProfile", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolElasticityProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Specifies the elasticity profile of the standby container group pools.", + "decorators": [], + "properties": [ + { + "$id": "419", + "kind": "property", + "name": "maxReadyCapacity", + "serializedName": "maxReadyCapacity", + "doc": "Specifies maximum number of standby container groups in the standby pool.", + "type": { + "$id": "420", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolElasticityProfile.maxReadyCapacity", + "serializationOptions": { + "$id": "421", + "json": { + "$id": "422", + "name": "maxReadyCapacity" + } + } + }, + { + "$id": "423", + "kind": "property", + "name": "refillPolicy", + "serializedName": "refillPolicy", + "doc": "Specifies refill policy of the pool.", + "type": { + "$ref": "74" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolElasticityProfile.refillPolicy", + "serializationOptions": { + "$id": "424", + "json": { + "$id": "425", + "name": "refillPolicy" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties.elasticityProfile", + "serializationOptions": { + "$id": "426", + "json": { + "$id": "427", + "name": "elasticityProfile" + } + } + }, + { + "$id": "428", + "kind": "property", + "name": "containerGroupProperties", + "serializedName": "containerGroupProperties", + "doc": "Specifies container group properties of standby container group pools.", + "type": { + "$id": "429", + "kind": "model", + "name": "StandbyContainerGroupProperties", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProperties", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the ContainerGroupProperties.", + "decorators": [], + "properties": [ + { + "$id": "430", + "kind": "property", + "name": "containerGroupProfile", + "serializedName": "containerGroupProfile", + "doc": "Specifies container group profile of standby container groups.", + "type": { + "$id": "431", + "kind": "model", + "name": "StandbyContainerGroupProfile", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProfile", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Details of the ContainerGroupProfile.", + "decorators": [], + "properties": [ + { + "$id": "432", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Specifies container group profile id of standby container groups.", + "type": { + "$id": "433", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "434", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProfile.id", + "serializationOptions": { + "$id": "435", + "json": { + "$id": "436", + "name": "id" + } + } + }, + { + "$id": "437", + "kind": "property", + "name": "revision", + "serializedName": "revision", + "doc": "Specifies revision of container group profile.", + "type": { + "$id": "438", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProfile.revision", + "serializationOptions": { + "$id": "439", + "json": { + "$id": "440", + "name": "revision" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProperties.containerGroupProfile", + "serializationOptions": { + "$id": "441", + "json": { + "$id": "442", + "name": "containerGroupProfile" + } + } + }, + { + "$id": "443", + "kind": "property", + "name": "subnetIds", + "serializedName": "subnetIds", + "doc": "Specifies subnet Ids for container group.", + "type": { + "$id": "444", + "kind": "array", + "name": "ArraySubnet", + "valueType": { + "$id": "445", + "kind": "model", + "name": "Subnet", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.Subnet", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "Subnet of container group", + "decorators": [], + "properties": [ + { + "$id": "446", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Specifies ARM resource id of the subnet.", + "type": { + "$id": "447", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "448", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.Subnet.id", + "serializationOptions": { + "$id": "449", + "json": { + "$id": "450", + "name": "id" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProperties.subnetIds", + "serializationOptions": { + "$id": "451", + "json": { + "$id": "452", + "name": "subnetIds" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties.containerGroupProperties", + "serializationOptions": { + "$id": "453", + "json": { + "$id": "454", + "name": "containerGroupProperties" + } + } + }, + { + "$id": "455", + "kind": "property", + "name": "zones", + "serializedName": "zones", + "doc": "Specifies zones of standby container group pools.", + "type": { + "$id": "456", + "kind": "array", + "name": "Array1", + "valueType": { + "$id": "457", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties.zones", + "serializationOptions": { + "$id": "458", + "json": { + "$id": "459", + "name": "zones" + } + } + }, + { + "$id": "460", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "22" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties.provisioningState", + "serializationOptions": { + "$id": "461", + "json": { + "$id": "462", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResource.properties", + "serializationOptions": { + "$id": "463", + "json": { + "$id": "464", + "name": "properties" + } + } + }, + { + "$id": "465", + "kind": "path", + "name": "name", + "serializedName": "name", + "doc": "Name of the standby container group pool", + "type": { + "$id": "466", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResource.name", + "discriminator": false, + "flatten": false + } + ] + }, + { + "$ref": "416" + }, + { + "$ref": "418" + }, + { + "$ref": "429" + }, + { + "$ref": "431" + }, + { + "$ref": "445" + }, + { + "$id": "467", + "kind": "model", + "name": "StandbyContainerGroupPoolResourceUpdate", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "usage": "Input,Json", + "doc": "The type used for update operations of the StandbyContainerGroupPoolResource.", + "decorators": [], + "properties": [ + { + "$id": "468", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "469", + "kind": "dict", + "keyType": { + "$id": "470", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "471", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.tags", + "serializationOptions": { + "$id": "472", + "json": { + "$id": "473", + "name": "tags" + } + } + }, + { + "$id": "474", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "475", + "kind": "model", + "name": "StandbyContainerGroupPoolResourceUpdateProperties", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "usage": "Input,Json", + "doc": "The updatable properties of the StandbyContainerGroupPoolResource.", + "decorators": [], + "properties": [ + { + "$id": "476", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies elasticity profile of standby container group pools.", + "type": { + "$ref": "418" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.elasticityProfile", + "serializationOptions": { + "$id": "477", + "json": { + "$id": "478", + "name": "elasticityProfile" + } + } + }, + { + "$id": "479", + "kind": "property", + "name": "containerGroupProperties", + "serializedName": "containerGroupProperties", + "doc": "Specifies container group properties of standby container group pools.", + "type": { + "$ref": "429" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.containerGroupProperties", + "serializationOptions": { + "$id": "480", + "json": { + "$id": "481", + "name": "containerGroupProperties" + } + } + }, + { + "$id": "482", + "kind": "property", + "name": "zones", + "serializedName": "zones", + "doc": "Specifies zones of standby container group pools.", + "type": { + "$id": "483", + "kind": "array", + "name": "Array1", + "valueType": { + "$id": "484", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.zones", + "serializationOptions": { + "$id": "485", + "json": { + "$id": "486", + "name": "zones" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.properties", + "serializationOptions": { + "$id": "487", + "json": { + "$id": "488", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "475" + }, + { + "$id": "489", + "kind": "model", + "name": "StandbyContainerGroupPoolResourceListResult", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyContainerGroupPoolResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "490", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyContainerGroupPoolResource items on this page", + "type": { + "$id": "491", + "kind": "array", + "name": "ArrayStandbyContainerGroupPoolResource", + "valueType": { + "$ref": "414" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "492", + "json": { + "$id": "493", + "name": "value" + } + } + }, + { + "$id": "494", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "495", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "496", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "497", + "json": { + "$id": "498", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "499", + "kind": "model", + "name": "StandbyContainerGroupPoolRuntimeView", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResource", + "usage": "Output,Json", + "doc": "Contains information about a standby container group pool as last known by the StandbyPool resource provider.", + "decorators": [], + "baseModel": { + "$ref": "315" + }, + "properties": [ + { + "$id": "500", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "501", + "kind": "model", + "name": "StandbyContainerGroupPoolRuntimeViewProperties", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties", + "usage": "Output,Json", + "doc": "Contains information about a standby pool as last known by the StandbyPool resource provider.", + "decorators": [], + "properties": [ + { + "$id": "502", + "kind": "property", + "name": "instanceCountSummary", + "serializedName": "instanceCountSummary", + "doc": "A list containing the counts of container groups in each possible state, as known by the StandbyPool resource provider.", + "type": { + "$id": "503", + "kind": "array", + "name": "ArrayContainerGroupInstanceCountSummary", + "valueType": { + "$id": "504", + "kind": "model", + "name": "ContainerGroupInstanceCountSummary", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupInstanceCountSummary", + "usage": "Output,Json", + "doc": "Displays the counts of container groups in each state, as known by the StandbyPool resource provider.", + "decorators": [], + "properties": [ + { + "$id": "505", + "kind": "property", + "name": "zone", + "serializedName": "zone", + "doc": "The zone that the provided counts are in. It will not have a value if zones are not enabled.", + "type": { + "$id": "506", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupInstanceCountSummary.zone", + "serializationOptions": { + "$id": "507", + "json": { + "$id": "508", + "name": "zone" + } + } + }, + { + "$id": "509", + "kind": "property", + "name": "StandbyContainerGroupInstanceCountsByState", + "serializedName": "instanceCountsByState", + "doc": "The count of pooled container groups in each state for the given zone.", + "type": { + "$id": "510", + "kind": "array", + "name": "ArrayPoolContainerGroupStateCount", + "valueType": { + "$id": "511", + "kind": "model", + "name": "PoolContainerGroupStateCount", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolContainerGroupStateCount", + "usage": "Output,Json", + "doc": "Displays the counts of pooled container groups in each state, as known by the StandbyPool resource provider.", + "decorators": [], + "properties": [ + { + "$id": "512", + "kind": "property", + "name": "state", + "serializedName": "state", + "doc": "The state that the pooled container groups count is for.", + "type": { + "$ref": "78" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolContainerGroupStateCount.state", + "serializationOptions": { + "$id": "513", + "json": { + "$id": "514", + "name": "state" + } + } + }, + { + "$id": "515", + "kind": "property", + "name": "count", + "serializedName": "count", + "doc": "The count of pooled container groups in the given state.", + "type": { + "$id": "516", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolContainerGroupStateCount.count", + "serializationOptions": { + "$id": "517", + "json": { + "$id": "518", + "name": "count" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupInstanceCountSummary.instanceCountsByState", + "serializationOptions": { + "$id": "519", + "json": { + "$id": "520", + "name": "instanceCountsByState" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties.instanceCountSummary", + "serializationOptions": { + "$id": "521", + "json": { + "$id": "522", + "name": "instanceCountSummary" + } + } + }, + { + "$id": "523", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "Display status of the standby pool", + "type": { + "$ref": "365" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties.status", + "serializationOptions": { + "$id": "524", + "json": { + "$id": "525", + "name": "status" + } + } + }, + { + "$id": "526", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Displays the provisioning state of the standby pool", + "type": { + "$ref": "22" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties.provisioningState", + "serializationOptions": { + "$id": "527", + "json": { + "$id": "528", + "name": "provisioningState" + } + } + }, + { + "$id": "529", + "kind": "property", + "name": "prediction", + "serializedName": "prediction", + "doc": "Displays prediction information of the standby pool", + "type": { + "$id": "530", + "kind": "model", + "name": "StandbyContainerGroupPoolPrediction", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolPrediction", + "usage": "Output,Json", + "doc": "Displays prediction information of the standby pool.", + "decorators": [], + "properties": [ + { + "$id": "531", + "kind": "property", + "name": "forecastValues", + "serializedName": "forecastValues", + "doc": "Displays the forecast information of the standby pool.", + "type": { + "$id": "532", + "kind": "model", + "name": "StandbyContainerGroupPoolForecastValues", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolForecastValues", + "usage": "Output,Json", + "doc": "Displays the forecast information of the standby pool.", + "decorators": [], + "properties": [ + { + "$id": "533", + "kind": "property", + "name": "instancesRequestedCount", + "serializedName": "instancesRequestedCount", + "doc": "Displays the predicted count of instances to be requested from the standby pool.", + "type": { + "$id": "534", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "535", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolForecastValues.instancesRequestedCount", + "serializationOptions": { + "$id": "536", + "json": { + "$id": "537", + "name": "instancesRequestedCount" + } + } + } + ] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolPrediction.forecastValues", + "serializationOptions": { + "$id": "538", + "json": { + "$id": "539", + "name": "forecastValues" + } + } + }, + { + "$id": "540", + "kind": "property", + "name": "forecastStartTime", + "serializedName": "forecastStartTime", + "doc": "Displays the UTC timestamp of when the prediction was retrieved for the standby pool.", + "type": { + "$id": "541", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "542", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolPrediction.forecastStartTime", + "serializationOptions": { + "$id": "543", + "json": { + "$id": "544", + "name": "forecastStartTime" + } + } + }, + { + "$id": "545", + "kind": "property", + "name": "forecastInfo", + "serializedName": "forecastInfo", + "doc": "Displays additional information for the prediction of the standby pool.", + "type": { + "$id": "546", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolPrediction.forecastInfo", + "serializationOptions": { + "$id": "547", + "json": { + "$id": "548", + "name": "forecastInfo" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties.prediction", + "serializationOptions": { + "$id": "549", + "json": { + "$id": "550", + "name": "prediction" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResource.properties", + "serializationOptions": { + "$id": "551", + "json": { + "$id": "552", + "name": "properties" + } + } + }, + { + "$id": "553", + "kind": "path", + "name": "name", + "serializedName": "name", + "doc": "The unique identifier for the runtime view. The input string should be the word 'latest', which will get the latest runtime view of the pool, otherwise the request will fail with NotFound exception.", + "type": { + "$id": "554", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResource.name", + "discriminator": false, + "flatten": false + } + ] + }, + { + "$ref": "501" + }, + { + "$ref": "504" + }, + { + "$ref": "511" + }, + { + "$ref": "530" + }, + { + "$ref": "532" + }, + { + "$id": "555", + "kind": "model", + "name": "StandbyContainerGroupPoolRuntimeViewResourceListResult", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a StandbyContainerGroupPoolRuntimeViewResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "556", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyContainerGroupPoolRuntimeViewResource items on this page", + "type": { + "$id": "557", + "kind": "array", + "name": "ArrayStandbyContainerGroupPoolRuntimeViewResource", + "valueType": { + "$ref": "499" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "558", + "json": { + "$id": "559", + "name": "value" + } + } + }, + { + "$id": "560", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "561", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "562", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "$id": "563", + "json": { + "$id": "564", + "name": "nextLink" + } + } + } + ] + } + ], + "clients": [ + { + "$id": "565", + "kind": "client", + "name": "StandbyPoolClient", + "namespace": "Azure.ResourceManager.StandbyPool", + "methods": [], + "parameters": [ + { + "$id": "566", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "567", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client", + "defaultValue": { + "$id": "568", + "type": { + "$id": "569", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [ + { + "$id": "570", + "name": "TypeSpec.@service", + "arguments": { + "$id": "571", + "options": { + "$id": "572", + "title": "Microsoft.StandbyPool" + } + } + } + ], + "crossLanguageDefinitionId": "Microsoft.StandbyPool", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "children": [ + { + "$id": "573", + "kind": "client", + "name": "Operations", + "namespace": "Azure.ResourceManager.StandbyPool", + "methods": [ + { + "$id": "574", + "kind": "paging", + "name": "list", + "accessibility": "internal", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "List the operations for the provider", + "operation": { + "$id": "575", + "name": "list", + "resourceName": "Operations", + "doc": "List the operations for the provider", + "accessibility": "internal", + "parameters": [ + { + "$id": "576", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "577", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "578", + "type": { + "$id": "579", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "580", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "581", + "kind": "constant", + "valueType": { + "$id": "582", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "583", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "92" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/providers/Microsoft.StandbyPool/operations", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "decorators": [], + "examples": [ + { + "$id": "584", + "kind": "http", + "name": "Operations_List", + "description": "Operations_List", + "filePath": "2025-03-01/Operations_List.json", + "parameters": [ + { + "$id": "585", + "parameter": { + "$ref": "576" + }, + "value": { + "$id": "586", + "kind": "string", + "type": { + "$ref": "577" + }, + "value": "2025-03-01" + } + } + ], + "responses": [ + { + "$id": "587", + "response": { + "$ref": "583" + }, + "statusCode": 200, + "bodyValue": { + "$id": "588", + "kind": "model", + "type": { + "$ref": "92" + }, + "value": { + "$id": "589", + "value": { + "$id": "590", + "kind": "array", + "type": { + "$ref": "94" + }, + "value": [ + { + "$id": "591", + "kind": "model", + "type": { + "$ref": "95" + }, + "value": { + "$id": "592", + "name": { + "$id": "593", + "kind": "string", + "type": { + "$ref": "97" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools/write" + }, + "isDataAction": { + "$id": "594", + "kind": "boolean", + "type": { + "$ref": "101" + }, + "value": true + }, + "display": { + "$id": "595", + "kind": "model", + "type": { + "$ref": "105" + }, + "value": { + "$id": "596", + "provider": { + "$id": "597", + "kind": "string", + "type": { + "$ref": "107" + }, + "value": "Microsoft.StandbyPool" + }, + "resource": { + "$id": "598", + "kind": "string", + "type": { + "$ref": "111" + }, + "value": "standbyContainerGroupPools" + }, + "operation": { + "$id": "599", + "kind": "string", + "type": { + "$ref": "115" + }, + "value": "StandbyContainerGroupPools_Create" + }, + "description": { + "$id": "600", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "Create a StandbyContainerGroupPools Resource" + } + } + }, + "origin": { + "$id": "601", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "user" + }, + "actionType": { + "$id": "602", + "kind": "string", + "type": { + "$ref": "10" + }, + "value": "Internal" + } + } + } + ] + }, + "nextLink": { + "$id": "603", + "kind": "string", + "type": { + "$ref": "133" + }, + "value": "https://example.com/providers/Microsoft.StandbyPool/operations" + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "604", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "581" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "605", + "type": { + "$id": "606", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$ref": "95" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "pagingMetadata": { + "$id": "607", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "608", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "609", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "610", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client", + "defaultValue": { + "$id": "611", + "type": { + "$id": "612", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.Operations", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "parent": { + "$ref": "565" + } + }, + { + "$id": "613", + "kind": "client", + "name": "StandbyVirtualMachinePools", + "namespace": "Azure.ResourceManager.StandbyPool", + "methods": [ + { + "$id": "614", + "kind": "basic", + "name": "get", + "accessibility": "public", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "Get a StandbyVirtualMachinePoolResource", + "operation": { + "$id": "615", + "name": "get", + "resourceName": "StandbyVirtualMachinePoolResource", + "doc": "Get a StandbyVirtualMachinePoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "616", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "617", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "618", + "type": { + "$id": "619", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "620", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "621", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "622", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "623", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "624", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "625", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "626", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "627", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "628", + "kind": "constant", + "valueType": { + "$id": "629", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "630", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "171" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.get", + "decorators": [], + "examples": [ + { + "$id": "631", + "kind": "http", + "name": "StandbyVirtualMachinePools_Get", + "description": "StandbyVirtualMachinePools_Get", + "filePath": "2025-03-01/StandbyVirtualMachinePools_Get.json", + "parameters": [ + { + "$id": "632", + "parameter": { + "$ref": "616" + }, + "value": { + "$id": "633", + "kind": "string", + "type": { + "$ref": "617" + }, + "value": "2025-03-01" + } + }, + { + "$id": "634", + "parameter": { + "$ref": "620" + }, + "value": { + "$id": "635", + "kind": "string", + "type": { + "$ref": "621" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "636", + "parameter": { + "$ref": "623" + }, + "value": { + "$id": "637", + "kind": "string", + "type": { + "$ref": "624" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "638", + "parameter": { + "$ref": "625" + }, + "value": { + "$id": "639", + "kind": "string", + "type": { + "$ref": "626" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "640", + "response": { + "$ref": "630" + }, + "statusCode": 200, + "bodyValue": { + "$id": "641", + "kind": "model", + "type": { + "$ref": "171" + }, + "value": { + "$id": "642", + "properties": { + "$id": "643", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "$id": "644", + "elasticityProfile": { + "$id": "645", + "kind": "model", + "type": { + "$ref": "229" + }, + "value": { + "$id": "646", + "maxReadyCapacity": { + "$id": "647", + "kind": "number", + "type": { + "$ref": "231" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "648", + "kind": "number", + "type": { + "$ref": "235" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "649", + "kind": "string", + "type": { + "$ref": "14" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "650", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "651", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "652", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "653" + } + }, + "location": { + "$id": "654", + "kind": "string", + "type": { + "$ref": "223" + }, + "value": "West US" + }, + "id": { + "$id": "655", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "656", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "657", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "658", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "659", + "createdBy": { + "$id": "660", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "661", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "662", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "663", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "664", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "665", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "666", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "667", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "668", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "669", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "670", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "628" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "671", + "type": { + "$ref": "171" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.get" + }, + { + "$id": "672", + "kind": "lro", + "name": "createOrUpdate", + "accessibility": "public", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "Create a StandbyVirtualMachinePoolResource", + "operation": { + "$id": "673", + "name": "createOrUpdate", + "resourceName": "StandbyVirtualMachinePoolResource", + "doc": "Create a StandbyVirtualMachinePoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "674", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "675", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "676", + "type": { + "$id": "677", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "678", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "679", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "680", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "681", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "682", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "683", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "684", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "685", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "686", + "kind": "constant", + "valueType": { + "$id": "687", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "688", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "689", + "kind": "constant", + "valueType": { + "$id": "690", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "691", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "171" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "692", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "171" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "693", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "171" + }, + "headers": [ + { + "$id": "694", + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "695", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.createOrUpdate", + "decorators": [ + { + "$id": "696", + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "$id": "697", + "finalState": "azure-async-operation" + } + } + ], + "examples": [ + { + "$id": "698", + "kind": "http", + "name": "StandbyVirtualMachinePools_CreateOrUpdate", + "description": "StandbyVirtualMachinePools_CreateOrUpdate", + "filePath": "2025-03-01/StandbyVirtualMachinePools_CreateOrUpdate.json", + "parameters": [ + { + "$id": "699", + "parameter": { + "$ref": "674" + }, + "value": { + "$id": "700", + "kind": "string", + "type": { + "$ref": "675" + }, + "value": "2025-03-01" + } + }, + { + "$id": "701", + "parameter": { + "$ref": "678" + }, + "value": { + "$id": "702", + "kind": "string", + "type": { + "$ref": "679" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "703", + "parameter": { + "$ref": "681" + }, + "value": { + "$id": "704", + "kind": "string", + "type": { + "$ref": "682" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "705", + "parameter": { + "$ref": "683" + }, + "value": { + "$id": "706", + "kind": "string", + "type": { + "$ref": "684" + }, + "value": "pool" + } + }, + { + "$id": "707", + "parameter": { + "$ref": "691" + }, + "value": { + "$id": "708", + "kind": "model", + "type": { + "$ref": "171" + }, + "value": { + "$id": "709", + "properties": { + "$id": "710", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "$id": "711", + "elasticityProfile": { + "$id": "712", + "kind": "model", + "type": { + "$ref": "229" + }, + "value": { + "$id": "713", + "maxReadyCapacity": { + "$id": "714", + "kind": "number", + "type": { + "$ref": "231" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "715", + "kind": "number", + "type": { + "$ref": "235" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "716", + "kind": "string", + "type": { + "$ref": "14" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "717", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + } + } + }, + "tags": { + "$id": "718", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "719" + } + }, + "location": { + "$id": "720", + "kind": "string", + "type": { + "$ref": "223" + }, + "value": "West US" + } + } + } + } + ], + "responses": [ + { + "$id": "721", + "response": { + "$ref": "692" + }, + "statusCode": 200, + "bodyValue": { + "$id": "722", + "kind": "model", + "type": { + "$ref": "171" + }, + "value": { + "$id": "723", + "properties": { + "$id": "724", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "$id": "725", + "elasticityProfile": { + "$id": "726", + "kind": "model", + "type": { + "$ref": "229" + }, + "value": { + "$id": "727", + "maxReadyCapacity": { + "$id": "728", + "kind": "number", + "type": { + "$ref": "231" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "729", + "kind": "number", + "type": { + "$ref": "235" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "730", + "kind": "string", + "type": { + "$ref": "14" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "731", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "732", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "733", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "734" + } + }, + "location": { + "$id": "735", + "kind": "string", + "type": { + "$ref": "223" + }, + "value": "West US" + }, + "id": { + "$id": "736", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "737", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "738", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "739", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "740", + "createdBy": { + "$id": "741", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "742", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "743", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "744", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "745", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "746", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + }, + { + "$id": "747", + "response": { + "$ref": "693" + }, + "statusCode": 201, + "bodyValue": { + "$id": "748", + "kind": "model", + "type": { + "$ref": "171" + }, + "value": { + "$id": "749", + "properties": { + "$id": "750", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "$id": "751", + "elasticityProfile": { + "$id": "752", + "kind": "model", + "type": { + "$ref": "229" + }, + "value": { + "$id": "753", + "maxReadyCapacity": { + "$id": "754", + "kind": "number", + "type": { + "$ref": "231" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "755", + "kind": "number", + "type": { + "$ref": "235" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "756", + "kind": "string", + "type": { + "$ref": "14" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "757", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "758", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "759", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "760" + } + }, + "location": { + "$id": "761", + "kind": "string", + "type": { + "$ref": "223" + }, + "value": "West US" + }, + "id": { + "$id": "762", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "763", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "764", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "765", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "766", + "createdBy": { + "$id": "767", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "768", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "769", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "770", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "771", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "772", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "773", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "774", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "775", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "776", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "777", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "171" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "778", + "name": "contentType", + "nameInRequest": "contentType", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "779", + "kind": "constant", + "valueType": { + "$id": "780", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "781", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$id": "782", + "kind": "constant", + "valueType": { + "$id": "783", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "784", + "type": { + "$ref": "171" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.createOrUpdate", + "lroMetadata": { + "$id": "785", + "finalStateVia": 0, + "finalResponse": { + "$id": "786", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "171" + } + } + } + }, + { + "$id": "787", + "kind": "lro", + "name": "delete", + "accessibility": "public", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "Delete a StandbyVirtualMachinePoolResource", + "operation": { + "$id": "788", + "name": "delete", + "resourceName": "StandbyVirtualMachinePoolResource", + "doc": "Delete a StandbyVirtualMachinePoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "789", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "790", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "791", + "type": { + "$id": "792", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "793", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "794", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "795", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "796", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "797", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "798", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "799", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "800", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "801", + "kind": "constant", + "valueType": { + "$id": "802", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "803", + "statusCodes": [ + 202 + ], + "headers": [ + { + "$id": "804", + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "805", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "806", + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "807", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "$id": "808", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.delete", + "decorators": [], + "examples": [ + { + "$id": "809", + "kind": "http", + "name": "StandbyVirtualMachinePools_Delete", + "description": "StandbyVirtualMachinePools_Delete", + "filePath": "2025-03-01/StandbyVirtualMachinePools_Delete.json", + "parameters": [ + { + "$id": "810", + "parameter": { + "$ref": "789" + }, + "value": { + "$id": "811", + "kind": "string", + "type": { + "$ref": "790" + }, + "value": "2025-03-01" + } + }, + { + "$id": "812", + "parameter": { + "$ref": "793" + }, + "value": { + "$id": "813", + "kind": "string", + "type": { + "$ref": "794" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "814", + "parameter": { + "$ref": "796" + }, + "value": { + "$id": "815", + "kind": "string", + "type": { + "$ref": "797" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "816", + "parameter": { + "$ref": "798" + }, + "value": { + "$id": "817", + "kind": "string", + "type": { + "$ref": "799" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "818", + "response": { + "$ref": "803" + }, + "statusCode": 202 + }, + { + "$id": "819", + "response": { + "$ref": "808" + }, + "statusCode": 204 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "820", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "821", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "822", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "823", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "824", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$id": "825", + "kind": "constant", + "valueType": { + "$id": "826", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "827" + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.delete", + "lroMetadata": { + "$id": "828", + "finalStateVia": 1, + "finalResponse": { + "$id": "829", + "statusCodes": [ + 204 + ] + } + } + }, + { + "$id": "830", + "kind": "basic", + "name": "update", + "accessibility": "public", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "Update a StandbyVirtualMachinePoolResource", + "operation": { + "$id": "831", + "name": "update", + "resourceName": "StandbyVirtualMachinePoolResource", + "doc": "Update a StandbyVirtualMachinePoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "832", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "833", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "834", + "type": { + "$id": "835", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "836", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "837", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "838", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "839", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "840", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "841", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "842", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "843", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "844", + "kind": "constant", + "valueType": { + "$id": "845", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "846", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "847", + "kind": "constant", + "valueType": { + "$id": "848", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "849", + "name": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "282" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "850", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "171" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PATCH", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": false, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.update", + "decorators": [], + "examples": [ + { + "$id": "851", + "kind": "http", + "name": "StandbyVirtualMachinePools_Update", + "description": "StandbyVirtualMachinePools_Update", + "filePath": "2025-03-01/StandbyVirtualMachinePools_Update.json", + "parameters": [ + { + "$id": "852", + "parameter": { + "$ref": "832" + }, + "value": { + "$id": "853", + "kind": "string", + "type": { + "$ref": "833" + }, + "value": "2025-03-01" + } + }, + { + "$id": "854", + "parameter": { + "$ref": "836" + }, + "value": { + "$id": "855", + "kind": "string", + "type": { + "$ref": "837" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "856", + "parameter": { + "$ref": "839" + }, + "value": { + "$id": "857", + "kind": "string", + "type": { + "$ref": "840" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "858", + "parameter": { + "$ref": "841" + }, + "value": { + "$id": "859", + "kind": "string", + "type": { + "$ref": "842" + }, + "value": "pool" + } + }, + { + "$id": "860", + "parameter": { + "$ref": "849" + }, + "value": { + "$id": "861", + "kind": "model", + "type": { + "$ref": "282" + }, + "value": { + "$id": "862", + "tags": { + "$id": "863", + "kind": "dict", + "type": { + "$ref": "284" + }, + "value": { + "$id": "864" + } + }, + "properties": { + "$id": "865", + "kind": "model", + "type": { + "$ref": "290" + }, + "value": { + "$id": "866", + "elasticityProfile": { + "$id": "867", + "kind": "model", + "type": { + "$ref": "229" + }, + "value": { + "$id": "868", + "maxReadyCapacity": { + "$id": "869", + "kind": "number", + "type": { + "$ref": "231" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "870", + "kind": "number", + "type": { + "$ref": "235" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "871", + "kind": "string", + "type": { + "$ref": "14" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "872", + "kind": "string", + "type": { + "$ref": "298" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "873", + "response": { + "$ref": "850" + }, + "statusCode": 200, + "bodyValue": { + "$id": "874", + "kind": "model", + "type": { + "$ref": "171" + }, + "value": { + "$id": "875", + "properties": { + "$id": "876", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "$id": "877", + "elasticityProfile": { + "$id": "878", + "kind": "model", + "type": { + "$ref": "229" + }, + "value": { + "$id": "879", + "maxReadyCapacity": { + "$id": "880", + "kind": "number", + "type": { + "$ref": "231" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "881", + "kind": "number", + "type": { + "$ref": "235" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "882", + "kind": "string", + "type": { + "$ref": "14" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "883", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "884", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "885", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "886" + } + }, + "location": { + "$id": "887", + "kind": "string", + "type": { + "$ref": "223" + }, + "value": "West US" + }, + "id": { + "$id": "888", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "889", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "890", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "891", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "892", + "createdBy": { + "$id": "893", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "894", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "895", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "896", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "897", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "898", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "899", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "900", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "901", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "902", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "903", + "name": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "282" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "904", + "name": "contentType", + "nameInRequest": "contentType", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "844" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "905", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "847" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "906", + "type": { + "$ref": "171" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.update" + }, + { + "$id": "907", + "kind": "paging", + "name": "listByResourceGroup", + "accessibility": "public", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "List StandbyVirtualMachinePoolResource resources by resource group", + "operation": { + "$id": "908", + "name": "listByResourceGroup", + "resourceName": "StandbyVirtualMachinePoolResource", + "doc": "List StandbyVirtualMachinePoolResource resources by resource group", + "accessibility": "public", + "parameters": [ + { + "$id": "909", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "910", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "911", + "type": { + "$id": "912", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "913", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "914", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "915", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "916", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "917", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "918", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "919", + "kind": "constant", + "valueType": { + "$id": "920", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "921", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "304" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listByResourceGroup", + "decorators": [], + "examples": [ + { + "$id": "922", + "kind": "http", + "name": "StandbyVirtualMachinePools_ListByResourceGroup", + "description": "StandbyVirtualMachinePools_ListByResourceGroup", + "filePath": "2025-03-01/StandbyVirtualMachinePools_ListByResourceGroup.json", + "parameters": [ + { + "$id": "923", + "parameter": { + "$ref": "909" + }, + "value": { + "$id": "924", + "kind": "string", + "type": { + "$ref": "910" + }, + "value": "2025-03-01" + } + }, + { + "$id": "925", + "parameter": { + "$ref": "913" + }, + "value": { + "$id": "926", + "kind": "string", + "type": { + "$ref": "914" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "927", + "parameter": { + "$ref": "916" + }, + "value": { + "$id": "928", + "kind": "string", + "type": { + "$ref": "917" + }, + "value": "rgstandbypool" + } + } + ], + "responses": [ + { + "$id": "929", + "response": { + "$ref": "921" + }, + "statusCode": 200, + "bodyValue": { + "$id": "930", + "kind": "model", + "type": { + "$ref": "304" + }, + "value": { + "$id": "931", + "value": { + "$id": "932", + "kind": "array", + "type": { + "$ref": "306" + }, + "value": [ + { + "$id": "933", + "kind": "model", + "type": { + "$ref": "171" + }, + "value": { + "$id": "934", + "properties": { + "$id": "935", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "$id": "936", + "elasticityProfile": { + "$id": "937", + "kind": "model", + "type": { + "$ref": "229" + }, + "value": { + "$id": "938", + "maxReadyCapacity": { + "$id": "939", + "kind": "number", + "type": { + "$ref": "231" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "940", + "kind": "number", + "type": { + "$ref": "235" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "941", + "kind": "string", + "type": { + "$ref": "14" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "942", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "943", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "944", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "945" + } + }, + "location": { + "$id": "946", + "kind": "string", + "type": { + "$ref": "223" + }, + "value": "West US" + }, + "id": { + "$id": "947", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "948", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "949", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "950", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "951", + "createdBy": { + "$id": "952", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "953", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "954", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "955", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "956", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "957", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "958", + "kind": "string", + "type": { + "$ref": "310" + }, + "value": "https://example.com/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools" + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "959", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "960", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "961", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "919" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "962", + "type": { + "$id": "963", + "kind": "array", + "name": "ArrayStandbyVirtualMachinePoolResource", + "valueType": { + "$ref": "171" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listByResourceGroup", + "pagingMetadata": { + "$id": "964", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "965", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + }, + { + "$id": "966", + "kind": "paging", + "name": "listBySubscription", + "accessibility": "public", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "List StandbyVirtualMachinePoolResource resources by subscription ID", + "operation": { + "$id": "967", + "name": "listBySubscription", + "resourceName": "StandbyVirtualMachinePoolResource", + "doc": "List StandbyVirtualMachinePoolResource resources by subscription ID", + "accessibility": "public", + "parameters": [ + { + "$id": "968", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "969", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "970", + "type": { + "$id": "971", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "972", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "973", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "974", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "975", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "976", + "kind": "constant", + "valueType": { + "$id": "977", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "978", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "304" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listBySubscription", + "decorators": [], + "examples": [ + { + "$id": "979", + "kind": "http", + "name": "StandbyVirtualMachinePools_ListBySubscription", + "description": "StandbyVirtualMachinePools_ListBySubscription", + "filePath": "2025-03-01/StandbyVirtualMachinePools_ListBySubscription.json", + "parameters": [ + { + "$id": "980", + "parameter": { + "$ref": "968" + }, + "value": { + "$id": "981", + "kind": "string", + "type": { + "$ref": "969" + }, + "value": "2025-03-01" + } + }, + { + "$id": "982", + "parameter": { + "$ref": "972" + }, + "value": { + "$id": "983", + "kind": "string", + "type": { + "$ref": "973" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + } + ], + "responses": [ + { + "$id": "984", + "response": { + "$ref": "978" + }, + "statusCode": 200, + "bodyValue": { + "$id": "985", + "kind": "model", + "type": { + "$ref": "304" + }, + "value": { + "$id": "986", + "value": { + "$id": "987", + "kind": "array", + "type": { + "$ref": "306" + }, + "value": [ + { + "$id": "988", + "kind": "model", + "type": { + "$ref": "171" + }, + "value": { + "$id": "989", + "properties": { + "$id": "990", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "$id": "991", + "elasticityProfile": { + "$id": "992", + "kind": "model", + "type": { + "$ref": "229" + }, + "value": { + "$id": "993", + "maxReadyCapacity": { + "$id": "994", + "kind": "number", + "type": { + "$ref": "231" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "995", + "kind": "number", + "type": { + "$ref": "235" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "996", + "kind": "string", + "type": { + "$ref": "14" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "997", + "kind": "string", + "type": { + "$ref": "244" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "998", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "999", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "1000" + } + }, + "location": { + "$id": "1001", + "kind": "string", + "type": { + "$ref": "223" + }, + "value": "West US" + }, + "id": { + "$id": "1002", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "1003", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "1004", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "1005", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "1006", + "createdBy": { + "$id": "1007", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1008", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "1009", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1010", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1011", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1012", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1013", + "kind": "string", + "type": { + "$ref": "310" + }, + "value": "https://example.com/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools" + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1014", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "976" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1015", + "type": { + "$id": "1016", + "kind": "array", + "name": "ArrayStandbyVirtualMachinePoolResource", + "valueType": { + "$ref": "171" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listBySubscription", + "pagingMetadata": { + "$id": "1017", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1018", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "1019", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "1020", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client", + "defaultValue": { + "$id": "1021", + "type": { + "$id": "1022", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [ + { + "$id": "1023", + "name": "Azure.ResourceManager.@armResourceOperations", + "arguments": { + "$id": "1024" + } + } + ], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "parent": { + "$ref": "565" + } + }, + { + "$id": "1025", + "kind": "client", + "name": "StandbyVirtualMachines", + "namespace": "Azure.ResourceManager.StandbyPool", + "methods": [ + { + "$id": "1026", + "kind": "basic", + "name": "get", + "accessibility": "public", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "Get a StandbyVirtualMachineResource", + "operation": { + "$id": "1027", + "name": "get", + "resourceName": "StandbyVirtualMachineResource", + "doc": "Get a StandbyVirtualMachineResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1028", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1029", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1030", + "type": { + "$id": "1031", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1032", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1033", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1034", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1035", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1036", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1037", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "1038", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1039", + "name": "standbyVirtualMachineName", + "nameInRequest": "standbyVirtualMachineName", + "doc": "Name of the standby virtual machine", + "type": { + "$id": "1040", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1041", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1042", + "kind": "constant", + "valueType": { + "$id": "1043", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1044", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "314" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/standbyVirtualMachines/{standbyVirtualMachineName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachines.get", + "decorators": [], + "examples": [ + { + "$id": "1045", + "kind": "http", + "name": "StandbyVirtualMachines_Get", + "description": "StandbyVirtualMachines_Get", + "filePath": "2025-03-01/StandbyVirtualMachines_Get.json", + "parameters": [ + { + "$id": "1046", + "parameter": { + "$ref": "1028" + }, + "value": { + "$id": "1047", + "kind": "string", + "type": { + "$ref": "1029" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1048", + "parameter": { + "$ref": "1032" + }, + "value": { + "$id": "1049", + "kind": "string", + "type": { + "$ref": "1033" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1050", + "parameter": { + "$ref": "1035" + }, + "value": { + "$id": "1051", + "kind": "string", + "type": { + "$ref": "1036" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1052", + "parameter": { + "$ref": "1037" + }, + "value": { + "$id": "1053", + "kind": "string", + "type": { + "$ref": "1038" + }, + "value": "pool" + } + }, + { + "$id": "1054", + "parameter": { + "$ref": "1039" + }, + "value": { + "$id": "1055", + "kind": "string", + "type": { + "$ref": "1040" + }, + "value": "virtualMachine" + } + } + ], + "responses": [ + { + "$id": "1056", + "response": { + "$ref": "1044" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1057", + "kind": "model", + "type": { + "$ref": "314" + }, + "value": { + "$id": "1058", + "properties": { + "$id": "1059", + "kind": "model", + "type": { + "$ref": "317" + }, + "value": { + "$id": "1060", + "virtualMachineResourceId": { + "$id": "1061", + "kind": "string", + "type": { + "$ref": "319" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachines/virtualMachine" + }, + "provisioningState": { + "$id": "1062", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "1063", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/standbyVirtualMachines/virtualMachine" + }, + "name": { + "$id": "1064", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "1065", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/virtualMachines" + }, + "systemData": { + "$id": "1066", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "1067", + "createdBy": { + "$id": "1068", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1069", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "1070", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1071", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1072", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1073", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1074", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1075", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1076", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "1077", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1078", + "name": "standbyVirtualMachineName", + "nameInRequest": "standbyVirtualMachineName", + "doc": "Name of the standby virtual machine", + "type": { + "$id": "1079", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1080", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1042" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1081", + "type": { + "$ref": "314" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachines.get" + }, + { + "$id": "1082", + "kind": "paging", + "name": "listByStandbyVirtualMachinePoolResource", + "accessibility": "public", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "List StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource", + "operation": { + "$id": "1083", + "name": "listByStandbyVirtualMachinePoolResource", + "resourceName": "StandbyVirtualMachineResource", + "doc": "List StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1084", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1085", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1086", + "type": { + "$id": "1087", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1088", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1089", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1090", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1091", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1092", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1093", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "1094", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1095", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1096", + "kind": "constant", + "valueType": { + "$id": "1097", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1098", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "330" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/standbyVirtualMachines", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachines.listByStandbyVirtualMachinePoolResource", + "decorators": [], + "examples": [ + { + "$id": "1099", + "kind": "http", + "name": "StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource", + "description": "StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource", + "filePath": "2025-03-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.json", + "parameters": [ + { + "$id": "1100", + "parameter": { + "$ref": "1084" + }, + "value": { + "$id": "1101", + "kind": "string", + "type": { + "$ref": "1085" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1102", + "parameter": { + "$ref": "1088" + }, + "value": { + "$id": "1103", + "kind": "string", + "type": { + "$ref": "1089" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1104", + "parameter": { + "$ref": "1091" + }, + "value": { + "$id": "1105", + "kind": "string", + "type": { + "$ref": "1092" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1106", + "parameter": { + "$ref": "1093" + }, + "value": { + "$id": "1107", + "kind": "string", + "type": { + "$ref": "1094" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1108", + "response": { + "$ref": "1098" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1109", + "kind": "model", + "type": { + "$ref": "330" + }, + "value": { + "$id": "1110", + "value": { + "$id": "1111", + "kind": "array", + "type": { + "$ref": "332" + }, + "value": [ + { + "$id": "1112", + "kind": "model", + "type": { + "$ref": "314" + }, + "value": { + "$id": "1113", + "properties": { + "$id": "1114", + "kind": "model", + "type": { + "$ref": "317" + }, + "value": { + "$id": "1115", + "virtualMachineResourceId": { + "$id": "1116", + "kind": "string", + "type": { + "$ref": "319" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachines/virtualMachine" + }, + "provisioningState": { + "$id": "1117", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "1118", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/standbyVirtualMachines/virtualMachine" + }, + "name": { + "$id": "1119", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "1120", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/virtualMachines" + }, + "systemData": { + "$id": "1121", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "1122", + "createdBy": { + "$id": "1123", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1124", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "1125", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1126", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1127", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1128", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1129", + "kind": "string", + "type": { + "$ref": "336" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1130", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1131", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1132", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "1133", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1134", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1096" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1135", + "type": { + "$id": "1136", + "kind": "array", + "name": "ArrayStandbyVirtualMachineResource", + "valueType": { + "$ref": "314" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachines.listByStandbyVirtualMachinePoolResource", + "pagingMetadata": { + "$id": "1137", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1138", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "1139", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "1140", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client", + "defaultValue": { + "$id": "1141", + "type": { + "$id": "1142", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [ + { + "$id": "1143", + "name": "Azure.ResourceManager.@armResourceOperations", + "arguments": { + "$id": "1144" + } + } + ], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachines", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "parent": { + "$ref": "565" + } + }, + { + "$id": "1145", + "kind": "client", + "name": "StandbyVirtualMachinePoolRuntimeViews", + "namespace": "Azure.ResourceManager.StandbyPool", + "methods": [ + { + "$id": "1146", + "kind": "basic", + "name": "get", + "accessibility": "public", + "apiVersions": [ + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "Get a StandbyVirtualMachinePoolRuntimeViewResource", + "operation": { + "$id": "1147", + "name": "get", + "resourceName": "StandbyVirtualMachinePoolRuntimeViewResource", + "doc": "Get a StandbyVirtualMachinePoolRuntimeViewResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1148", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1150", + "type": { + "$id": "1151", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1152", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1153", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1154", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1155", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1156", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1157", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "1158", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1159", + "name": "runtimeView", + "nameInRequest": "runtimeView", + "doc": "The unique identifier for the runtime view. The input string should be the word 'latest', which will get the latest runtime view of the pool, otherwise the request will fail with NotFound exception.", + "type": { + "$id": "1160", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1161", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1162", + "kind": "constant", + "valueType": { + "$id": "1163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1164", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "340" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/runtimeViews/{runtimeView}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.get", + "decorators": [], + "examples": [ + { + "$id": "1165", + "kind": "http", + "name": "StandbyVirtualMachinePoolRuntimeViews_Get", + "description": "StandbyVirtualMachinePoolRuntimeViews_Get", + "filePath": "2025-03-01/StandbyVirtualMachinePoolRuntimeViews_Get.json", + "parameters": [ + { + "$id": "1166", + "parameter": { + "$ref": "1148" + }, + "value": { + "$id": "1167", + "kind": "string", + "type": { + "$ref": "1149" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1168", + "parameter": { + "$ref": "1152" + }, + "value": { + "$id": "1169", + "kind": "string", + "type": { + "$ref": "1153" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1170", + "parameter": { + "$ref": "1155" + }, + "value": { + "$id": "1171", + "kind": "string", + "type": { + "$ref": "1156" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1172", + "parameter": { + "$ref": "1157" + }, + "value": { + "$id": "1173", + "kind": "string", + "type": { + "$ref": "1158" + }, + "value": "pool" + } + }, + { + "$id": "1174", + "parameter": { + "$ref": "1159" + }, + "value": { + "$id": "1175", + "kind": "string", + "type": { + "$ref": "1160" + }, + "value": "latest" + } + } + ], + "responses": [ + { + "$id": "1176", + "response": { + "$ref": "1164" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1177", + "kind": "model", + "type": { + "$ref": "340" + }, + "value": { + "$id": "1178", + "properties": { + "$id": "1179", + "kind": "model", + "type": { + "$ref": "342" + }, + "value": { + "$id": "1180", + "instanceCountSummary": { + "$id": "1181", + "kind": "array", + "type": { + "$ref": "344" + }, + "value": [ + { + "$id": "1182", + "kind": "model", + "type": { + "$ref": "345" + }, + "value": { + "$id": "1183", + "zone": { + "$id": "1184", + "kind": "number", + "type": { + "$ref": "347" + }, + "value": 1 + }, + "instanceCountsByState": { + "$id": "1185", + "kind": "array", + "type": { + "$ref": "351" + }, + "value": [ + { + "$id": "1186", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1187", + "state": { + "$id": "1188", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Creating" + }, + "count": { + "$id": "1189", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 100 + } + } + }, + { + "$id": "1190", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1191", + "state": { + "$id": "1192", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Running" + }, + "count": { + "$id": "1193", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 20 + } + } + }, + { + "$id": "1194", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1195", + "state": { + "$id": "1196", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deallocating" + }, + "count": { + "$id": "1197", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 10 + } + } + }, + { + "$id": "1198", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1199", + "state": { + "$id": "1200", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deallocated" + }, + "count": { + "$id": "1201", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 100 + } + } + }, + { + "$id": "1202", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1203", + "state": { + "$id": "1204", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Starting" + }, + "count": { + "$id": "1205", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1206", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1207", + "state": { + "$id": "1208", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deleting" + }, + "count": { + "$id": "1209", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1210", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1211", + "state": { + "$id": "1212", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Hibernating" + }, + "count": { + "$id": "1213", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1214", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1215", + "state": { + "$id": "1216", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Hibernated" + }, + "count": { + "$id": "1217", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "1218", + "kind": "model", + "type": { + "$ref": "345" + }, + "value": { + "$id": "1219", + "zone": { + "$id": "1220", + "kind": "number", + "type": { + "$ref": "347" + }, + "value": 2 + }, + "instanceCountsByState": { + "$id": "1221", + "kind": "array", + "type": { + "$ref": "351" + }, + "value": [ + { + "$id": "1222", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1223", + "state": { + "$id": "1224", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Creating" + }, + "count": { + "$id": "1225", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 100 + } + } + }, + { + "$id": "1226", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1227", + "state": { + "$id": "1228", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Running" + }, + "count": { + "$id": "1229", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 20 + } + } + }, + { + "$id": "1230", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1231", + "state": { + "$id": "1232", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deallocating" + }, + "count": { + "$id": "1233", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 10 + } + } + }, + { + "$id": "1234", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1235", + "state": { + "$id": "1236", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deallocated" + }, + "count": { + "$id": "1237", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 100 + } + } + }, + { + "$id": "1238", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1239", + "state": { + "$id": "1240", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Starting" + }, + "count": { + "$id": "1241", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1242", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1243", + "state": { + "$id": "1244", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deleting" + }, + "count": { + "$id": "1245", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1246", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1247", + "state": { + "$id": "1248", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Hibernating" + }, + "count": { + "$id": "1249", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1250", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1251", + "state": { + "$id": "1252", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Hibernated" + }, + "count": { + "$id": "1253", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "1254", + "kind": "model", + "type": { + "$ref": "345" + }, + "value": { + "$id": "1255", + "zone": { + "$id": "1256", + "kind": "number", + "type": { + "$ref": "347" + }, + "value": 3 + }, + "instanceCountsByState": { + "$id": "1257", + "kind": "array", + "type": { + "$ref": "351" + }, + "value": [ + { + "$id": "1258", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1259", + "state": { + "$id": "1260", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Creating" + }, + "count": { + "$id": "1261", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 100 + } + } + }, + { + "$id": "1262", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1263", + "state": { + "$id": "1264", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Running" + }, + "count": { + "$id": "1265", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 20 + } + } + }, + { + "$id": "1266", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1267", + "state": { + "$id": "1268", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deallocating" + }, + "count": { + "$id": "1269", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 10 + } + } + }, + { + "$id": "1270", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1271", + "state": { + "$id": "1272", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deallocated" + }, + "count": { + "$id": "1273", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 100 + } + } + }, + { + "$id": "1274", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1275", + "state": { + "$id": "1276", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Starting" + }, + "count": { + "$id": "1277", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1278", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1279", + "state": { + "$id": "1280", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deleting" + }, + "count": { + "$id": "1281", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1282", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1283", + "state": { + "$id": "1284", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Hibernating" + }, + "count": { + "$id": "1285", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1286", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1287", + "state": { + "$id": "1288", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Hibernated" + }, + "count": { + "$id": "1289", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "1290", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + }, + "status": { + "$id": "1291", + "kind": "model", + "type": { + "$ref": "365" + }, + "value": { + "$id": "1292", + "code": { + "$id": "1293", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "HealthState/healthy" + }, + "message": { + "$id": "1294", + "kind": "string", + "type": { + "$ref": "370" + }, + "value": "The pool is healthy." + } + } + }, + "prediction": { + "$id": "1295", + "kind": "model", + "type": { + "$ref": "379" + }, + "value": { + "$id": "1296", + "forecastValues": { + "$id": "1297", + "kind": "model", + "type": { + "$ref": "381" + }, + "value": { + "$id": "1298", + "instancesRequestedCount": { + "$id": "1299", + "kind": "array", + "type": { + "$ref": "383" + }, + "value": [ + { + "$id": "1300", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 24 + }, + { + "$id": "1301", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 10 + }, + { + "$id": "1302", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 200 + }, + { + "$id": "1303", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 12 + }, + { + "$id": "1304", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 5 + }, + { + "$id": "1305", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 10 + }, + { + "$id": "1306", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 15 + }, + { + "$id": "1307", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 23 + }, + { + "$id": "1308", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 56 + }, + { + "$id": "1309", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 38 + }, + { + "$id": "1310", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 12 + }, + { + "$id": "1311", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 19 + } + ] + } + } + }, + "forecastStartTime": { + "$id": "1312", + "kind": "string", + "type": { + "$ref": "390" + }, + "value": "2025-02-14T01:34:59.228Z" + }, + "forecastInfo": { + "$id": "1313", + "kind": "string", + "type": { + "$ref": "395" + }, + "value": "{\"forecastAccuracy\": 85, \"seriesUnitIntervalInMins\": 60, \"instancesRequestedCount_recentHistory\": \"[9, 4, 2, 8, 8, 2, 3, 6, 5, 3, 2, 6]\"}" + } + } + } + } + }, + "id": { + "$id": "1314", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/runtimeViews/latest" + }, + "name": { + "$id": "1315", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "1316", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/runtimeViews" + }, + "systemData": { + "$id": "1317", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "1318", + "createdBy": { + "$id": "1319", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1320", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "1321", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2024-02-14T23:31:59.679Z" + }, + "lastModifiedBy": { + "$id": "1322", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1323", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1324", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2024-02-14T23:31:59.679Z" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1325", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1326", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1327", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "1328", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1329", + "name": "runtimeView", + "nameInRequest": "runtimeView", + "doc": "The unique identifier for the runtime view. The input string should be the word 'latest', which will get the latest runtime view of the pool, otherwise the request will fail with NotFound exception.", + "type": { + "$id": "1330", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1331", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1162" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1332", + "type": { + "$ref": "340" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.get" + }, + { + "$id": "1333", + "kind": "paging", + "name": "listByStandbyPool", + "accessibility": "public", + "apiVersions": [ + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "List StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource", + "operation": { + "$id": "1334", + "name": "listByStandbyPool", + "resourceName": "StandbyVirtualMachinePoolRuntimeViewResource", + "doc": "List StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1335", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1336", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1337", + "type": { + "$id": "1338", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1339", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1340", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1341", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1342", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1343", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1344", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "1345", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1346", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1347", + "kind": "constant", + "valueType": { + "$id": "1348", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1349", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "404" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/runtimeViews", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.listByStandbyPool", + "decorators": [], + "examples": [ + { + "$id": "1350", + "kind": "http", + "name": "StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool", + "description": "StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool", + "filePath": "2025-03-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json", + "parameters": [ + { + "$id": "1351", + "parameter": { + "$ref": "1335" + }, + "value": { + "$id": "1352", + "kind": "string", + "type": { + "$ref": "1336" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1353", + "parameter": { + "$ref": "1339" + }, + "value": { + "$id": "1354", + "kind": "string", + "type": { + "$ref": "1340" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1355", + "parameter": { + "$ref": "1342" + }, + "value": { + "$id": "1356", + "kind": "string", + "type": { + "$ref": "1343" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1357", + "parameter": { + "$ref": "1344" + }, + "value": { + "$id": "1358", + "kind": "string", + "type": { + "$ref": "1345" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1359", + "response": { + "$ref": "1349" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1360", + "kind": "model", + "type": { + "$ref": "404" + }, + "value": { + "$id": "1361", + "value": { + "$id": "1362", + "kind": "array", + "type": { + "$ref": "406" + }, + "value": [ + { + "$id": "1363", + "kind": "model", + "type": { + "$ref": "340" + }, + "value": { + "$id": "1364", + "properties": { + "$id": "1365", + "kind": "model", + "type": { + "$ref": "342" + }, + "value": { + "$id": "1366", + "instanceCountSummary": { + "$id": "1367", + "kind": "array", + "type": { + "$ref": "344" + }, + "value": [ + { + "$id": "1368", + "kind": "model", + "type": { + "$ref": "345" + }, + "value": { + "$id": "1369", + "zone": { + "$id": "1370", + "kind": "number", + "type": { + "$ref": "347" + }, + "value": 1 + }, + "instanceCountsByState": { + "$id": "1371", + "kind": "array", + "type": { + "$ref": "351" + }, + "value": [ + { + "$id": "1372", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1373", + "state": { + "$id": "1374", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Creating" + }, + "count": { + "$id": "1375", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 100 + } + } + }, + { + "$id": "1376", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1377", + "state": { + "$id": "1378", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Running" + }, + "count": { + "$id": "1379", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 20 + } + } + }, + { + "$id": "1380", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1381", + "state": { + "$id": "1382", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deallocating" + }, + "count": { + "$id": "1383", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 10 + } + } + }, + { + "$id": "1384", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1385", + "state": { + "$id": "1386", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deallocated" + }, + "count": { + "$id": "1387", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 100 + } + } + }, + { + "$id": "1388", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1389", + "state": { + "$id": "1390", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Starting" + }, + "count": { + "$id": "1391", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1392", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1393", + "state": { + "$id": "1394", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deleting" + }, + "count": { + "$id": "1395", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1396", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1397", + "state": { + "$id": "1398", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Hibernating" + }, + "count": { + "$id": "1399", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1400", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1401", + "state": { + "$id": "1402", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Hibernated" + }, + "count": { + "$id": "1403", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "1404", + "kind": "model", + "type": { + "$ref": "345" + }, + "value": { + "$id": "1405", + "zone": { + "$id": "1406", + "kind": "number", + "type": { + "$ref": "347" + }, + "value": 2 + }, + "instanceCountsByState": { + "$id": "1407", + "kind": "array", + "type": { + "$ref": "351" + }, + "value": [ + { + "$id": "1408", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1409", + "state": { + "$id": "1410", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Creating" + }, + "count": { + "$id": "1411", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 100 + } + } + }, + { + "$id": "1412", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1413", + "state": { + "$id": "1414", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Running" + }, + "count": { + "$id": "1415", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 20 + } + } + }, + { + "$id": "1416", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1417", + "state": { + "$id": "1418", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deallocating" + }, + "count": { + "$id": "1419", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 10 + } + } + }, + { + "$id": "1420", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1421", + "state": { + "$id": "1422", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deallocated" + }, + "count": { + "$id": "1423", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 100 + } + } + }, + { + "$id": "1424", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1425", + "state": { + "$id": "1426", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Starting" + }, + "count": { + "$id": "1427", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1428", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1429", + "state": { + "$id": "1430", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deleting" + }, + "count": { + "$id": "1431", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1432", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1433", + "state": { + "$id": "1434", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Hibernating" + }, + "count": { + "$id": "1435", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1436", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1437", + "state": { + "$id": "1438", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Hibernated" + }, + "count": { + "$id": "1439", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "1440", + "kind": "model", + "type": { + "$ref": "345" + }, + "value": { + "$id": "1441", + "zone": { + "$id": "1442", + "kind": "number", + "type": { + "$ref": "347" + }, + "value": 3 + }, + "instanceCountsByState": { + "$id": "1443", + "kind": "array", + "type": { + "$ref": "351" + }, + "value": [ + { + "$id": "1444", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1445", + "state": { + "$id": "1446", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Creating" + }, + "count": { + "$id": "1447", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 100 + } + } + }, + { + "$id": "1448", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1449", + "state": { + "$id": "1450", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Running" + }, + "count": { + "$id": "1451", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 20 + } + } + }, + { + "$id": "1452", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1453", + "state": { + "$id": "1454", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deallocating" + }, + "count": { + "$id": "1455", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 10 + } + } + }, + { + "$id": "1456", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1457", + "state": { + "$id": "1458", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deallocated" + }, + "count": { + "$id": "1459", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 100 + } + } + }, + { + "$id": "1460", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1461", + "state": { + "$id": "1462", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Starting" + }, + "count": { + "$id": "1463", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1464", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1465", + "state": { + "$id": "1466", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Deleting" + }, + "count": { + "$id": "1467", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1468", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1469", + "state": { + "$id": "1470", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Hibernating" + }, + "count": { + "$id": "1471", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + }, + { + "$id": "1472", + "kind": "model", + "type": { + "$ref": "352" + }, + "value": { + "$id": "1473", + "state": { + "$id": "1474", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Hibernated" + }, + "count": { + "$id": "1475", + "kind": "number", + "type": { + "$ref": "357" + }, + "value": 0 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "1476", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + }, + "status": { + "$id": "1477", + "kind": "model", + "type": { + "$ref": "365" + }, + "value": { + "$id": "1478", + "code": { + "$id": "1479", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "HealthState/healthy" + }, + "message": { + "$id": "1480", + "kind": "string", + "type": { + "$ref": "370" + }, + "value": "The pool is healthy." + } + } + }, + "prediction": { + "$id": "1481", + "kind": "model", + "type": { + "$ref": "379" + }, + "value": { + "$id": "1482", + "forecastValues": { + "$id": "1483", + "kind": "model", + "type": { + "$ref": "381" + }, + "value": { + "$id": "1484", + "instancesRequestedCount": { + "$id": "1485", + "kind": "array", + "type": { + "$ref": "383" + }, + "value": [ + { + "$id": "1486", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 24 + }, + { + "$id": "1487", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 10 + }, + { + "$id": "1488", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 200 + }, + { + "$id": "1489", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 12 + }, + { + "$id": "1490", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 5 + }, + { + "$id": "1491", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 10 + }, + { + "$id": "1492", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 15 + }, + { + "$id": "1493", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 23 + }, + { + "$id": "1494", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 56 + }, + { + "$id": "1495", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 38 + }, + { + "$id": "1496", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 12 + }, + { + "$id": "1497", + "kind": "number", + "type": { + "$ref": "384" + }, + "value": 19 + } + ] + } + } + }, + "forecastStartTime": { + "$id": "1498", + "kind": "string", + "type": { + "$ref": "390" + }, + "value": "2025-02-14T01:34:59.228Z" + }, + "forecastInfo": { + "$id": "1499", + "kind": "string", + "type": { + "$ref": "395" + }, + "value": "{\"forecastAccuracy\": 85, \"seriesUnitIntervalInMins\": 60, \"instancesRequestedCount_recentHistory\": \"[9, 4, 2, 8, 8, 2, 3, 6, 5, 3, 2, 6]\"}" + } + } + } + } + }, + "id": { + "$id": "1500", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/runtimeViews/latest" + }, + "name": { + "$id": "1501", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "1502", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/runtimeViews" + }, + "systemData": { + "$id": "1503", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "1504", + "createdBy": { + "$id": "1505", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1506", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "1507", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1508", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1509", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1510", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1511", + "kind": "string", + "type": { + "$ref": "410" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1512", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1513", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1514", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "1515", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1516", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1347" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1517", + "type": { + "$id": "1518", + "kind": "array", + "name": "ArrayStandbyVirtualMachinePoolRuntimeViewResource", + "valueType": { + "$ref": "340" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.listByStandbyPool", + "pagingMetadata": { + "$id": "1519", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1520", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "1521", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "1522", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client", + "defaultValue": { + "$id": "1523", + "type": { + "$id": "1524", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [ + { + "$id": "1525", + "name": "Azure.ResourceManager.@armResourceOperations", + "arguments": { + "$id": "1526" + } + } + ], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews", + "apiVersions": [ + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "parent": { + "$ref": "565" + } + }, + { + "$id": "1527", + "kind": "client", + "name": "StandbyContainerGroupPools", + "namespace": "Azure.ResourceManager.StandbyPool", + "methods": [ + { + "$id": "1528", + "kind": "basic", + "name": "get", + "accessibility": "public", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "Get a StandbyContainerGroupPoolResource", + "operation": { + "$id": "1529", + "name": "get", + "resourceName": "StandbyContainerGroupPoolResource", + "doc": "Get a StandbyContainerGroupPoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1530", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1531", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1532", + "type": { + "$id": "1533", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1534", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1535", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1536", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1537", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1538", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1539", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "1540", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1541", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1542", + "kind": "constant", + "valueType": { + "$id": "1543", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1544", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "414" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.get", + "decorators": [], + "examples": [ + { + "$id": "1545", + "kind": "http", + "name": "StandbyContainerGroupPools_Get", + "description": "StandbyContainerGroupPools_Get", + "filePath": "2025-03-01/StandbyContainerGroupPools_Get.json", + "parameters": [ + { + "$id": "1546", + "parameter": { + "$ref": "1530" + }, + "value": { + "$id": "1547", + "kind": "string", + "type": { + "$ref": "1531" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1548", + "parameter": { + "$ref": "1534" + }, + "value": { + "$id": "1549", + "kind": "string", + "type": { + "$ref": "1535" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1550", + "parameter": { + "$ref": "1537" + }, + "value": { + "$id": "1551", + "kind": "string", + "type": { + "$ref": "1538" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1552", + "parameter": { + "$ref": "1539" + }, + "value": { + "$id": "1553", + "kind": "string", + "type": { + "$ref": "1540" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1554", + "response": { + "$ref": "1544" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1555", + "kind": "model", + "type": { + "$ref": "414" + }, + "value": { + "$id": "1556", + "properties": { + "$id": "1557", + "kind": "model", + "type": { + "$ref": "416" + }, + "value": { + "$id": "1558", + "elasticityProfile": { + "$id": "1559", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "1560", + "maxReadyCapacity": { + "$id": "1561", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1562", + "kind": "string", + "type": { + "$ref": "74" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1563", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1564", + "kind": "model", + "type": { + "$ref": "429" + }, + "value": { + "$id": "1565", + "containerGroupProfile": { + "$id": "1566", + "kind": "model", + "type": { + "$ref": "431" + }, + "value": { + "$id": "1567", + "id": { + "$id": "1568", + "kind": "string", + "type": { + "$ref": "433" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1569", + "kind": "number", + "type": { + "$ref": "438" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1570", + "kind": "array", + "type": { + "$ref": "444" + }, + "value": [ + { + "$id": "1571", + "kind": "model", + "type": { + "$ref": "445" + }, + "value": { + "$id": "1572", + "id": { + "$id": "1573", + "kind": "string", + "type": { + "$ref": "447" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1574", + "kind": "array", + "type": { + "$ref": "456" + }, + "value": [ + { + "$id": "1575", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "1" + }, + { + "$id": "1576", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "2" + }, + { + "$id": "1577", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "3" + } + ] + } + } + }, + "tags": { + "$id": "1578", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "1579" + } + }, + "location": { + "$id": "1580", + "kind": "string", + "type": { + "$ref": "223" + }, + "value": "West US" + }, + "id": { + "$id": "1581", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1582", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "1583", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1584", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "1585", + "createdBy": { + "$id": "1586", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1587", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "1588", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1589", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1590", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1591", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1592", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1593", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1594", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "1595", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1596", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1542" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1597", + "type": { + "$ref": "414" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.get" + }, + { + "$id": "1598", + "kind": "lro", + "name": "createOrUpdate", + "accessibility": "public", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "Create a StandbyContainerGroupPoolResource", + "operation": { + "$id": "1599", + "name": "createOrUpdate", + "resourceName": "StandbyContainerGroupPoolResource", + "doc": "Create a StandbyContainerGroupPoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1600", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1601", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1602", + "type": { + "$id": "1603", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1604", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1605", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1606", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1607", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1608", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1609", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "1610", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1611", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "1612", + "kind": "constant", + "valueType": { + "$id": "1613", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1614", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1615", + "kind": "constant", + "valueType": { + "$id": "1616", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1617", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "414" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1618", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "414" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "1619", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "414" + }, + "headers": [ + { + "$id": "1620", + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "1621", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.createOrUpdate", + "decorators": [ + { + "$id": "1622", + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "$id": "1623", + "finalState": "azure-async-operation" + } + } + ], + "examples": [ + { + "$id": "1624", + "kind": "http", + "name": "StandbyContainerGroupPools_CreateOrUpdate", + "description": "StandbyContainerGroupPools_CreateOrUpdate", + "filePath": "2025-03-01/StandbyContainerGroupPools_CreateOrUpdate.json", + "parameters": [ + { + "$id": "1625", + "parameter": { + "$ref": "1600" + }, + "value": { + "$id": "1626", + "kind": "string", + "type": { + "$ref": "1601" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1627", + "parameter": { + "$ref": "1604" + }, + "value": { + "$id": "1628", + "kind": "string", + "type": { + "$ref": "1605" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1629", + "parameter": { + "$ref": "1607" + }, + "value": { + "$id": "1630", + "kind": "string", + "type": { + "$ref": "1608" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1631", + "parameter": { + "$ref": "1609" + }, + "value": { + "$id": "1632", + "kind": "string", + "type": { + "$ref": "1610" + }, + "value": "pool" + } + }, + { + "$id": "1633", + "parameter": { + "$ref": "1617" + }, + "value": { + "$id": "1634", + "kind": "model", + "type": { + "$ref": "414" + }, + "value": { + "$id": "1635", + "properties": { + "$id": "1636", + "kind": "model", + "type": { + "$ref": "416" + }, + "value": { + "$id": "1637", + "elasticityProfile": { + "$id": "1638", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "1639", + "maxReadyCapacity": { + "$id": "1640", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1641", + "kind": "string", + "type": { + "$ref": "74" + }, + "value": "always" + } + } + }, + "containerGroupProperties": { + "$id": "1642", + "kind": "model", + "type": { + "$ref": "429" + }, + "value": { + "$id": "1643", + "containerGroupProfile": { + "$id": "1644", + "kind": "model", + "type": { + "$ref": "431" + }, + "value": { + "$id": "1645", + "id": { + "$id": "1646", + "kind": "string", + "type": { + "$ref": "433" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1647", + "kind": "number", + "type": { + "$ref": "438" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1648", + "kind": "array", + "type": { + "$ref": "444" + }, + "value": [ + { + "$id": "1649", + "kind": "model", + "type": { + "$ref": "445" + }, + "value": { + "$id": "1650", + "id": { + "$id": "1651", + "kind": "string", + "type": { + "$ref": "447" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1652", + "kind": "array", + "type": { + "$ref": "456" + }, + "value": [ + { + "$id": "1653", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "1" + }, + { + "$id": "1654", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "2" + }, + { + "$id": "1655", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "3" + } + ] + } + } + }, + "tags": { + "$id": "1656", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "1657" + } + }, + "location": { + "$id": "1658", + "kind": "string", + "type": { + "$ref": "223" + }, + "value": "West US" + } + } + } + } + ], + "responses": [ + { + "$id": "1659", + "response": { + "$ref": "1618" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1660", + "kind": "model", + "type": { + "$ref": "414" + }, + "value": { + "$id": "1661", + "properties": { + "$id": "1662", + "kind": "model", + "type": { + "$ref": "416" + }, + "value": { + "$id": "1663", + "elasticityProfile": { + "$id": "1664", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "1665", + "maxReadyCapacity": { + "$id": "1666", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1667", + "kind": "string", + "type": { + "$ref": "74" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1668", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1669", + "kind": "model", + "type": { + "$ref": "429" + }, + "value": { + "$id": "1670", + "containerGroupProfile": { + "$id": "1671", + "kind": "model", + "type": { + "$ref": "431" + }, + "value": { + "$id": "1672", + "id": { + "$id": "1673", + "kind": "string", + "type": { + "$ref": "433" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1674", + "kind": "number", + "type": { + "$ref": "438" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1675", + "kind": "array", + "type": { + "$ref": "444" + }, + "value": [ + { + "$id": "1676", + "kind": "model", + "type": { + "$ref": "445" + }, + "value": { + "$id": "1677", + "id": { + "$id": "1678", + "kind": "string", + "type": { + "$ref": "447" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1679", + "kind": "array", + "type": { + "$ref": "456" + }, + "value": [ + { + "$id": "1680", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "1" + }, + { + "$id": "1681", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "2" + }, + { + "$id": "1682", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "3" + } + ] + } + } + }, + "tags": { + "$id": "1683", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "1684" + } + }, + "location": { + "$id": "1685", + "kind": "string", + "type": { + "$ref": "223" + }, + "value": "West US" + }, + "id": { + "$id": "1686", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1687", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "1688", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1689", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "1690", + "createdBy": { + "$id": "1691", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1692", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "1693", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1694", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1695", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1696", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + }, + { + "$id": "1697", + "response": { + "$ref": "1619" + }, + "statusCode": 201, + "bodyValue": { + "$id": "1698", + "kind": "model", + "type": { + "$ref": "414" + }, + "value": { + "$id": "1699", + "properties": { + "$id": "1700", + "kind": "model", + "type": { + "$ref": "416" + }, + "value": { + "$id": "1701", + "elasticityProfile": { + "$id": "1702", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "1703", + "maxReadyCapacity": { + "$id": "1704", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1705", + "kind": "string", + "type": { + "$ref": "74" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1706", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1707", + "kind": "model", + "type": { + "$ref": "429" + }, + "value": { + "$id": "1708", + "containerGroupProfile": { + "$id": "1709", + "kind": "model", + "type": { + "$ref": "431" + }, + "value": { + "$id": "1710", + "id": { + "$id": "1711", + "kind": "string", + "type": { + "$ref": "433" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1712", + "kind": "number", + "type": { + "$ref": "438" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1713", + "kind": "array", + "type": { + "$ref": "444" + }, + "value": [ + { + "$id": "1714", + "kind": "model", + "type": { + "$ref": "445" + }, + "value": { + "$id": "1715", + "id": { + "$id": "1716", + "kind": "string", + "type": { + "$ref": "447" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1717", + "kind": "array", + "type": { + "$ref": "456" + }, + "value": [ + { + "$id": "1718", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "1" + }, + { + "$id": "1719", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "2" + }, + { + "$id": "1720", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "3" + } + ] + } + } + }, + "tags": { + "$id": "1721", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "1722" + } + }, + "location": { + "$id": "1723", + "kind": "string", + "type": { + "$ref": "223" + }, + "value": "West US" + }, + "id": { + "$id": "1724", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1725", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "1726", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1727", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "1728", + "createdBy": { + "$id": "1729", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1730", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "1731", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1732", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1733", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1734", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1735", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1736", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1737", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "1738", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1739", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "414" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1740", + "name": "contentType", + "nameInRequest": "contentType", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "1741", + "kind": "constant", + "valueType": { + "$id": "1742", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1743", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$id": "1744", + "kind": "constant", + "valueType": { + "$id": "1745", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1746", + "type": { + "$ref": "414" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.createOrUpdate", + "lroMetadata": { + "$id": "1747", + "finalStateVia": 0, + "finalResponse": { + "$id": "1748", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "414" + } + } + } + }, + { + "$id": "1749", + "kind": "lro", + "name": "delete", + "accessibility": "public", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "Delete a StandbyContainerGroupPoolResource", + "operation": { + "$id": "1750", + "name": "delete", + "resourceName": "StandbyContainerGroupPoolResource", + "doc": "Delete a StandbyContainerGroupPoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1751", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1752", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1753", + "type": { + "$id": "1754", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1755", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1756", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1757", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1758", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1759", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1760", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "1761", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1762", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1763", + "kind": "constant", + "valueType": { + "$id": "1764", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1765", + "statusCodes": [ + 202 + ], + "headers": [ + { + "$id": "1766", + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "1767", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1768", + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "1769", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "$id": "1770", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.delete", + "decorators": [], + "examples": [ + { + "$id": "1771", + "kind": "http", + "name": "StandbyContainerGroupPools_Delete", + "description": "StandbyContainerGroupPools_Delete", + "filePath": "2025-03-01/StandbyContainerGroupPools_Delete.json", + "parameters": [ + { + "$id": "1772", + "parameter": { + "$ref": "1751" + }, + "value": { + "$id": "1773", + "kind": "string", + "type": { + "$ref": "1752" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1774", + "parameter": { + "$ref": "1755" + }, + "value": { + "$id": "1775", + "kind": "string", + "type": { + "$ref": "1756" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1776", + "parameter": { + "$ref": "1758" + }, + "value": { + "$id": "1777", + "kind": "string", + "type": { + "$ref": "1759" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1778", + "parameter": { + "$ref": "1760" + }, + "value": { + "$id": "1779", + "kind": "string", + "type": { + "$ref": "1761" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1780", + "response": { + "$ref": "1765" + }, + "statusCode": 202 + }, + { + "$id": "1781", + "response": { + "$ref": "1770" + }, + "statusCode": 204 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1782", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1783", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1784", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "1785", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1786", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$id": "1787", + "kind": "constant", + "valueType": { + "$id": "1788", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1789" + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.delete", + "lroMetadata": { + "$id": "1790", + "finalStateVia": 1, + "finalResponse": { + "$id": "1791", + "statusCodes": [ + 204 + ] + } + } + }, + { + "$id": "1792", + "kind": "basic", + "name": "update", + "accessibility": "public", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "Update a StandbyContainerGroupPoolResource", + "operation": { + "$id": "1793", + "name": "update", + "resourceName": "StandbyContainerGroupPoolResource", + "doc": "Update a StandbyContainerGroupPoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1794", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1795", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1796", + "type": { + "$id": "1797", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1798", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1799", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1800", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1801", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1802", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1803", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "1804", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1805", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "1806", + "kind": "constant", + "valueType": { + "$id": "1807", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1808", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1809", + "kind": "constant", + "valueType": { + "$id": "1810", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1811", + "name": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "467" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1812", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "414" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PATCH", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": false, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.update", + "decorators": [], + "examples": [ + { + "$id": "1813", + "kind": "http", + "name": "StandbyContainerGroupPools_Update", + "description": "StandbyContainerGroupPools_Update", + "filePath": "2025-03-01/StandbyContainerGroupPools_Update.json", + "parameters": [ + { + "$id": "1814", + "parameter": { + "$ref": "1794" + }, + "value": { + "$id": "1815", + "kind": "string", + "type": { + "$ref": "1795" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1816", + "parameter": { + "$ref": "1798" + }, + "value": { + "$id": "1817", + "kind": "string", + "type": { + "$ref": "1799" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1818", + "parameter": { + "$ref": "1801" + }, + "value": { + "$id": "1819", + "kind": "string", + "type": { + "$ref": "1802" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1820", + "parameter": { + "$ref": "1803" + }, + "value": { + "$id": "1821", + "kind": "string", + "type": { + "$ref": "1804" + }, + "value": "pool" + } + }, + { + "$id": "1822", + "parameter": { + "$ref": "1811" + }, + "value": { + "$id": "1823", + "kind": "model", + "type": { + "$ref": "467" + }, + "value": { + "$id": "1824", + "tags": { + "$id": "1825", + "kind": "dict", + "type": { + "$ref": "469" + }, + "value": { + "$id": "1826" + } + }, + "properties": { + "$id": "1827", + "kind": "model", + "type": { + "$ref": "475" + }, + "value": { + "$id": "1828", + "elasticityProfile": { + "$id": "1829", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "1830", + "maxReadyCapacity": { + "$id": "1831", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 1743 + }, + "refillPolicy": { + "$id": "1832", + "kind": "string", + "type": { + "$ref": "74" + }, + "value": "always" + } + } + }, + "containerGroupProperties": { + "$id": "1833", + "kind": "model", + "type": { + "$ref": "429" + }, + "value": { + "$id": "1834", + "containerGroupProfile": { + "$id": "1835", + "kind": "model", + "type": { + "$ref": "431" + }, + "value": { + "$id": "1836", + "id": { + "$id": "1837", + "kind": "string", + "type": { + "$ref": "433" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1838", + "kind": "number", + "type": { + "$ref": "438" + }, + "value": 2 + } + } + }, + "subnetIds": { + "$id": "1839", + "kind": "array", + "type": { + "$ref": "444" + }, + "value": [ + { + "$id": "1840", + "kind": "model", + "type": { + "$ref": "445" + }, + "value": { + "$id": "1841", + "id": { + "$id": "1842", + "kind": "string", + "type": { + "$ref": "447" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1843", + "kind": "array", + "type": { + "$ref": "483" + }, + "value": [ + { + "$id": "1844", + "kind": "string", + "type": { + "$ref": "484" + }, + "value": "1" + }, + { + "$id": "1845", + "kind": "string", + "type": { + "$ref": "484" + }, + "value": "2" + }, + { + "$id": "1846", + "kind": "string", + "type": { + "$ref": "484" + }, + "value": "3" + } + ] + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "1847", + "response": { + "$ref": "1812" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1848", + "kind": "model", + "type": { + "$ref": "414" + }, + "value": { + "$id": "1849", + "properties": { + "$id": "1850", + "kind": "model", + "type": { + "$ref": "416" + }, + "value": { + "$id": "1851", + "elasticityProfile": { + "$id": "1852", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "1853", + "maxReadyCapacity": { + "$id": "1854", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 1743 + }, + "refillPolicy": { + "$id": "1855", + "kind": "string", + "type": { + "$ref": "74" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1856", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1857", + "kind": "model", + "type": { + "$ref": "429" + }, + "value": { + "$id": "1858", + "containerGroupProfile": { + "$id": "1859", + "kind": "model", + "type": { + "$ref": "431" + }, + "value": { + "$id": "1860", + "id": { + "$id": "1861", + "kind": "string", + "type": { + "$ref": "433" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1862", + "kind": "number", + "type": { + "$ref": "438" + }, + "value": 2 + } + } + }, + "subnetIds": { + "$id": "1863", + "kind": "array", + "type": { + "$ref": "444" + }, + "value": [ + { + "$id": "1864", + "kind": "model", + "type": { + "$ref": "445" + }, + "value": { + "$id": "1865", + "id": { + "$id": "1866", + "kind": "string", + "type": { + "$ref": "447" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1867", + "kind": "array", + "type": { + "$ref": "456" + }, + "value": [ + { + "$id": "1868", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "1" + }, + { + "$id": "1869", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "2" + }, + { + "$id": "1870", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "3" + } + ] + } + } + }, + "tags": { + "$id": "1871", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "1872" + } + }, + "location": { + "$id": "1873", + "kind": "string", + "type": { + "$ref": "223" + }, + "value": "West US" + }, + "id": { + "$id": "1874", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1875", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "1876", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1877", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "1878", + "createdBy": { + "$id": "1879", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1880", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "1881", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1882", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1883", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1884", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1885", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1886", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1887", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "1888", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1889", + "name": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "467" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1890", + "name": "contentType", + "nameInRequest": "contentType", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "1806" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1891", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1809" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1892", + "type": { + "$ref": "414" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.update" + }, + { + "$id": "1893", + "kind": "paging", + "name": "listByResourceGroup", + "accessibility": "public", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "List StandbyContainerGroupPoolResource resources by resource group", + "operation": { + "$id": "1894", + "name": "listByResourceGroup", + "resourceName": "StandbyContainerGroupPoolResource", + "doc": "List StandbyContainerGroupPoolResource resources by resource group", + "accessibility": "public", + "parameters": [ + { + "$id": "1895", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1896", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1897", + "type": { + "$id": "1898", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1899", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1900", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1901", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1902", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1903", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1904", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1905", + "kind": "constant", + "valueType": { + "$id": "1906", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1907", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "489" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.listByResourceGroup", + "decorators": [], + "examples": [ + { + "$id": "1908", + "kind": "http", + "name": "StandbyContainerGroupPools_ListByResourceGroup", + "description": "StandbyContainerGroupPools_ListByResourceGroup", + "filePath": "2025-03-01/StandbyContainerGroupPools_ListByResourceGroup.json", + "parameters": [ + { + "$id": "1909", + "parameter": { + "$ref": "1895" + }, + "value": { + "$id": "1910", + "kind": "string", + "type": { + "$ref": "1896" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1911", + "parameter": { + "$ref": "1899" + }, + "value": { + "$id": "1912", + "kind": "string", + "type": { + "$ref": "1900" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1913", + "parameter": { + "$ref": "1902" + }, + "value": { + "$id": "1914", + "kind": "string", + "type": { + "$ref": "1903" + }, + "value": "rgstandbypool" + } + } + ], + "responses": [ + { + "$id": "1915", + "response": { + "$ref": "1907" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1916", + "kind": "model", + "type": { + "$ref": "489" + }, + "value": { + "$id": "1917", + "value": { + "$id": "1918", + "kind": "array", + "type": { + "$ref": "491" + }, + "value": [ + { + "$id": "1919", + "kind": "model", + "type": { + "$ref": "414" + }, + "value": { + "$id": "1920", + "properties": { + "$id": "1921", + "kind": "model", + "type": { + "$ref": "416" + }, + "value": { + "$id": "1922", + "elasticityProfile": { + "$id": "1923", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "1924", + "maxReadyCapacity": { + "$id": "1925", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1926", + "kind": "string", + "type": { + "$ref": "74" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1927", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1928", + "kind": "model", + "type": { + "$ref": "429" + }, + "value": { + "$id": "1929", + "containerGroupProfile": { + "$id": "1930", + "kind": "model", + "type": { + "$ref": "431" + }, + "value": { + "$id": "1931", + "id": { + "$id": "1932", + "kind": "string", + "type": { + "$ref": "433" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1933", + "kind": "number", + "type": { + "$ref": "438" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1934", + "kind": "array", + "type": { + "$ref": "444" + }, + "value": [ + { + "$id": "1935", + "kind": "model", + "type": { + "$ref": "445" + }, + "value": { + "$id": "1936", + "id": { + "$id": "1937", + "kind": "string", + "type": { + "$ref": "447" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1938", + "kind": "array", + "type": { + "$ref": "456" + }, + "value": [ + { + "$id": "1939", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "1" + }, + { + "$id": "1940", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "2" + }, + { + "$id": "1941", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "3" + } + ] + } + } + }, + "tags": { + "$id": "1942", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "1943" + } + }, + "location": { + "$id": "1944", + "kind": "string", + "type": { + "$ref": "223" + }, + "value": "West US" + }, + "id": { + "$id": "1945", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1946", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "1947", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1948", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "1949", + "createdBy": { + "$id": "1950", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1951", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "1952", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1953", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1954", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1955", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1956", + "kind": "string", + "type": { + "$ref": "495" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1957", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1958", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1959", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1905" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1960", + "type": { + "$id": "1961", + "kind": "array", + "name": "ArrayStandbyContainerGroupPoolResource", + "valueType": { + "$ref": "414" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.listByResourceGroup", + "pagingMetadata": { + "$id": "1962", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1963", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + }, + { + "$id": "1964", + "kind": "paging", + "name": "listBySubscription", + "accessibility": "public", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "List StandbyContainerGroupPoolResource resources by subscription ID", + "operation": { + "$id": "1965", + "name": "listBySubscription", + "resourceName": "StandbyContainerGroupPoolResource", + "doc": "List StandbyContainerGroupPoolResource resources by subscription ID", + "accessibility": "public", + "parameters": [ + { + "$id": "1966", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1967", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1968", + "type": { + "$id": "1969", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1970", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1971", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1972", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1973", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1974", + "kind": "constant", + "valueType": { + "$id": "1975", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1976", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "489" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyContainerGroupPools", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.listBySubscription", + "decorators": [], + "examples": [ + { + "$id": "1977", + "kind": "http", + "name": "StandbyContainerGroupPools_ListBySubscription", + "description": "StandbyContainerGroupPools_ListBySubscription", + "filePath": "2025-03-01/StandbyContainerGroupPools_ListBySubscription.json", + "parameters": [ + { + "$id": "1978", + "parameter": { + "$ref": "1966" + }, + "value": { + "$id": "1979", + "kind": "string", + "type": { + "$ref": "1967" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1980", + "parameter": { + "$ref": "1970" + }, + "value": { + "$id": "1981", + "kind": "string", + "type": { + "$ref": "1971" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + } + ], + "responses": [ + { + "$id": "1982", + "response": { + "$ref": "1976" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1983", + "kind": "model", + "type": { + "$ref": "489" + }, + "value": { + "$id": "1984", + "value": { + "$id": "1985", + "kind": "array", + "type": { + "$ref": "491" + }, + "value": [ + { + "$id": "1986", + "kind": "model", + "type": { + "$ref": "414" + }, + "value": { + "$id": "1987", + "properties": { + "$id": "1988", + "kind": "model", + "type": { + "$ref": "416" + }, + "value": { + "$id": "1989", + "elasticityProfile": { + "$id": "1990", + "kind": "model", + "type": { + "$ref": "418" + }, + "value": { + "$id": "1991", + "maxReadyCapacity": { + "$id": "1992", + "kind": "number", + "type": { + "$ref": "420" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1993", + "kind": "string", + "type": { + "$ref": "74" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1994", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1995", + "kind": "model", + "type": { + "$ref": "429" + }, + "value": { + "$id": "1996", + "containerGroupProfile": { + "$id": "1997", + "kind": "model", + "type": { + "$ref": "431" + }, + "value": { + "$id": "1998", + "id": { + "$id": "1999", + "kind": "string", + "type": { + "$ref": "433" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "2000", + "kind": "number", + "type": { + "$ref": "438" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "2001", + "kind": "array", + "type": { + "$ref": "444" + }, + "value": [ + { + "$id": "2002", + "kind": "model", + "type": { + "$ref": "445" + }, + "value": { + "$id": "2003", + "id": { + "$id": "2004", + "kind": "string", + "type": { + "$ref": "447" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "2005", + "kind": "array", + "type": { + "$ref": "456" + }, + "value": [ + { + "$id": "2006", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "1" + }, + { + "$id": "2007", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "2" + }, + { + "$id": "2008", + "kind": "string", + "type": { + "$ref": "457" + }, + "value": "3" + } + ] + } + } + }, + "tags": { + "$id": "2009", + "kind": "dict", + "type": { + "$ref": "217" + }, + "value": { + "$id": "2010" + } + }, + "location": { + "$id": "2011", + "kind": "string", + "type": { + "$ref": "223" + }, + "value": "West US" + }, + "id": { + "$id": "2012", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "2013", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "2014", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "2015", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "2016", + "createdBy": { + "$id": "2017", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "2018", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "2019", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "2020", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "2021", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "2022", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "2023", + "kind": "string", + "type": { + "$ref": "495" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "2024", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1974" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "2025", + "type": { + "$id": "2026", + "kind": "array", + "name": "ArrayStandbyContainerGroupPoolResource", + "valueType": { + "$ref": "414" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.listBySubscription", + "pagingMetadata": { + "$id": "2027", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "2028", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "2029", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "2030", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client", + "defaultValue": { + "$id": "2031", + "type": { + "$id": "2032", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [ + { + "$id": "2033", + "name": "Azure.ResourceManager.@armResourceOperations", + "arguments": { + "$id": "2034" + } + } + ], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools", + "apiVersions": [ + "2023-12-01-preview", + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "parent": { + "$ref": "565" + } + }, + { + "$id": "2035", + "kind": "client", + "name": "StandbyContainerGroupPoolRuntimeViews", + "namespace": "Azure.ResourceManager.StandbyPool", + "methods": [ + { + "$id": "2036", + "kind": "basic", + "name": "get", + "accessibility": "public", + "apiVersions": [ + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "Get a StandbyContainerGroupPoolRuntimeViewResource", + "operation": { + "$id": "2037", + "name": "get", + "resourceName": "StandbyContainerGroupPoolRuntimeViewResource", + "doc": "Get a StandbyContainerGroupPoolRuntimeViewResource", + "accessibility": "public", + "parameters": [ + { + "$id": "2038", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "2039", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "2040", + "type": { + "$id": "2041", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2042", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "2043", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2044", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2045", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "2046", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2047", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "2048", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2049", + "name": "runtimeView", + "nameInRequest": "runtimeView", + "doc": "The unique identifier for the runtime view. The input string should be the word 'latest', which will get the latest runtime view of the pool, otherwise the request will fail with NotFound exception.", + "type": { + "$id": "2050", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2051", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "2052", + "kind": "constant", + "valueType": { + "$id": "2053", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "2054", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "499" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}/runtimeViews/{runtimeView}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.get", + "decorators": [], + "examples": [ + { + "$id": "2055", + "kind": "http", + "name": "StandbyContainerGroupPoolRuntimeViews_Get", + "description": "StandbyContainerGroupPoolRuntimeViews_Get", + "filePath": "2025-03-01/StandbyContainerGroupPoolRuntimeViews_Get.json", + "parameters": [ + { + "$id": "2056", + "parameter": { + "$ref": "2038" + }, + "value": { + "$id": "2057", + "kind": "string", + "type": { + "$ref": "2039" + }, + "value": "2025-03-01" + } + }, + { + "$id": "2058", + "parameter": { + "$ref": "2042" + }, + "value": { + "$id": "2059", + "kind": "string", + "type": { + "$ref": "2043" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "2060", + "parameter": { + "$ref": "2045" + }, + "value": { + "$id": "2061", + "kind": "string", + "type": { + "$ref": "2046" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "2062", + "parameter": { + "$ref": "2047" + }, + "value": { + "$id": "2063", + "kind": "string", + "type": { + "$ref": "2048" + }, + "value": "pool" + } + }, + { + "$id": "2064", + "parameter": { + "$ref": "2049" + }, + "value": { + "$id": "2065", + "kind": "string", + "type": { + "$ref": "2050" + }, + "value": "latest" + } + } + ], + "responses": [ + { + "$id": "2066", + "response": { + "$ref": "2054" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2067", + "kind": "model", + "type": { + "$ref": "499" + }, + "value": { + "$id": "2068", + "properties": { + "$id": "2069", + "kind": "model", + "type": { + "$ref": "501" + }, + "value": { + "$id": "2070", + "instanceCountSummary": { + "$id": "2071", + "kind": "array", + "type": { + "$ref": "503" + }, + "value": [ + { + "$id": "2072", + "kind": "model", + "type": { + "$ref": "504" + }, + "value": { + "$id": "2073", + "zone": { + "$id": "2074", + "kind": "number", + "type": { + "$ref": "506" + }, + "value": 1 + }, + "instanceCountsByState": { + "$id": "2075", + "kind": "array", + "type": { + "$ref": "510" + }, + "value": [ + { + "$id": "2076", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2077", + "state": { + "$id": "2078", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Creating" + }, + "count": { + "$id": "2079", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 100 + } + } + }, + { + "$id": "2080", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2081", + "state": { + "$id": "2082", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Running" + }, + "count": { + "$id": "2083", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 20 + } + } + }, + { + "$id": "2084", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2085", + "state": { + "$id": "2086", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Deleting" + }, + "count": { + "$id": "2087", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 21 + } + } + } + ] + } + } + }, + { + "$id": "2088", + "kind": "model", + "type": { + "$ref": "504" + }, + "value": { + "$id": "2089", + "zone": { + "$id": "2090", + "kind": "number", + "type": { + "$ref": "506" + }, + "value": 2 + }, + "instanceCountsByState": { + "$id": "2091", + "kind": "array", + "type": { + "$ref": "510" + }, + "value": [ + { + "$id": "2092", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2093", + "state": { + "$id": "2094", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Creating" + }, + "count": { + "$id": "2095", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 100 + } + } + }, + { + "$id": "2096", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2097", + "state": { + "$id": "2098", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Running" + }, + "count": { + "$id": "2099", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 500 + } + } + }, + { + "$id": "2100", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2101", + "state": { + "$id": "2102", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Deleting" + }, + "count": { + "$id": "2103", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 20 + } + } + } + ] + } + } + }, + { + "$id": "2104", + "kind": "model", + "type": { + "$ref": "504" + }, + "value": { + "$id": "2105", + "zone": { + "$id": "2106", + "kind": "number", + "type": { + "$ref": "506" + }, + "value": 3 + }, + "instanceCountsByState": { + "$id": "2107", + "kind": "array", + "type": { + "$ref": "510" + }, + "value": [ + { + "$id": "2108", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2109", + "state": { + "$id": "2110", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Creating" + }, + "count": { + "$id": "2111", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 100 + } + } + }, + { + "$id": "2112", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2113", + "state": { + "$id": "2114", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Running" + }, + "count": { + "$id": "2115", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 20 + } + } + }, + { + "$id": "2116", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2117", + "state": { + "$id": "2118", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Deleting" + }, + "count": { + "$id": "2119", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 7 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "2120", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + }, + "status": { + "$id": "2121", + "kind": "model", + "type": { + "$ref": "365" + }, + "value": { + "$id": "2122", + "code": { + "$id": "2123", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "HealthState/healthy" + }, + "message": { + "$id": "2124", + "kind": "string", + "type": { + "$ref": "370" + }, + "value": "The pool is healthy." + } + } + }, + "prediction": { + "$id": "2125", + "kind": "model", + "type": { + "$ref": "530" + }, + "value": { + "$id": "2126", + "forecastValues": { + "$id": "2127", + "kind": "model", + "type": { + "$ref": "532" + }, + "value": { + "$id": "2128", + "instancesRequestedCount": { + "$id": "2129", + "kind": "array", + "type": { + "$ref": "534" + }, + "value": [ + { + "$id": "2130", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 24 + }, + { + "$id": "2131", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 10 + }, + { + "$id": "2132", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 200 + }, + { + "$id": "2133", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 12 + }, + { + "$id": "2134", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 5 + }, + { + "$id": "2135", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 10 + }, + { + "$id": "2136", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 15 + }, + { + "$id": "2137", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 23 + }, + { + "$id": "2138", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 56 + }, + { + "$id": "2139", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 38 + }, + { + "$id": "2140", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 12 + }, + { + "$id": "2141", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 19 + } + ] + } + } + }, + "forecastStartTime": { + "$id": "2142", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "2025-02-14T01:34:59.228Z" + }, + "forecastInfo": { + "$id": "2143", + "kind": "string", + "type": { + "$ref": "546" + }, + "value": "{\"forecastAccuracy\": 85, \"seriesUnitIntervalInMins\": 60, \"instancesRequestedCount_recentHistory\": \"[9, 4, 2, 8, 8, 2, 3, 6, 5, 3, 2, 6]\"}" + } + } + } + } + }, + "id": { + "$id": "2144", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool/runtimeViews/latest" + }, + "name": { + "$id": "2145", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "2146", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools/runtimeViews" + }, + "systemData": { + "$id": "2147", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "2148", + "createdBy": { + "$id": "2149", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "2150", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "2151", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "2152", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "2153", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "2154", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "2155", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "2156", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2157", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "2158", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2159", + "name": "runtimeView", + "nameInRequest": "runtimeView", + "doc": "The unique identifier for the runtime view. The input string should be the word 'latest', which will get the latest runtime view of the pool, otherwise the request will fail with NotFound exception.", + "type": { + "$id": "2160", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2161", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "2052" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "2162", + "type": { + "$ref": "499" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.get" + }, + { + "$id": "2163", + "kind": "paging", + "name": "listByStandbyPool", + "accessibility": "public", + "apiVersions": [ + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "doc": "List StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource", + "operation": { + "$id": "2164", + "name": "listByStandbyPool", + "resourceName": "StandbyContainerGroupPoolRuntimeViewResource", + "doc": "List StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "2165", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "2166", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "2167", + "type": { + "$id": "2168", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2169", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "2170", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2171", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2172", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "2173", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2174", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "2175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2176", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "2177", + "kind": "constant", + "valueType": { + "$id": "2178", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "2179", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "555" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}/runtimeViews", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.listByStandbyPool", + "decorators": [], + "examples": [ + { + "$id": "2180", + "kind": "http", + "name": "StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool", + "description": "StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool", + "filePath": "2025-03-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json", + "parameters": [ + { + "$id": "2181", + "parameter": { + "$ref": "2165" + }, + "value": { + "$id": "2182", + "kind": "string", + "type": { + "$ref": "2166" + }, + "value": "2025-03-01" + } + }, + { + "$id": "2183", + "parameter": { + "$ref": "2169" + }, + "value": { + "$id": "2184", + "kind": "string", + "type": { + "$ref": "2170" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "2185", + "parameter": { + "$ref": "2172" + }, + "value": { + "$id": "2186", + "kind": "string", + "type": { + "$ref": "2173" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "2187", + "parameter": { + "$ref": "2174" + }, + "value": { + "$id": "2188", + "kind": "string", + "type": { + "$ref": "2175" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "2189", + "response": { + "$ref": "2179" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2190", + "kind": "model", + "type": { + "$ref": "555" + }, + "value": { + "$id": "2191", + "value": { + "$id": "2192", + "kind": "array", + "type": { + "$ref": "557" + }, + "value": [ + { + "$id": "2193", + "kind": "model", + "type": { + "$ref": "499" + }, + "value": { + "$id": "2194", + "properties": { + "$id": "2195", + "kind": "model", + "type": { + "$ref": "501" + }, + "value": { + "$id": "2196", + "instanceCountSummary": { + "$id": "2197", + "kind": "array", + "type": { + "$ref": "503" + }, + "value": [ + { + "$id": "2198", + "kind": "model", + "type": { + "$ref": "504" + }, + "value": { + "$id": "2199", + "zone": { + "$id": "2200", + "kind": "number", + "type": { + "$ref": "506" + }, + "value": 1 + }, + "instanceCountsByState": { + "$id": "2201", + "kind": "array", + "type": { + "$ref": "510" + }, + "value": [ + { + "$id": "2202", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2203", + "state": { + "$id": "2204", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Creating" + }, + "count": { + "$id": "2205", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 100 + } + } + }, + { + "$id": "2206", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2207", + "state": { + "$id": "2208", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Running" + }, + "count": { + "$id": "2209", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 20 + } + } + }, + { + "$id": "2210", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2211", + "state": { + "$id": "2212", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Deleting" + }, + "count": { + "$id": "2213", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 21 + } + } + } + ] + } + } + }, + { + "$id": "2214", + "kind": "model", + "type": { + "$ref": "504" + }, + "value": { + "$id": "2215", + "zone": { + "$id": "2216", + "kind": "number", + "type": { + "$ref": "506" + }, + "value": 2 + }, + "instanceCountsByState": { + "$id": "2217", + "kind": "array", + "type": { + "$ref": "510" + }, + "value": [ + { + "$id": "2218", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2219", + "state": { + "$id": "2220", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Creating" + }, + "count": { + "$id": "2221", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 100 + } + } + }, + { + "$id": "2222", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2223", + "state": { + "$id": "2224", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Running" + }, + "count": { + "$id": "2225", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 500 + } + } + }, + { + "$id": "2226", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2227", + "state": { + "$id": "2228", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Deleting" + }, + "count": { + "$id": "2229", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 20 + } + } + } + ] + } + } + }, + { + "$id": "2230", + "kind": "model", + "type": { + "$ref": "504" + }, + "value": { + "$id": "2231", + "zone": { + "$id": "2232", + "kind": "number", + "type": { + "$ref": "506" + }, + "value": 3 + }, + "instanceCountsByState": { + "$id": "2233", + "kind": "array", + "type": { + "$ref": "510" + }, + "value": [ + { + "$id": "2234", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2235", + "state": { + "$id": "2236", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Creating" + }, + "count": { + "$id": "2237", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 100 + } + } + }, + { + "$id": "2238", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2239", + "state": { + "$id": "2240", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Running" + }, + "count": { + "$id": "2241", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 20 + } + } + }, + { + "$id": "2242", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "2243", + "state": { + "$id": "2244", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Deleting" + }, + "count": { + "$id": "2245", + "kind": "number", + "type": { + "$ref": "516" + }, + "value": 7 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "2246", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Succeeded" + }, + "status": { + "$id": "2247", + "kind": "model", + "type": { + "$ref": "365" + }, + "value": { + "$id": "2248", + "code": { + "$id": "2249", + "kind": "string", + "type": { + "$ref": "68" + }, + "value": "HealthState/healthy" + }, + "message": { + "$id": "2250", + "kind": "string", + "type": { + "$ref": "370" + }, + "value": "The pool is healthy." + } + } + }, + "prediction": { + "$id": "2251", + "kind": "model", + "type": { + "$ref": "530" + }, + "value": { + "$id": "2252", + "forecastValues": { + "$id": "2253", + "kind": "model", + "type": { + "$ref": "532" + }, + "value": { + "$id": "2254", + "instancesRequestedCount": { + "$id": "2255", + "kind": "array", + "type": { + "$ref": "534" + }, + "value": [ + { + "$id": "2256", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 24 + }, + { + "$id": "2257", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 10 + }, + { + "$id": "2258", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 200 + }, + { + "$id": "2259", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 12 + }, + { + "$id": "2260", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 5 + }, + { + "$id": "2261", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 10 + }, + { + "$id": "2262", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 15 + }, + { + "$id": "2263", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 23 + }, + { + "$id": "2264", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 56 + }, + { + "$id": "2265", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 38 + }, + { + "$id": "2266", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 12 + }, + { + "$id": "2267", + "kind": "number", + "type": { + "$ref": "535" + }, + "value": 19 + } + ] + } + } + }, + "forecastStartTime": { + "$id": "2268", + "kind": "string", + "type": { + "$ref": "541" + }, + "value": "2025-02-14T01:34:59.228Z" + }, + "forecastInfo": { + "$id": "2269", + "kind": "string", + "type": { + "$ref": "546" + }, + "value": "{\"forecastAccuracy\": 85, \"seriesUnitIntervalInMins\": 60, \"instancesRequestedCount_recentHistory\": \"[9, 4, 2, 8, 8, 2, 3, 6, 5, 3, 2, 6]\"}" + } + } + } + } + }, + "id": { + "$id": "2270", + "kind": "string", + "type": { + "$ref": "175" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool/runtimeViews/latest" + }, + "name": { + "$id": "2271", + "kind": "string", + "type": { + "$ref": "180" + }, + "value": "pool" + }, + "type": { + "$id": "2272", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools/runtimeViews" + }, + "systemData": { + "$id": "2273", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "$id": "2274", + "createdBy": { + "$id": "2275", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "2276", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "createdAt": { + "$id": "2277", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "2278", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "2279", + "kind": "string", + "type": { + "$ref": "32" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "2280", + "kind": "string", + "type": { + "$ref": "210" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "2281", + "kind": "string", + "type": { + "$ref": "561" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "2282", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "2283", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2284", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "2285", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2286", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "2177" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "2287", + "type": { + "$id": "2288", + "kind": "array", + "name": "ArrayStandbyContainerGroupPoolRuntimeViewResource", + "valueType": { + "$ref": "499" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.listByStandbyPool", + "pagingMetadata": { + "$id": "2289", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "2290", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "2291", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "2292", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client", + "defaultValue": { + "$id": "2293", + "type": { + "$id": "2294", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [ + { + "$id": "2295", + "name": "Azure.ResourceManager.@armResourceOperations", + "arguments": { + "$id": "2296" + } + } + ], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews", + "apiVersions": [ + "2024-03-01-preview", + "2024-03-01", + "2025-03-01" + ], + "parent": { + "$ref": "565" + } + } + ] + } + ], + "auth": { + "$id": "2297", + "oAuth2": { + "$id": "2298", + "scopes": [ + "user_impersonation" + ] + } + } +} 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..02ddd1b33a25 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/workloads/Workloads.SAPVirtualInstance.Management +commit: 47fb75e55cbbcaf8d65602ad991885e7dfd49a1e +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