From a9d63a0b8fcd093068aed1c1b8956723b95debf2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 24 Mar 2025 06:11:56 +0000 Subject: [PATCH] CodeGen from PR 33338 in Azure/azure-rest-api-specs Merge ba3f791de6a41f06ecd6a6f49396ecd0306e3562 into 4867a6ee9ee5d21e86f2d4bfac91cf6b5253272d --- ...anager.CommonEdgeSiteManagerOperations.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 80 + ....CommonEdgeSiteManagerOperations.net8.0.cs | 0 ...dgeSiteManagerOperations.netstandard2.0.cs | 0 .../assets.json | 7 + ...onEdgeSiteManagerOperations.Samples.csproj | 13 + ...ger.CommonEdgeSiteManagerOperations.csproj | 8 + .../src/Generated/ProviderConstants.cs | 16 + .../src/Properties/AssemblyInfo.cs | 11 + ...mmonEdgeSiteManagerOperations.Tests.csproj | 8 + ...SiteManagerOperationsManagementTestBase.cs | 45 + ...agerOperationsManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 4 + .../ci.mgmt.yml | 26 + ...e.ResourceManager.DatabaseFleetManager.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 80 + ...urceManager.DatabaseFleetManager.net8.0.cs | 637 + ...ger.DatabaseFleetManager.netstandard2.0.cs | 637 + .../assets.json | 7 + ...anager.DatabaseFleetManager.Samples.csproj | 13 + .../Samples/Sample_FirewallRuleCollection.cs | 209 + .../Samples/Sample_FirewallRuleResource.cs | 120 + .../Samples/Sample_FleetCollection.cs | 204 + .../Samples/Sample_FleetDatabaseCollection.cs | 232 + .../Samples/Sample_FleetDatabaseResource.cs | 236 + .../Generated/Samples/Sample_FleetResource.cs | 118 + .../Samples/Sample_FleetTierCollection.cs | 213 + .../Samples/Sample_FleetTierResource.cs | 157 + .../Samples/Sample_FleetspaceCollection.cs | 211 + .../Samples/Sample_FleetspaceResource.cs | 186 + .../Sample_SubscriptionResourceExtensions.cs | 50 + ...esourceManager.DatabaseFleetManager.csproj | 8 + .../ArmDatabaseFleetManagerModelFactory.cs | 220 + .../DatabaseFleetManagerExtensions.cs | 295 + .../MockableDatabaseFleetManagerArmClient.cs | 97 + ...tabaseFleetManagerResourceGroupResource.cs | 105 + ...atabaseFleetManagerSubscriptionResource.cs | 102 + .../src/Generated/FirewallRuleCollection.cs | 499 + .../FirewallRuleData.Serialization.cs | 155 + .../src/Generated/FirewallRuleData.cs | 75 + .../FirewallRuleResource.Serialization.cs | 26 + .../src/Generated/FirewallRuleResource.cs | 348 + .../src/Generated/FleetCollection.cs | 500 + .../src/Generated/FleetData.Serialization.cs | 178 + .../src/Generated/FleetData.cs | 83 + .../src/Generated/FleetDatabaseCollection.cs | 501 + .../FleetDatabaseData.Serialization.cs | 155 + .../src/Generated/FleetDatabaseData.cs | 75 + .../FleetDatabaseResource.Serialization.cs | 26 + .../src/Generated/FleetDatabaseResource.cs | 617 + .../Generated/FleetResource.Serialization.cs | 26 + .../src/Generated/FleetResource.cs | 845 + .../src/Generated/FleetTierCollection.cs | 499 + .../Generated/FleetTierData.Serialization.cs | 155 + .../src/Generated/FleetTierData.cs | 75 + .../FleetTierResource.Serialization.cs | 26 + .../src/Generated/FleetTierResource.cs | 423 + .../src/Generated/FleetspaceCollection.cs | 499 + .../Generated/FleetspaceData.Serialization.cs | 155 + .../src/Generated/FleetspaceData.cs | 75 + .../FleetspaceResource.Serialization.cs | 26 + .../src/Generated/FleetspaceResource.cs | 662 + .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 + .../Generated/Internal/ChangeTrackingList.cs | 153 + .../Internal/ModelSerializationExtensions.cs | 399 + .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + .../DatabaseFleetManagerArmOperation.cs | 94 + .../DatabaseFleetManagerArmOperationOfT.cs | 100 + .../FirewallRuleOperationSource.cs | 36 + .../FleetDatabaseOperationSource.cs | 36 + .../FleetOperationSource.cs | 36 + .../FleetTierOperationSource.cs | 36 + .../FleetspaceOperationSource.cs | 36 + .../Models/AzureProvisioningState.cs | 60 + ...abaseChangeTierProperties.Serialization.cs | 129 + .../Models/DatabaseChangeTierProperties.cs | 65 + .../Generated/Models/DatabaseCreateMode.cs | 54 + .../Models/DatabaseIdentity.Serialization.cs | 163 + .../src/Generated/Models/DatabaseIdentity.cs | 74 + .../DatabaseRenameProperties.Serialization.cs | 129 + .../Models/DatabaseRenameProperties.cs | 65 + .../DestinationTierOverride.Serialization.cs | 142 + .../Models/DestinationTierOverride.cs | 88 + .../FirewallRuleListResult.Serialization.cs | 151 + .../Models/FirewallRuleListResult.cs | 80 + .../FirewallRuleProperties.Serialization.cs | 155 + .../Models/FirewallRuleProperties.cs | 73 + .../FleetDatabaseListResult.Serialization.cs | 151 + .../Models/FleetDatabaseListResult.cs | 80 + .../FleetDatabaseProperties.Serialization.cs | 366 + .../Models/FleetDatabaseProperties.cs | 126 + .../Models/FleetListResult.Serialization.cs | 151 + .../src/Generated/Models/FleetListResult.cs | 80 + .../Models/FleetPatch.Serialization.cs | 159 + .../src/Generated/Models/FleetPatch.cs | 70 + .../Models/FleetProperties.Serialization.cs | 144 + .../src/Generated/Models/FleetProperties.cs | 69 + .../FleetTierListResult.Serialization.cs | 151 + .../Generated/Models/FleetTierListResult.cs | 80 + .../FleetTierProperties.Serialization.cs | 319 + .../Generated/Models/FleetTierProperties.cs | 113 + .../FleetspaceListResult.Serialization.cs | 151 + .../Generated/Models/FleetspaceListResult.cs | 80 + .../FleetspaceProperties.Serialization.cs | 163 + .../Generated/Models/FleetspaceProperties.cs | 73 + .../IdentityProperties.Serialization.cs | 173 + .../Generated/Models/IdentityProperties.cs | 74 + .../src/Generated/Models/IdentityType.cs | 51 + .../Models/MainPrincipal.Serialization.cs | 195 + .../src/Generated/Models/MainPrincipal.cs | 81 + .../src/Generated/Models/PrincipalType.cs | 51 + .../RegisterServerProperties.Serialization.cs | 193 + .../Models/RegisterServerProperties.cs | 82 + .../src/Generated/Models/ResourceType.cs | 51 + ...TransparentDataEncryption.Serialization.cs | 173 + .../Models/TransparentDataEncryption.cs | 74 + .../src/Generated/Models/ZoneRedundancy.cs | 51 + .../src/Generated/ProviderConstants.cs | 16 + .../FirewallRulesRestOperations.cs | 585 + .../FleetDatabasesRestOperations.cs | 1021 + .../FleetTiersRestOperations.cs | 751 + .../RestOperations/FleetsRestOperations.cs | 759 + .../FleetspacesRestOperations.cs | 841 + .../src/Properties/AssemblyInfo.cs | 11 + ...eManager.DatabaseFleetManager.Tests.csproj | 8 + .../DatabaseFleetManagerManagementTestBase.cs | 45 + ...seFleetManagerManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 4 + sdk/databasefleetmanager/ci.mgmt.yml | 26 + .../ActionParameters.Serialization.cs | 145 + .../src/Generated/ActionParameters.cs | 73 + .../AnalyticsDefenderEasmModelFactory.cs | 256 +- ...setChainKindSummaryResult.Serialization.cs | 150 + .../Generated/AssetChainKindSummaryResult.cs | 78 + .../AssetChainRequest.Serialization.cs | 160 + .../src/Generated/AssetChainRequest.cs | 82 + .../src/Generated/AssetChainSource.cs | 51 + .../AssetChainSummaryResult.Serialization.cs | 195 + .../src/Generated/AssetChainSummaryResult.cs | 88 + .../src/Generated/AssetKind.cs | 69 + .../src/Generated/AssetResponseType.cs | 57 + .../AssetUpdatePayload.Serialization.cs | 33 +- .../src/Generated/AssetUpdatePayload.cs | 7 +- .../AssetsExportRequest.Serialization.cs | 160 + .../src/Generated/AssetsExportRequest.cs | 83 + .../src/Generated/AuditTrailItem.cs | 4 +- .../AzureDataExplorerDataConnection.cs | 4 +- .../AzureDataExplorerDataConnectionPayload.cs | 2 +- .../Generated/CisaCveResult.Serialization.cs | 237 + .../src/Generated/CisaCveResult.cs | 138 + .../DailyDeltaTypeResponse.Serialization.cs | 158 + .../src/Generated/DailyDeltaTypeResponse.cs | 47 + .../src/Generated/DataConnection.cs | 8 +- .../src/Generated/DataConnectionPayload.cs | 4 +- .../DeltaDateResult.Serialization.cs | 160 + .../src/Generated/DeltaDateResult.cs | 82 + .../src/Generated/DeltaDetailType.cs | 51 + .../DeltaDetailsRequest.Serialization.cs | 176 + .../src/Generated/DeltaDetailsRequest.cs | 86 + .../DeltaRangeResult.Serialization.cs | 190 + .../src/Generated/DeltaRangeResult.cs | 100 + .../Generated/DeltaResult.Serialization.cs | 180 + .../src/Generated/DeltaResult.cs | 99 + .../DeltaSummaryRequest.Serialization.cs | 160 + .../src/Generated/DeltaSummaryRequest.cs | 69 + .../DeltaSummaryResult.Serialization.cs | 160 + .../src/Generated/DeltaSummaryResult.cs | 83 + .../DeltaTypeResponse.Serialization.cs | 166 + .../src/Generated/DeltaTypeResponse.cs | 90 + .../DiscoGroupSummaryResult.Serialization.cs | 158 + .../src/Generated/DiscoGroupSummaryResult.cs | 89 + .../src/Generated/DiscoveryGroup.cs | 4 +- .../src/Generated/Docs/EasmClient.xml | 1628 +- .../src/Generated/EasmClient.cs | 3417 +++- .../src/Generated/EasmClientOptions.cs | 8 +- .../Generated/ErrorResponse.Serialization.cs | 142 + .../src/Generated/ErrorResponse.cs | 75 + .../src/Generated/GlobalAssetType.cs | 78 + .../src/Generated/GlobalInventoryState.cs | 72 + .../Generated/LogAnalyticsDataConnection.cs | 4 +- .../LogAnalyticsDataConnectionPayload.cs | 2 +- .../ObservationPageResult.Serialization.cs | 179 + .../src/Generated/ObservationPageResult.cs | 89 + .../src/Generated/ObservationPriority.cs | 57 + ...bservationRemediationItem.Serialization.cs | 158 + .../Generated/ObservationRemediationItem.cs | 87 + .../Generated/ObservationRemediationSource.cs | 51 + .../Generated/ObservationRemediationState.cs | 51 + .../ObservationResult.Serialization.cs | 208 + .../src/Generated/ObservationResult.cs | 113 + .../src/Generated/ObservationType.cs | 51 + .../src/Generated/Policy.Serialization.cs | 270 + .../src/Generated/Policy.cs | 120 + .../src/Generated/PolicyAction.cs | 60 + ...ssetSnapshotExportPayload.Serialization.cs | 181 + .../ReportAssetSnapshotExportPayload.cs | 74 + .../src/Generated/SavedFilter.cs | 4 +- .../src/Generated/UnknownDataConnection.cs | 4 +- .../Generated/UnknownDataConnectionPayload.cs | 2 +- .../Generated/Samples/Samples_EasmClient.cs | 1499 +- .../tsp-location.yaml | 4 +- .../Configuration.json | 12 + .../tsp-location.yaml | 3 +- .../tspCodeModel.json | 10355 ++++++++++ sdk/resourcemanager/ci.mgmt.yml | 4 + .../Configuration.json | 12 + .../tsp-location.yaml | 7 +- .../tspCodeModel.json | 16273 ++++++++++++++++ sdk/storage/ci.yml | 4 + .../tsp-location.yaml | 6 +- 216 files changed, 60355 insertions(+), 1226 deletions(-) create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations.sln create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/CHANGELOG.md create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/Directory.Build.props create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/README.md create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/api/Azure.ResourceManager.CommonEdgeSiteManagerOperations.net8.0.cs create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/api/Azure.ResourceManager.CommonEdgeSiteManagerOperations.netstandard2.0.cs create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/assets.json create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/samples/Azure.ResourceManager.CommonEdgeSiteManagerOperations.Samples.csproj create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/src/Azure.ResourceManager.CommonEdgeSiteManagerOperations.csproj create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/src/Generated/ProviderConstants.cs create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/src/Properties/AssemblyInfo.cs create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tests/Azure.ResourceManager.CommonEdgeSiteManagerOperations.Tests.csproj create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tests/CommonEdgeSiteManagerOperationsManagementTestBase.cs create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tests/CommonEdgeSiteManagerOperationsManagementTestEnvironment.cs create mode 100644 sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tsp-location.yaml create mode 100644 sdk/commonedgesitemanageroperations/ci.mgmt.yml create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Azure.ResourceManager.DatabaseFleetManager.sln create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/CHANGELOG.md create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Directory.Build.props create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/README.md create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.net8.0.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.netstandard2.0.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/assets.json create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Azure.ResourceManager.DatabaseFleetManager.Samples.csproj create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Azure.ResourceManager.DatabaseFleetManager.csproj create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ArmDatabaseFleetManagerModelFactory.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/DatabaseFleetManagerExtensions.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerArmClient.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerResourceGroupResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerSubscriptionResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Argument.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Optional.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperation.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperationOfT.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FirewallRuleOperationSource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetDatabaseOperationSource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetOperationSource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetTierOperationSource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetspaceOperationSource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/AzureProvisioningState.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseCreateMode.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityType.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/PrincipalType.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ResourceType.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ZoneRedundancy.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ProviderConstants.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FirewallRulesRestOperations.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetDatabasesRestOperations.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetTiersRestOperations.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetsRestOperations.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetspacesRestOperations.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Properties/AssemblyInfo.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/Azure.ResourceManager.DatabaseFleetManager.Tests.csproj create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestBase.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestEnvironment.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tsp-location.yaml create mode 100644 sdk/databasefleetmanager/ci.mgmt.yml create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ActionParameters.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ActionParameters.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSource.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetKind.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResponseType.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailType.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryRequest.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryRequest.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaTypeResponse.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaTypeResponse.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupSummaryResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupSummaryResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorResponse.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorResponse.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GlobalAssetType.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GlobalInventoryState.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationPageResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationPageResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationPriority.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationItem.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationItem.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationSource.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationState.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationType.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Policy.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Policy.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PolicyAction.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotExportPayload.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotExportPayload.cs create mode 100644 sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/Configuration.json create mode 100644 sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/tspCodeModel.json create mode 100644 sdk/standbypool/Azure.ResourceManager.StandbyPool/Configuration.json create mode 100644 sdk/standbypool/Azure.ResourceManager.StandbyPool/tspCodeModel.json diff --git a/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations.sln b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations.sln new file mode 100644 index 000000000000..3febeda1d79a --- /dev/null +++ b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations.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.CommonEdgeSiteManagerOperations.Samples", "samples\Azure.ResourceManager.CommonEdgeSiteManagerOperations.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.CommonEdgeSiteManagerOperations", "src\Azure.ResourceManager.CommonEdgeSiteManagerOperations.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.CommonEdgeSiteManagerOperations.Tests", "tests\Azure.ResourceManager.CommonEdgeSiteManagerOperations.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/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/CHANGELOG.md b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/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/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/Directory.Build.props b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/README.md b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/README.md new file mode 100644 index 000000000000..400d3289e91b --- /dev/null +++ b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure CommonEdgeSiteManagerOperations 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 CommonEdgeSiteManagerOperations management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.CommonEdgeSiteManagerOperations --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/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/api/Azure.ResourceManager.CommonEdgeSiteManagerOperations.net8.0.cs b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/api/Azure.ResourceManager.CommonEdgeSiteManagerOperations.net8.0.cs new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/api/Azure.ResourceManager.CommonEdgeSiteManagerOperations.netstandard2.0.cs b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/api/Azure.ResourceManager.CommonEdgeSiteManagerOperations.netstandard2.0.cs new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/assets.json b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/assets.json new file mode 100644 index 000000000000..72dd3de501b8 --- /dev/null +++ b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations", + "Tag": "" +} diff --git a/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/samples/Azure.ResourceManager.CommonEdgeSiteManagerOperations.Samples.csproj b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/samples/Azure.ResourceManager.CommonEdgeSiteManagerOperations.Samples.csproj new file mode 100644 index 000000000000..3bd0d2c2c204 --- /dev/null +++ b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/samples/Azure.ResourceManager.CommonEdgeSiteManagerOperations.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/src/Azure.ResourceManager.CommonEdgeSiteManagerOperations.csproj b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/src/Azure.ResourceManager.CommonEdgeSiteManagerOperations.csproj new file mode 100644 index 000000000000..734b7f9162de --- /dev/null +++ b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/src/Azure.ResourceManager.CommonEdgeSiteManagerOperations.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider CommonEdgeSiteManagerOperations. + 1.0.0-beta.1 + azure;management;arm;resource manager;commonedgesitemanageroperations + Azure.ResourceManager.CommonEdgeSiteManagerOperations + + diff --git a/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/src/Generated/ProviderConstants.cs b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..adf411bd9ea6 --- /dev/null +++ b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/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.CommonEdgeSiteManagerOperations +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/src/Properties/AssemblyInfo.cs b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..7e11c0643466 --- /dev/null +++ b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/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.CommonEdgeSiteManagerOperations.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("CommonEdgeSiteManagerOperations")] diff --git a/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tests/Azure.ResourceManager.CommonEdgeSiteManagerOperations.Tests.csproj b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tests/Azure.ResourceManager.CommonEdgeSiteManagerOperations.Tests.csproj new file mode 100644 index 000000000000..1efc30b94c13 --- /dev/null +++ b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tests/Azure.ResourceManager.CommonEdgeSiteManagerOperations.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tests/CommonEdgeSiteManagerOperationsManagementTestBase.cs b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tests/CommonEdgeSiteManagerOperationsManagementTestBase.cs new file mode 100644 index 000000000000..2990bf3079ac --- /dev/null +++ b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tests/CommonEdgeSiteManagerOperationsManagementTestBase.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.CommonEdgeSiteManagerOperations.Tests +{ + public class CommonEdgeSiteManagerOperationsManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected CommonEdgeSiteManagerOperationsManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected CommonEdgeSiteManagerOperationsManagementTestBase(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/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tests/CommonEdgeSiteManagerOperationsManagementTestEnvironment.cs b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tests/CommonEdgeSiteManagerOperationsManagementTestEnvironment.cs new file mode 100644 index 000000000000..be1d6c3c9e66 --- /dev/null +++ b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tests/CommonEdgeSiteManagerOperationsManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.CommonEdgeSiteManagerOperations.Tests +{ + public class CommonEdgeSiteManagerOperationsManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tsp-location.yaml b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tsp-location.yaml new file mode 100644 index 000000000000..6071fe278e93 --- /dev/null +++ b/sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/edge/Microsoft.Edge.Management +commit: 216cc05a932c0770a40b19ebafd0c76a5c17809b +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/commonedgesitemanageroperations/ci.mgmt.yml b/sdk/commonedgesitemanageroperations/ci.mgmt.yml new file mode 100644 index 000000000000..da6ca6240b7a --- /dev/null +++ b/sdk/commonedgesitemanageroperations/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/commonedgesitemanageroperations /ci.mgmt.yml + - sdk/commonedgesitemanageroperations /Azure.ResourceManager.CommonEdgeSiteManagerOperations / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: commonedgesitemanageroperations + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.CommonEdgeSiteManagerOperations + safeName: AzureResourceManagerCommonEdgeSiteManagerOperations diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Azure.ResourceManager.DatabaseFleetManager.sln b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Azure.ResourceManager.DatabaseFleetManager.sln new file mode 100644 index 000000000000..089254656cac --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Azure.ResourceManager.DatabaseFleetManager.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.DatabaseFleetManager.Samples", "samples\Azure.ResourceManager.DatabaseFleetManager.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.DatabaseFleetManager", "src\Azure.ResourceManager.DatabaseFleetManager.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.DatabaseFleetManager.Tests", "tests\Azure.ResourceManager.DatabaseFleetManager.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/CHANGELOG.md b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes \ No newline at end of file diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Directory.Build.props b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/README.md b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/README.md new file mode 100644 index 000000000000..ce57f5065e0e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure DatabaseFleetManager management client library for .NET + +**[Describe the service briefly first.]** + +This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +## Getting started + +### Install the package + +Install the Microsoft Azure DatabaseFleetManager management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.DatabaseFleetManager --prerelease +``` + +### Prerequisites + +* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). + +## Key concepts + +Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html) + +## Documentation + +Documentation is available to help you learn how to use this package: + +- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). +- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). + +## Examples + +Code samples for using the management library for .NET can be found in the following locations +- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.net8.0.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.net8.0.cs new file mode 100644 index 000000000000..3cd9005cfaab --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.net8.0.cs @@ -0,0 +1,637 @@ +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public static partial class DatabaseFleetManagerExtensions + { + public static Azure.ResourceManager.DatabaseFleetManager.FirewallRuleResource GetFirewallRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetFleet(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetFleetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseResource GetFleetDatabaseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetResource GetFleetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetCollection GetFleets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetFleets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetFleetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetspaceResource GetFleetspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetTierResource GetFleetTierResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class FirewallRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FirewallRuleCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string firewallRuleName, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string firewallRuleName, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FirewallRuleData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FirewallRuleData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FirewallRuleResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FirewallRuleResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.DatabaseFleetManager.FleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.DatabaseFleetManager.FleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetDatabaseCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string databaseName, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string databaseName, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string filter = null, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string filter = null, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetDatabaseData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetDatabaseData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetDatabaseResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.ResourceManager.ArmOperation ChangeTier(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ChangeTierAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Rename(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RenameAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Revert(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RevertAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFleetspace(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetspaceAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceCollection GetFleetspaces() { throw null; } + public virtual Azure.Response GetFleetTier(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetTierAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierCollection GetFleetTiers() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetspaceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetspaceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetspaceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetspaceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetspaceResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFirewallRule(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFirewallRuleAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleCollection GetFirewallRules() { throw null; } + public virtual Azure.Response GetFleetDatabase(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetDatabaseAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseCollection GetFleetDatabases() { throw null; } + public virtual Azure.ResourceManager.ArmOperation RegisterServer(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RegisterServerAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Unregister(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UnregisterAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetTierCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetTierCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string tierName, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string tierName, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetTierData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetTierData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetTierResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetTierResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string tierName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Disable(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DisableAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseFleetManager.Mocking +{ + public partial class MockableDatabaseFleetManagerArmClient : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerArmClient() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleResource GetFirewallRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseResource GetFleetDatabaseResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetResource GetFleetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceResource GetFleetspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierResource GetFleetTierResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableDatabaseFleetManagerResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerResourceGroupResource() { } + public virtual Azure.Response GetFleet(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetCollection GetFleets() { throw null; } + } + public partial class MockableDatabaseFleetManagerSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerSubscriptionResource() { } + public virtual Azure.Pageable GetFleets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetFleetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public static partial class ArmDatabaseFleetManagerModelFactory + { + public static Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData FirewallRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties FirewallRuleProperties(string startIPAddress = null, string endIPAddress = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetData FleetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData FleetDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties FleetDatabaseProperties(string originalDatabaseId = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?), Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode? createMode = default(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode?), string tierName = null, string connectionString = null, bool? recoverable = default(bool?), System.DateTimeOffset? restoreFromOn = default(System.DateTimeOffset?), System.DateTimeOffset? earliestRestoreOn = default(System.DateTimeOffset?), System.DateTimeOffset? latestRestoreOn = default(System.DateTimeOffset?), int? backupRetentionDays = default(int?), int? databaseSizeGbMax = default(int?), string sourceDatabaseName = null, System.Collections.Generic.IDictionary resourceTags = null, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties identity = null, Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption transparentDataEncryption = null, string collation = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties FleetProperties(string description = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetspaceData FleetspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties FleetspaceProperties(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?), int? capacityMax = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal mainPrincipal = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetTierData FleetTierData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties FleetTierProperties(bool? disabled = default(bool?), bool? serverless = default(bool?), bool? pooled = default(bool?), string serviceTier = null, string family = null, int? capacity = default(int?), int? poolNumOfDatabasesMax = default(int?), int? highAvailabilityReplicaCount = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy?), double? databaseCapacityMin = default(double?), double? databaseCapacityMax = default(double?), int? databaseSizeGbMax = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState left, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState left, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DatabaseChangeTierProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseChangeTierProperties() { } + public string TargetTierName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DatabaseCreateMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DatabaseCreateMode(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode Copy { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode Default { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode PointInTimeRestore { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode left, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode left, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DatabaseIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseIdentity() { } + public System.Guid? ClientId { get { throw null; } set { } } + public System.Guid? PrincipalId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DatabaseRenameProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseRenameProperties() { } + public string NewName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DestinationTierOverride : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DestinationTierOverride(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType resourceType, string tierName, string resourceName) { } + public string ResourceName { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType ResourceType { get { throw null; } } + public string TierName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DestinationTierOverride System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DestinationTierOverride System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FirewallRuleProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FirewallRuleProperties() { } + public string EndIPAddress { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public string StartIPAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetDatabaseProperties() { } + public int? BackupRetentionDays { get { throw null; } } + public string Collation { get { throw null; } set { } } + public string ConnectionString { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode? CreateMode { get { throw null; } set { } } + public int? DatabaseSizeGbMax { get { throw null; } } + public System.DateTimeOffset? EarliestRestoreOn { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties Identity { get { throw null; } set { } } + public System.DateTimeOffset? LatestRestoreOn { get { throw null; } } + public string OriginalDatabaseId { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public bool? Recoverable { get { throw null; } } + public System.Collections.Generic.IDictionary ResourceTags { get { throw null; } } + public System.DateTimeOffset? RestoreFromOn { get { throw null; } set { } } + public string SourceDatabaseName { get { throw null; } set { } } + public string TierName { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption TransparentDataEncryption { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetPatch() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetProperties() { } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetspaceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceProperties() { } + public int? CapacityMax { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal MainPrincipal { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetTierProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetTierProperties() { } + public int? Capacity { get { throw null; } set { } } + public double? DatabaseCapacityMax { get { throw null; } set { } } + public double? DatabaseCapacityMin { get { throw null; } set { } } + public int? DatabaseSizeGbMax { get { throw null; } set { } } + public bool? Disabled { get { throw null; } } + public string Family { get { throw null; } set { } } + public int? HighAvailabilityReplicaCount { get { throw null; } set { } } + public bool? Pooled { get { throw null; } set { } } + public int? PoolNumOfDatabasesMax { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public bool? Serverless { get { throw null; } set { } } + public string ServiceTier { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy? ZoneRedundancy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IdentityProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IdentityProperties() { } + public System.Guid? FederatedClientId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType? IdentityType { get { throw null; } set { } } + public System.Collections.Generic.IList UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IdentityType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType None { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType left, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType left, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MainPrincipal : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MainPrincipal() { } + public System.Guid? ApplicationId { get { throw null; } set { } } + public string Login { get { throw null; } set { } } + public System.Guid? ObjectId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType? PrincipalType { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PrincipalType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrincipalType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType Application { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType User { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType left, Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType left, Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RegisterServerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RegisterServerProperties() { } + public System.Collections.Generic.IList DestinationTierOverrides { get { throw null; } } + public string SourceResourceGroupName { get { throw null; } set { } } + public string SourceServerName { get { throw null; } set { } } + public string SourceSubscriptionId { get { throw null; } set { } } + public string TierName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType Database { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType Pool { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType left, Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType left, Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TransparentDataEncryption : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TransparentDataEncryption() { } + public bool? EnableAutoRotation { get { throw null; } set { } } + public System.Collections.Generic.IList Keys { get { throw null; } } + public System.Uri KeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ZoneRedundancy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ZoneRedundancy(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy Disabled { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy left, Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy left, Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.netstandard2.0.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.netstandard2.0.cs new file mode 100644 index 000000000000..3cd9005cfaab --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.netstandard2.0.cs @@ -0,0 +1,637 @@ +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public static partial class DatabaseFleetManagerExtensions + { + public static Azure.ResourceManager.DatabaseFleetManager.FirewallRuleResource GetFirewallRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetFleet(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetFleetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseResource GetFleetDatabaseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetResource GetFleetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetCollection GetFleets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetFleets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetFleetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetspaceResource GetFleetspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetTierResource GetFleetTierResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class FirewallRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FirewallRuleCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string firewallRuleName, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string firewallRuleName, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FirewallRuleData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FirewallRuleData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FirewallRuleResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FirewallRuleResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.DatabaseFleetManager.FleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.DatabaseFleetManager.FleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetDatabaseCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string databaseName, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string databaseName, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string filter = null, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string filter = null, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetDatabaseData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetDatabaseData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetDatabaseResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.ResourceManager.ArmOperation ChangeTier(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ChangeTierAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Rename(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RenameAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Revert(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RevertAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFleetspace(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetspaceAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceCollection GetFleetspaces() { throw null; } + public virtual Azure.Response GetFleetTier(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetTierAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierCollection GetFleetTiers() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetspaceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetspaceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetspaceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetspaceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetspaceResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFirewallRule(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFirewallRuleAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleCollection GetFirewallRules() { throw null; } + public virtual Azure.Response GetFleetDatabase(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetDatabaseAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseCollection GetFleetDatabases() { throw null; } + public virtual Azure.ResourceManager.ArmOperation RegisterServer(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RegisterServerAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Unregister(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UnregisterAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetTierCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetTierCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string tierName, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string tierName, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetTierData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetTierData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetTierResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetTierResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string tierName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Disable(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DisableAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseFleetManager.Mocking +{ + public partial class MockableDatabaseFleetManagerArmClient : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerArmClient() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleResource GetFirewallRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseResource GetFleetDatabaseResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetResource GetFleetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceResource GetFleetspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierResource GetFleetTierResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableDatabaseFleetManagerResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerResourceGroupResource() { } + public virtual Azure.Response GetFleet(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetCollection GetFleets() { throw null; } + } + public partial class MockableDatabaseFleetManagerSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerSubscriptionResource() { } + public virtual Azure.Pageable GetFleets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetFleetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public static partial class ArmDatabaseFleetManagerModelFactory + { + public static Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData FirewallRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties FirewallRuleProperties(string startIPAddress = null, string endIPAddress = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetData FleetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData FleetDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties FleetDatabaseProperties(string originalDatabaseId = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?), Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode? createMode = default(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode?), string tierName = null, string connectionString = null, bool? recoverable = default(bool?), System.DateTimeOffset? restoreFromOn = default(System.DateTimeOffset?), System.DateTimeOffset? earliestRestoreOn = default(System.DateTimeOffset?), System.DateTimeOffset? latestRestoreOn = default(System.DateTimeOffset?), int? backupRetentionDays = default(int?), int? databaseSizeGbMax = default(int?), string sourceDatabaseName = null, System.Collections.Generic.IDictionary resourceTags = null, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties identity = null, Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption transparentDataEncryption = null, string collation = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties FleetProperties(string description = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetspaceData FleetspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties FleetspaceProperties(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?), int? capacityMax = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal mainPrincipal = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetTierData FleetTierData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties FleetTierProperties(bool? disabled = default(bool?), bool? serverless = default(bool?), bool? pooled = default(bool?), string serviceTier = null, string family = null, int? capacity = default(int?), int? poolNumOfDatabasesMax = default(int?), int? highAvailabilityReplicaCount = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy?), double? databaseCapacityMin = default(double?), double? databaseCapacityMax = default(double?), int? databaseSizeGbMax = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState left, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState left, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DatabaseChangeTierProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseChangeTierProperties() { } + public string TargetTierName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DatabaseCreateMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DatabaseCreateMode(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode Copy { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode Default { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode PointInTimeRestore { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode left, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode left, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DatabaseIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseIdentity() { } + public System.Guid? ClientId { get { throw null; } set { } } + public System.Guid? PrincipalId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DatabaseRenameProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseRenameProperties() { } + public string NewName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DestinationTierOverride : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DestinationTierOverride(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType resourceType, string tierName, string resourceName) { } + public string ResourceName { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType ResourceType { get { throw null; } } + public string TierName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DestinationTierOverride System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DestinationTierOverride System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FirewallRuleProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FirewallRuleProperties() { } + public string EndIPAddress { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public string StartIPAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetDatabaseProperties() { } + public int? BackupRetentionDays { get { throw null; } } + public string Collation { get { throw null; } set { } } + public string ConnectionString { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode? CreateMode { get { throw null; } set { } } + public int? DatabaseSizeGbMax { get { throw null; } } + public System.DateTimeOffset? EarliestRestoreOn { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties Identity { get { throw null; } set { } } + public System.DateTimeOffset? LatestRestoreOn { get { throw null; } } + public string OriginalDatabaseId { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public bool? Recoverable { get { throw null; } } + public System.Collections.Generic.IDictionary ResourceTags { get { throw null; } } + public System.DateTimeOffset? RestoreFromOn { get { throw null; } set { } } + public string SourceDatabaseName { get { throw null; } set { } } + public string TierName { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption TransparentDataEncryption { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetPatch() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetProperties() { } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetspaceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceProperties() { } + public int? CapacityMax { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal MainPrincipal { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetTierProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetTierProperties() { } + public int? Capacity { get { throw null; } set { } } + public double? DatabaseCapacityMax { get { throw null; } set { } } + public double? DatabaseCapacityMin { get { throw null; } set { } } + public int? DatabaseSizeGbMax { get { throw null; } set { } } + public bool? Disabled { get { throw null; } } + public string Family { get { throw null; } set { } } + public int? HighAvailabilityReplicaCount { get { throw null; } set { } } + public bool? Pooled { get { throw null; } set { } } + public int? PoolNumOfDatabasesMax { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public bool? Serverless { get { throw null; } set { } } + public string ServiceTier { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy? ZoneRedundancy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IdentityProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IdentityProperties() { } + public System.Guid? FederatedClientId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType? IdentityType { get { throw null; } set { } } + public System.Collections.Generic.IList UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IdentityType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType None { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType left, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType left, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MainPrincipal : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MainPrincipal() { } + public System.Guid? ApplicationId { get { throw null; } set { } } + public string Login { get { throw null; } set { } } + public System.Guid? ObjectId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType? PrincipalType { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PrincipalType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrincipalType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType Application { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType User { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType left, Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType left, Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RegisterServerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RegisterServerProperties() { } + public System.Collections.Generic.IList DestinationTierOverrides { get { throw null; } } + public string SourceResourceGroupName { get { throw null; } set { } } + public string SourceServerName { get { throw null; } set { } } + public string SourceSubscriptionId { get { throw null; } set { } } + public string TierName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType Database { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType Pool { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType left, Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType left, Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TransparentDataEncryption : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TransparentDataEncryption() { } + public bool? EnableAutoRotation { get { throw null; } set { } } + public System.Collections.Generic.IList Keys { get { throw null; } } + public System.Uri KeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ZoneRedundancy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ZoneRedundancy(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy Disabled { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy left, Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy left, Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/assets.json b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/assets.json new file mode 100644 index 000000000000..a3ae9749e088 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager", + "Tag": "" +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Azure.ResourceManager.DatabaseFleetManager.Samples.csproj b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Azure.ResourceManager.DatabaseFleetManager.Samples.csproj new file mode 100644 index 000000000000..1591846d9047 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Azure.ResourceManager.DatabaseFleetManager.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleCollection.cs new file mode 100644 index 000000000000..460fbae841d0 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleCollection.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FirewallRuleCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + FirewallRuleData data = new FirewallRuleData + { + Properties = new FirewallRuleProperties + { + StartIPAddress = "10.0.0.0", + EndIPAddress = "10.0.0.255", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, firewallRuleName, data); + FirewallRuleResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FirewallRuleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + FirewallRuleResource result = await collection.GetAsync(firewallRuleName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FirewallRuleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListFirewallRulesByFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_ListByFleetspace_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_ListByFleetspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation and iterate over the result + await foreach (FirewallRuleResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FirewallRuleData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + bool result = await collection.ExistsAsync(firewallRuleName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + NullableResponse response = await collection.GetIfExistsAsync(firewallRuleName); + FirewallRuleResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FirewallRuleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleResource.cs new file mode 100644 index 000000000000..87e86ff9cd3d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleResource.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FirewallRuleResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FirewallRuleResource created on azure + // for more information of creating FirewallRuleResource, please refer to the document of FirewallRuleResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + ResourceIdentifier firewallRuleResourceId = FirewallRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + FirewallRuleResource firewallRule = client.GetFirewallRuleResource(firewallRuleResourceId); + + // invoke the operation + FirewallRuleResource result = await firewallRule.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FirewallRuleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FirewallRuleResource created on azure + // for more information of creating FirewallRuleResource, please refer to the document of FirewallRuleResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + ResourceIdentifier firewallRuleResourceId = FirewallRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + FirewallRuleResource firewallRule = client.GetFirewallRuleResource(firewallRuleResourceId); + + // invoke the operation + await firewallRule.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FirewallRuleResource created on azure + // for more information of creating FirewallRuleResource, please refer to the document of FirewallRuleResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + ResourceIdentifier firewallRuleResourceId = FirewallRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + FirewallRuleResource firewallRule = client.GetFirewallRuleResource(firewallRuleResourceId); + + // invoke the operation + FirewallRuleData data = new FirewallRuleData + { + Properties = new FirewallRuleProperties + { + StartIPAddress = "10.0.0.0", + EndIPAddress = "10.0.0.255", + }, + }; + ArmOperation lro = await firewallRule.UpdateAsync(WaitUntil.Completed, data); + FirewallRuleResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FirewallRuleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetCollection.cs new file mode 100644 index 000000000000..da1a1955775a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_FleetsCreateOrUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "production-fleet-01"; + FleetData data = new FleetData(new AzureLocation("East US")) + { + Properties = new FleetProperties + { + Description = "Production fleet for high availability and scalability.", + }, + Tags = +{ +["environment"] = "production", +["owner"] = "team-database" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetName, data); + FleetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FleetsGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "production-fleet-01"; + FleetResource result = await collection.GetAsync(fleetName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_FleetsListByResourceGroupMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation and iterate over the result + await foreach (FleetResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_FleetsGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "production-fleet-01"; + bool result = await collection.ExistsAsync(fleetName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_FleetsGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "production-fleet-01"; + NullableResponse response = await collection.GetIfExistsAsync(fleetName); + FleetResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseCollection.cs new file mode 100644 index 000000000000..6a008639d091 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseCollection.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetDatabaseCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateDatabaseInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation + string databaseName = "customer-db-prod"; + FleetDatabaseData data = new FleetDatabaseData + { + Properties = new FleetDatabaseProperties + { + CreateMode = DatabaseCreateMode.Default, + TierName = "Premium", + RestoreFromOn = DateTimeOffset.Parse("2024-11-06T09:16:05.048Z"), + SourceDatabaseName = "existing-db-prod", + ResourceTags = +{ +["project"] = "Customer Data" +}, + Identity = new IdentityProperties + { + IdentityType = IdentityType.None, + UserAssignedIdentities = {new DatabaseIdentity +{ +ResourceId = new ResourceIdentifier("/subscriptions/12345678-90ab-cdef-1234-567890abcdef/resourceGroups/rg-database-operations/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-01"), +PrincipalId = Guid.Parse("a2b3c4d5-6789-0123-4567-89abcdef1234"), +ClientId = Guid.Parse("a2b3c4d5-6789-0123-4567-89abcdef1234"), +}}, + FederatedClientId = Guid.Parse("a2b3c4d5-6789-0123-4567-89abcdef1234"), + }, + TransparentDataEncryption = new TransparentDataEncryption + { + KeyUri = new Uri("https://keyvaultname.vault.azure.net/keys/myKey/12345"), + Keys = { "key1" }, + EnableAutoRotation = true, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseName, data); + FleetDatabaseResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetDatabaseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_RetrieveDatabaseDetailsInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation + string databaseName = "customer-db-prod"; + FleetDatabaseResource result = await collection.GetAsync(databaseName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetDatabaseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListDatabasesInFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_ListByFleetspace_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_ListByFleetspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation and iterate over the result + await foreach (FleetDatabaseResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetDatabaseData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_RetrieveDatabaseDetailsInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation + string databaseName = "customer-db-prod"; + bool result = await collection.ExistsAsync(databaseName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_RetrieveDatabaseDetailsInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation + string databaseName = "customer-db-prod"; + NullableResponse response = await collection.GetIfExistsAsync(databaseName); + FleetDatabaseResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetDatabaseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseResource.cs new file mode 100644 index 000000000000..37e47d452231 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseResource.cs @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetDatabaseResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_RetrieveDatabaseDetailsInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + FleetDatabaseResource result = await fleetDatabase.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetDatabaseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_FleetDatabasesDeleteMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + await fleetDatabase.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateDatabaseInFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Update_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + string databaseName = "customer-database-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + FleetDatabaseData data = new FleetDatabaseData + { + Properties = new FleetDatabaseProperties + { + CreateMode = DatabaseCreateMode.Default, + TierName = "Standard", + RestoreFromOn = DateTimeOffset.Parse("2024-11-06T09:16:05.048Z"), + SourceDatabaseName = "customer-database-staging", + ResourceTags = +{ +["environment"] = "production", +["owner"] = "database-team" +}, + Identity = new IdentityProperties + { + IdentityType = IdentityType.UserAssigned, + UserAssignedIdentities = {new DatabaseIdentity +{ +ResourceId = new ResourceIdentifier("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourcegroups/rgdatabasefleetmanager/providers/Microsoft.ManagedIdentity/userAssignedIdentities/db-identity"), +PrincipalId = Guid.Parse("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"), +ClientId = Guid.Parse("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"), +}}, + FederatedClientId = Guid.Parse("a2b3c4d5-6789-0123-4567-89abcdef1234"), + }, + TransparentDataEncryption = new TransparentDataEncryption + { + KeyUri = new Uri("https://keyvault-contoso.vault.azure.net/keys/db-encryption-key/abc123"), + Keys = { "abc123", "xyz789" }, + EnableAutoRotation = true, + }, + }, + }; + ArmOperation lro = await fleetDatabase.UpdateAsync(WaitUntil.Completed, data); + FleetDatabaseResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetDatabaseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task ChangeTier_ChangeDatabaseTierGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_ChangeTier_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabases_ChangeTier" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + DatabaseChangeTierProperties body = new DatabaseChangeTierProperties + { + TargetTierName = "Standard", + }; + await fleetDatabase.ChangeTierAsync(WaitUntil.Completed, body); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Rename_RenameDatabaseInFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Rename_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabases_Rename" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + DatabaseRenameProperties body = new DatabaseRenameProperties + { + NewName = "new-customer-db-prod", + }; + await fleetDatabase.RenameAsync(WaitUntil.Completed, body); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Revert_RevertTransparentDataEncryptionInDatabaseGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Revert_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabases_Revert" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + await fleetDatabase.RevertAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetResource.cs new file mode 100644 index 000000000000..89a408825e23 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetResource.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FleetsGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet-01"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetResource result = await fleet.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_FleetsDeleteMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet-01"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + await fleet.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_FleetsUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Update_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetPatch patch = new FleetPatch + { + Tags = +{ +["environment"] = "production", +["owner"] = "team-database" +}, + Properties = new FleetProperties + { + Description = "Fleet containing critical production databases and high availability configurations.", + }, + }; + ArmOperation lro = await fleet.UpdateAsync(WaitUntil.Completed, patch); + FleetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierCollection.cs new file mode 100644 index 000000000000..cd978d6286e0 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierCollection.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetTierCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_FleetTiersCreateOrUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation + string tierName = "general-purpose-tier"; + FleetTierData data = new FleetTierData + { + Properties = new FleetTierProperties + { + Serverless = false, + Pooled = true, + ServiceTier = "GeneralPurpose", + Family = "Gen5", + Capacity = 4, + PoolNumOfDatabasesMax = 10, + HighAvailabilityReplicaCount = 5, + ZoneRedundancy = ZoneRedundancy.Disabled, + DatabaseCapacityMin = 0, + DatabaseCapacityMax = 4, + DatabaseSizeGbMax = 50, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, tierName, data); + FleetTierResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetTierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FleetTiersGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation + string tierName = "general-purpose-tier"; + FleetTierResource result = await collection.GetAsync(tierName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetTierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_FleetTiersListByFleetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_ListByFleet_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation and iterate over the result + await foreach (FleetTierResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetTierData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_FleetTiersGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation + string tierName = "general-purpose-tier"; + bool result = await collection.ExistsAsync(tierName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_FleetTiersGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation + string tierName = "general-purpose-tier"; + NullableResponse response = await collection.GetIfExistsAsync(tierName); + FleetTierResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetTierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierResource.cs new file mode 100644 index 000000000000..f087512991d3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierResource.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetTierResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FleetTiersGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetTierResource created on azure + // for more information of creating FleetTierResource, please refer to the document of FleetTierResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + string tierName = "general-purpose-tier"; + ResourceIdentifier fleetTierResourceId = FleetTierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, tierName); + FleetTierResource fleetTier = client.GetFleetTierResource(fleetTierResourceId); + + // invoke the operation + FleetTierResource result = await fleetTier.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetTierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_FleetTiersDeleteMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetTierResource created on azure + // for more information of creating FleetTierResource, please refer to the document of FleetTierResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + string tierName = "general-purpose-tier"; + ResourceIdentifier fleetTierResourceId = FleetTierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, tierName); + FleetTierResource fleetTier = client.GetFleetTierResource(fleetTierResourceId); + + // invoke the operation + await fleetTier.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_FleetTiersUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Update_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetTierResource created on azure + // for more information of creating FleetTierResource, please refer to the document of FleetTierResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + string tierName = "general-purpose-tier"; + ResourceIdentifier fleetTierResourceId = FleetTierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, tierName); + FleetTierResource fleetTier = client.GetFleetTierResource(fleetTierResourceId); + + // invoke the operation + FleetTierData data = new FleetTierData + { + Properties = new FleetTierProperties + { + Serverless = false, + Pooled = true, + ServiceTier = "GeneralPurpose", + Family = "Gen5", + Capacity = 4, + PoolNumOfDatabasesMax = 10, + HighAvailabilityReplicaCount = 5, + ZoneRedundancy = ZoneRedundancy.Disabled, + DatabaseCapacityMin = 0, + DatabaseCapacityMax = 4, + DatabaseSizeGbMax = 50, + }, + }; + ArmOperation lro = await fleetTier.UpdateAsync(WaitUntil.Completed, data); + FleetTierResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetTierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Disable_FleetTiersDisableMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Disable_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTiers_Disable" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetTierResource created on azure + // for more information of creating FleetTierResource, please refer to the document of FleetTierResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + string tierName = "general-purpose-tier"; + ResourceIdentifier fleetTierResourceId = FleetTierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, tierName); + FleetTierResource fleetTier = client.GetFleetTierResource(fleetTierResourceId); + + // invoke the operation + FleetTierResource result = await fleetTier.DisableAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetTierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceCollection.cs new file mode 100644 index 000000000000..a0888b0588bf --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceCollection.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetspaceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation + string fleetspaceName = "primary-space"; + FleetspaceData data = new FleetspaceData + { + Properties = new FleetspaceProperties + { + CapacityMax = 150000, + MainPrincipal = new MainPrincipal + { + Login = "adminUser", + ApplicationId = Guid.Parse("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"), + ObjectId = Guid.Parse("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"), + TenantId = Guid.Parse("bde45d44-ec42-45b8-a5a2-c5b998c65ef6"), + PrincipalType = PrincipalType.Application, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetspaceName, data); + FleetspaceResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FleetspacesGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation + string fleetspaceName = "primary-space"; + FleetspaceResource result = await collection.GetAsync(fleetspaceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_FleetspacesListByFleetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_ListByFleet_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation and iterate over the result + await foreach (FleetspaceResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_FleetspacesGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation + string fleetspaceName = "primary-space"; + bool result = await collection.ExistsAsync(fleetspaceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_FleetspacesGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation + string fleetspaceName = "primary-space"; + NullableResponse response = await collection.GetIfExistsAsync(fleetspaceName); + FleetspaceResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceResource.cs new file mode 100644 index 000000000000..210b86120dc8 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceResource.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetspaceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FleetspacesGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + FleetspaceResource result = await fleetspace.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_FleetspacesDeleteMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + await fleetspace.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_FleetspacesUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Update_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + FleetspaceData data = new FleetspaceData + { + Properties = new FleetspaceProperties + { + CapacityMax = 150000, + MainPrincipal = new MainPrincipal + { + Login = "adminUser", + ApplicationId = Guid.Parse("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"), + ObjectId = Guid.Parse("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"), + TenantId = Guid.Parse("bde45d44-ec42-45b8-a5a2-c5b998c65ef6"), + PrincipalType = PrincipalType.Application, + }, + }, + }; + ArmOperation lro = await fleetspace.UpdateAsync(WaitUntil.Completed, data); + FleetspaceResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task RegisterServer_FleetspacesRegisterServerMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_RegisterServer_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspaces_RegisterServer" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + RegisterServerProperties body = new RegisterServerProperties + { + TierName = "Standard", + SourceSubscriptionId = "c76e2b32-46c7-4325-8f4f-476828a5b207", + SourceResourceGroupName = "rg-source-database", + SourceServerName = "source-db-server-prod", + DestinationTierOverrides = { new DestinationTierOverride(Models.ResourceType.Database, "bronze", "source-db-prod") }, + }; + await fleetspace.RegisterServerAsync(WaitUntil.Completed, body); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Unregister_FleetspacesUnregisterMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Unregister_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspaces_Unregister" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + await fleetspace.UnregisterAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..3b8d32d2d723 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetFleets_FleetsListMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_List_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (FleetResource item in subscriptionResource.GetFleetsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Azure.ResourceManager.DatabaseFleetManager.csproj b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Azure.ResourceManager.DatabaseFleetManager.csproj new file mode 100644 index 000000000000..2bb49547d2ac --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Azure.ResourceManager.DatabaseFleetManager.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider DatabaseFleetManager. + 1.0.0-beta.1 + azure;management;arm;resource manager;databasefleetmanager + Azure.ResourceManager.DatabaseFleetManager + + diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ArmDatabaseFleetManagerModelFactory.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ArmDatabaseFleetManagerModelFactory.cs new file mode 100644 index 000000000000..06870703a51a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ArmDatabaseFleetManagerModelFactory.cs @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Model factory for models. + public static partial class ArmDatabaseFleetManagerModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Fleet tier properties. + /// A new instance for mocking. + public static FleetTierData FleetTierData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, FleetTierProperties properties = null) + { + return new FleetTierData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// If true, tier is disabled. + /// If true, serverless resources are provisioned in the tier. + /// If true, databases are pooled. + /// Service tier of provisioned resources. Supported values: GeneralPurpose, Hyperscale. + /// Family of provisioned resources, for example Gen5. + /// Capacity of provisioned resources in the tier, in units matching the specified service tier, for example vCore for GeneralPurpose. + /// Maximum number of databases per pool. + /// Number of high availability replicas for databases in this tier. + /// Enable zone redundancy for all databases in this tier. + /// Minimum allocated capacity per database, in units matching the specified service tier. + /// Maximum allocated capacity per database, in units matching the specified service tier. + /// Maximum database size in Gb. + /// Provisioning state. + /// A new instance for mocking. + public static FleetTierProperties FleetTierProperties(bool? disabled = null, bool? serverless = null, bool? pooled = null, string serviceTier = null, string family = null, int? capacity = null, int? poolNumOfDatabasesMax = null, int? highAvailabilityReplicaCount = null, ZoneRedundancy? zoneRedundancy = null, double? databaseCapacityMin = null, double? databaseCapacityMax = null, int? databaseSizeGbMax = null, AzureProvisioningState? provisioningState = null) + { + return new FleetTierProperties( + disabled, + serverless, + pooled, + serviceTier, + family, + capacity, + poolNumOfDatabasesMax, + highAvailabilityReplicaCount, + zoneRedundancy, + databaseCapacityMin, + databaseCapacityMax, + databaseSizeGbMax, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Firewall rule properties. + /// A new instance for mocking. + public static FirewallRuleData FirewallRuleData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, FirewallRuleProperties properties = null) + { + return new FirewallRuleData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Start IP address. + /// End IP address. + /// Provisioning state. + /// A new instance for mocking. + public static FirewallRuleProperties FirewallRuleProperties(string startIPAddress = null, string endIPAddress = null, AzureProvisioningState? provisioningState = null) + { + return new FirewallRuleProperties(startIPAddress, endIPAddress, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The fleet properties. + /// A new instance for mocking. + public static FleetData FleetData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, FleetProperties properties = null) + { + tags ??= new Dictionary(); + + return new FleetData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Fleet description. + /// Provisioning state. + /// A new instance for mocking. + public static FleetProperties FleetProperties(string description = null, AzureProvisioningState? provisioningState = null) + { + return new FleetProperties(description, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Fleetspace properties. + /// A new instance for mocking. + public static FleetspaceData FleetspaceData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, FleetspaceProperties properties = null) + { + return new FleetspaceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Fleetspace state. + /// Maximum number of vCores database fleet manager is allowed to provision in the fleetspace. + /// Main Microsoft Entra ID principal that has admin access to all databases in the fleetspace. + /// A new instance for mocking. + public static FleetspaceProperties FleetspaceProperties(AzureProvisioningState? provisioningState = null, int? capacityMax = null, MainPrincipal mainPrincipal = null) + { + return new FleetspaceProperties(provisioningState, capacityMax, mainPrincipal, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Fleet database properties. + /// A new instance for mocking. + public static FleetDatabaseData FleetDatabaseData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, FleetDatabaseProperties properties = null) + { + return new FleetDatabaseData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Resource identifier for the underlying database resource. + /// Database state. + /// Create mode. Available options: Default - Create a database. Copy - Copy the source database (source database name must be specified) PointInTimeRestore - Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + /// Name of the tier this database belongs to. + /// Connection string to connect to the database with. + /// If true, database is recoverable. + /// Restore from time when CreateMode is PointInTimeRestore. + /// Earliest restore time. + /// Latest restore time. + /// Backup retention in days. + /// Maximum database size in Gb. + /// Source database name used when CreateMode is Copy or PointInTimeRestore. + /// Additional database properties to be applied as the underlying database resource tags. + /// Identity property. + /// Transparent Data Encryption properties. + /// Database collation. + /// A new instance for mocking. + public static FleetDatabaseProperties FleetDatabaseProperties(string originalDatabaseId = null, AzureProvisioningState? provisioningState = null, DatabaseCreateMode? createMode = null, string tierName = null, string connectionString = null, bool? recoverable = null, DateTimeOffset? restoreFromOn = null, DateTimeOffset? earliestRestoreOn = null, DateTimeOffset? latestRestoreOn = null, int? backupRetentionDays = null, int? databaseSizeGbMax = null, string sourceDatabaseName = null, IDictionary resourceTags = null, IdentityProperties identity = null, TransparentDataEncryption transparentDataEncryption = null, string collation = null) + { + resourceTags ??= new Dictionary(); + + return new FleetDatabaseProperties( + originalDatabaseId, + provisioningState, + createMode, + tierName, + connectionString, + recoverable, + restoreFromOn, + earliestRestoreOn, + latestRestoreOn, + backupRetentionDays, + databaseSizeGbMax, + sourceDatabaseName, + resourceTags, + identity, + transparentDataEncryption, + collation, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/DatabaseFleetManagerExtensions.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/DatabaseFleetManagerExtensions.cs new file mode 100644 index 000000000000..e89a58848597 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/DatabaseFleetManagerExtensions.cs @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.DatabaseFleetManager.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// A class to add extension methods to Azure.ResourceManager.DatabaseFleetManager. + public static partial class DatabaseFleetManagerExtensions + { + private static MockableDatabaseFleetManagerArmClient GetMockableDatabaseFleetManagerArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableDatabaseFleetManagerArmClient(client0)); + } + + private static MockableDatabaseFleetManagerResourceGroupResource GetMockableDatabaseFleetManagerResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableDatabaseFleetManagerResourceGroupResource(client, resource.Id)); + } + + private static MockableDatabaseFleetManagerSubscriptionResource GetMockableDatabaseFleetManagerSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableDatabaseFleetManagerSubscriptionResource(client, resource.Id)); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static FleetDatabaseResource GetFleetDatabaseResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFleetDatabaseResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static FleetspaceResource GetFleetspaceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFleetspaceResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static FleetResource GetFleetResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFleetResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static FirewallRuleResource GetFirewallRuleResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFirewallRuleResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static FleetTierResource GetFleetTierResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFleetTierResource(id); + } + + /// + /// Gets a collection of FleetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of FleetResources and their operations over a FleetResource. + public static FleetCollection GetFleets(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDatabaseFleetManagerResourceGroupResource(resourceGroupResource).GetFleets(); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the database fleet. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetFleetAsync(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableDatabaseFleetManagerResourceGroupResource(resourceGroupResource).GetFleetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the database fleet. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetFleet(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDatabaseFleetManagerResourceGroupResource(resourceGroupResource).GetFleet(fleetName, cancellationToken); + } + + /// + /// Gets all fleets in a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetFleetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDatabaseFleetManagerSubscriptionResource(subscriptionResource).GetFleetsAsync(cancellationToken); + } + + /// + /// Gets all fleets in a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetFleets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDatabaseFleetManagerSubscriptionResource(subscriptionResource).GetFleets(cancellationToken); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerArmClient.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerArmClient.cs new file mode 100644 index 000000000000..c3c91294f345 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerArmClient.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableDatabaseFleetManagerArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableDatabaseFleetManagerArmClient() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableDatabaseFleetManagerArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableDatabaseFleetManagerArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FleetDatabaseResource GetFleetDatabaseResource(ResourceIdentifier id) + { + FleetDatabaseResource.ValidateResourceId(id); + return new FleetDatabaseResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FleetspaceResource GetFleetspaceResource(ResourceIdentifier id) + { + FleetspaceResource.ValidateResourceId(id); + return new FleetspaceResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FleetResource GetFleetResource(ResourceIdentifier id) + { + FleetResource.ValidateResourceId(id); + return new FleetResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FirewallRuleResource GetFirewallRuleResource(ResourceIdentifier id) + { + FirewallRuleResource.ValidateResourceId(id); + return new FirewallRuleResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FleetTierResource GetFleetTierResource(ResourceIdentifier id) + { + FleetTierResource.ValidateResourceId(id); + return new FleetTierResource(Client, id); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerResourceGroupResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerResourceGroupResource.cs new file mode 100644 index 000000000000..85c1487077ff --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerResourceGroupResource.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableDatabaseFleetManagerResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableDatabaseFleetManagerResourceGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableDatabaseFleetManagerResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of FleetResources in the ResourceGroupResource. + /// An object representing collection of FleetResources and their operations over a FleetResource. + public virtual FleetCollection GetFleets() + { + return GetCachedClient(client => new FleetCollection(client, Id)); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetAsync(string fleetName, CancellationToken cancellationToken = default) + { + return await GetFleets().GetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleet(string fleetName, CancellationToken cancellationToken = default) + { + return GetFleets().Get(fleetName, cancellationToken); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerSubscriptionResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerSubscriptionResource.cs new file mode 100644 index 000000000000..d5e0e2001ef8 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerSubscriptionResource.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableDatabaseFleetManagerSubscriptionResource : ArmResource + { + private ClientDiagnostics _fleetClientDiagnostics; + private FleetsRestOperations _fleetRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableDatabaseFleetManagerSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableDatabaseFleetManagerSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics FleetClientDiagnostics => _fleetClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetResource.ResourceType.Namespace, Diagnostics); + private FleetsRestOperations FleetRestClient => _fleetRestClient ??= new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(FleetResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets all fleets in a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetFleetsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => FleetRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FleetRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), FleetClientDiagnostics, Pipeline, "MockableDatabaseFleetManagerSubscriptionResource.GetFleets", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all fleets in a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetFleets(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => FleetRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FleetRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), FleetClientDiagnostics, Pipeline, "MockableDatabaseFleetManagerSubscriptionResource.GetFleets", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleCollection.cs new file mode 100644 index 000000000000..bf8f48feaf7f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleCollection.cs @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFirewallRules method from an instance of . + /// + public partial class FirewallRuleCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _firewallRuleClientDiagnostics; + private readonly FirewallRulesRestOperations _firewallRuleRestClient; + + /// Initializes a new instance of the class for mocking. + protected FirewallRuleCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FirewallRuleCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _firewallRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FirewallRuleResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FirewallRuleResource.ResourceType, out string firewallRuleApiVersion); + _firewallRuleRestClient = new FirewallRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, firewallRuleApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetspaceResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the firewall rule. + /// The firewall rule object to create or update. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string firewallRuleName, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FirewallRuleOperationSource(Client), _firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the firewall rule. + /// The firewall rule object to create or update. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string firewallRuleName, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FirewallRuleOperationSource(Client), _firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.Get"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.Get"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all firewall rules in a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules + /// + /// + /// Operation Id + /// FirewallRule_ListByFleetspace + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _firewallRuleRestClient.CreateListByFleetspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _firewallRuleRestClient.CreateListByFleetspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FirewallRuleResource(Client, FirewallRuleData.DeserializeFirewallRuleData(e)), _firewallRuleClientDiagnostics, Pipeline, "FirewallRuleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all firewall rules in a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules + /// + /// + /// Operation Id + /// FirewallRule_ListByFleetspace + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _firewallRuleRestClient.CreateListByFleetspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _firewallRuleRestClient.CreateListByFleetspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FirewallRuleResource(Client, FirewallRuleData.DeserializeFirewallRuleData(e)), _firewallRuleClientDiagnostics, Pipeline, "FirewallRuleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.Exists"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.Exists"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.GetIfExists"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.Serialization.cs new file mode 100644 index 000000000000..e00a36737d00 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FirewallRuleData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FirewallRuleData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FirewallRuleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FirewallRuleData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFirewallRuleData(document.RootElement, options); + } + + internal static FirewallRuleData DeserializeFirewallRuleData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FirewallRuleProperties properties = default; + ResourceIdentifier id = default; + string name = default; + Core.ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = FirewallRuleProperties.DeserializeFirewallRuleProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new Core.ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FirewallRuleData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FirewallRuleData)} does not support writing '{options.Format}' format."); + } + } + + FirewallRuleData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFirewallRuleData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FirewallRuleData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.cs new file mode 100644 index 000000000000..6138a49804b9 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the FirewallRule data model. + /// A firewall rule. + /// + public partial class FirewallRuleData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FirewallRuleData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Firewall rule properties. + /// Keeps track of any properties unknown to the library. + internal FirewallRuleData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, FirewallRuleProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A Firewall rule properties. + public FirewallRuleProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.Serialization.cs new file mode 100644 index 000000000000..57847384327f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FirewallRuleResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FirewallRuleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FirewallRuleData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.cs new file mode 100644 index 000000000000..8486d098a7b3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A Class representing a FirewallRule along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFirewallRuleResource method. + /// Otherwise you can get one from its parent resource using the GetFirewallRule method. + /// + public partial class FirewallRuleResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The fleetspaceName. + /// The firewallRuleName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _firewallRuleClientDiagnostics; + private readonly FirewallRulesRestOperations _firewallRuleRestClient; + private readonly FirewallRuleData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets/fleetspaces/firewallRules"; + + /// Initializes a new instance of the class for mocking. + protected FirewallRuleResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FirewallRuleResource(ArmClient client, FirewallRuleData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal FirewallRuleResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _firewallRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string firewallRuleApiVersion); + _firewallRuleRestClient = new FirewallRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, firewallRuleApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual FirewallRuleData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Get"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Get"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Delete"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Delete"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The firewall rule object to create or update. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Update"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FirewallRuleOperationSource(Client), _firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The firewall rule object to create or update. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Update"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FirewallRuleOperationSource(Client), _firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetCollection.cs new file mode 100644 index 000000000000..1657d527cedd --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetCollection.cs @@ -0,0 +1,500 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleets method from an instance of . + /// + public partial class FleetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetClientDiagnostics; + private readonly FleetsRestOperations _fleetRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetResource.ResourceType, out string fleetApiVersion); + _fleetRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the database fleet. + /// The fleet object to create or update. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string fleetName, FleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the database fleet. + /// The fleet object to create or update. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string fleetName, FleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Get"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Get"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all fleets in a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skip, top, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), _fleetClientDiagnostics, Pipeline, "FleetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all fleets in a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skip, top, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), _fleetClientDiagnostics, Pipeline, "FleetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Exists"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.Serialization.cs new file mode 100644 index 000000000000..19e4230b3ce6 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FleetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetData(document.RootElement, options); + } + + internal static FleetData DeserializeFleetData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FleetProperties properties = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + Core.ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = FleetProperties.DeserializeFleetProperties(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new Core.ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetData)} does not support writing '{options.Format}' format."); + } + } + + FleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.cs new file mode 100644 index 000000000000..b104bd126dd7 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the Fleet data model. + /// A Database Fleet. + /// + public partial class FleetData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public FleetData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The fleet properties. + /// Keeps track of any properties unknown to the library. + internal FleetData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, FleetProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetData() + { + } + + /// The fleet properties. + public FleetProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseCollection.cs new file mode 100644 index 000000000000..dec216d79917 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseCollection.cs @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleetDatabases method from an instance of . + /// + public partial class FleetDatabaseCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetDatabaseClientDiagnostics; + private readonly FleetDatabasesRestOperations _fleetDatabaseRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetDatabaseCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetDatabaseCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetDatabaseClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetDatabaseResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetDatabaseResource.ResourceType, out string fleetDatabaseApiVersion); + _fleetDatabaseRestClient = new FleetDatabasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetDatabaseApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetspaceResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the database. + /// The database object to create or update. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetDatabaseOperationSource(Client), _fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the database. + /// The database object to create or update. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetDatabaseOperationSource(Client), _fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.Get"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.Get"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all fleet databases in a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases + /// + /// + /// Operation Id + /// FleetDatabase_ListByFleetspace + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetDatabaseRestClient.CreateListByFleetspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, filter, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetDatabaseRestClient.CreateListByFleetspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, filter, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetDatabaseResource(Client, FleetDatabaseData.DeserializeFleetDatabaseData(e)), _fleetDatabaseClientDiagnostics, Pipeline, "FleetDatabaseCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all fleet databases in a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases + /// + /// + /// Operation Id + /// FleetDatabase_ListByFleetspace + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetDatabaseRestClient.CreateListByFleetspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, filter, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetDatabaseRestClient.CreateListByFleetspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, filter, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetDatabaseResource(Client, FleetDatabaseData.DeserializeFleetDatabaseData(e)), _fleetDatabaseClientDiagnostics, Pipeline, "FleetDatabaseCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.Exists"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.Serialization.cs new file mode 100644 index 000000000000..3c81181ff6fc --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetDatabaseData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetDatabaseData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FleetDatabaseData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetDatabaseData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetDatabaseData(document.RootElement, options); + } + + internal static FleetDatabaseData DeserializeFleetDatabaseData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FleetDatabaseProperties properties = default; + ResourceIdentifier id = default; + string name = default; + Core.ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = FleetDatabaseProperties.DeserializeFleetDatabaseProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new Core.ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetDatabaseData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetDatabaseData)} does not support writing '{options.Format}' format."); + } + } + + FleetDatabaseData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetDatabaseData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetDatabaseData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.cs new file mode 100644 index 000000000000..15a588a310a1 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the FleetDatabase data model. + /// A fleet database. + /// + public partial class FleetDatabaseData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetDatabaseData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Fleet database properties. + /// Keeps track of any properties unknown to the library. + internal FleetDatabaseData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, FleetDatabaseProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Fleet database properties. + public FleetDatabaseProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.Serialization.cs new file mode 100644 index 000000000000..590f0c91cc98 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetDatabaseResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetDatabaseData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetDatabaseData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.cs new file mode 100644 index 000000000000..78b41bfbae8f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.cs @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A Class representing a FleetDatabase along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetDatabaseResource method. + /// Otherwise you can get one from its parent resource using the GetFleetDatabase method. + /// + public partial class FleetDatabaseResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The fleetspaceName. + /// The databaseName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetDatabaseClientDiagnostics; + private readonly FleetDatabasesRestOperations _fleetDatabaseRestClient; + private readonly FleetDatabaseData _data; + + /// Gets the resource type for the operations. + public static readonly Core.ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets/fleetspaces/databases"; + + /// Initializes a new instance of the class for mocking. + protected FleetDatabaseResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetDatabaseResource(ArmClient client, FleetDatabaseData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal FleetDatabaseResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetDatabaseClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetDatabaseApiVersion); + _fleetDatabaseRestClient = new FleetDatabasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetDatabaseApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual FleetDatabaseData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Get"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Get"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Delete"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Delete"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The database object to patch. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Update"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetDatabaseOperationSource(Client), _fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The database object to patch. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Update"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetDatabaseOperationSource(Client), _fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Moves database to a different tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/changeTier + /// + /// + /// Operation Id + /// FleetDatabases_ChangeTier + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The details of the change tier operation. + /// The cancellation token to use. + /// is null. + public virtual async Task ChangeTierAsync(WaitUntil waitUntil, DatabaseChangeTierProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.ChangeTier"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.ChangeTierAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateChangeTierRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Moves database to a different tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/changeTier + /// + /// + /// Operation Id + /// FleetDatabases_ChangeTier + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The details of the change tier operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation ChangeTier(WaitUntil waitUntil, DatabaseChangeTierProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.ChangeTier"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.ChangeTier(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateChangeTierRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Renames a database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/rename + /// + /// + /// Operation Id + /// FleetDatabases_Rename + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The details of the rename operation. + /// The cancellation token to use. + /// is null. + public virtual async Task RenameAsync(WaitUntil waitUntil, DatabaseRenameProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Rename"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.RenameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateRenameRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Renames a database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/rename + /// + /// + /// Operation Id + /// FleetDatabases_Rename + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The details of the rename operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Rename(WaitUntil waitUntil, DatabaseRenameProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Rename"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Rename(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateRenameRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Revert a database transparent data encryption (TDE). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/revert + /// + /// + /// Operation Id + /// FleetDatabases_Revert + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task RevertAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Revert"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.RevertAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateRevertRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Revert a database transparent data encryption (TDE). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/revert + /// + /// + /// Operation Id + /// FleetDatabases_Revert + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Revert(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Revert"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Revert(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateRevertRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.Serialization.cs new file mode 100644 index 000000000000..7f71b89ec415 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.cs new file mode 100644 index 000000000000..d7a95ec075a5 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.cs @@ -0,0 +1,845 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A Class representing a Fleet along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetResource method. + /// Otherwise you can get one from its parent resource using the GetFleet method. + /// + public partial class FleetResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetClientDiagnostics; + private readonly FleetsRestOperations _fleetRestClient; + private readonly FleetData _data; + + /// Gets the resource type for the operations. + public static readonly Core.ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets"; + + /// Initializes a new instance of the class for mocking. + protected FleetResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetResource(ArmClient client, FleetData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal FleetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetApiVersion); + _fleetRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual FleetData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of FleetspaceResources in the Fleet. + /// An object representing collection of FleetspaceResources and their operations over a FleetspaceResource. + public virtual FleetspaceCollection GetFleetspaces() + { + return GetCachedClient(client => new FleetspaceCollection(client, Id)); + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetspaceAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + return await GetFleetspaces().GetAsync(fleetspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetspace(string fleetspaceName, CancellationToken cancellationToken = default) + { + return GetFleetspaces().Get(fleetspaceName, cancellationToken); + } + + /// Gets a collection of FleetTierResources in the Fleet. + /// An object representing collection of FleetTierResources and their operations over a FleetTierResource. + public virtual FleetTierCollection GetFleetTiers() + { + return GetCachedClient(client => new FleetTierCollection(client, Id)); + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetTierAsync(string tierName, CancellationToken cancellationToken = default) + { + return await GetFleetTiers().GetAsync(tierName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetTier(string tierName, CancellationToken cancellationToken = default) + { + return GetFleetTiers().Get(tierName, cancellationToken); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Get"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Get"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Delete"); + scope.Start(); + try + { + var response = await _fleetRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Delete"); + scope.Start(); + try + { + var response = _fleetRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Modifies a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The fleet object to patch. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Update"); + scope.Start(); + try + { + var response = await _fleetRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Modifies a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The fleet object to patch. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Update"); + scope.Start(); + try + { + var response = _fleetRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FleetPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FleetPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierCollection.cs new file mode 100644 index 000000000000..e7d8fffec97a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierCollection.cs @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleetTiers method from an instance of . + /// + public partial class FleetTierCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetTierClientDiagnostics; + private readonly FleetTiersRestOperations _fleetTierRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetTierCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetTierCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetTierClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetTierResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetTierResource.ResourceType, out string fleetTierApiVersion); + _fleetTierRestClient = new FleetTiersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetTierApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the tier. + /// The tier object to create or update. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetTierOperationSource(Client), _fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the tier. + /// The tier object to create or update. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetTierRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetTierOperationSource(Client), _fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.Get"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.Get"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List tiers in a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers + /// + /// + /// Operation Id + /// FleetTier_ListByFleet + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetTierRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetTierRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetTierResource(Client, FleetTierData.DeserializeFleetTierData(e)), _fleetTierClientDiagnostics, Pipeline, "FleetTierCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List tiers in a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers + /// + /// + /// Operation Id + /// FleetTier_ListByFleet + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetTierRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetTierRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetTierResource(Client, FleetTierData.DeserializeFleetTierData(e)), _fleetTierClientDiagnostics, Pipeline, "FleetTierCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.Exists"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.Serialization.cs new file mode 100644 index 000000000000..4ef11a28c117 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetTierData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetTierData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FleetTierData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetTierData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetTierData(document.RootElement, options); + } + + internal static FleetTierData DeserializeFleetTierData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FleetTierProperties properties = default; + ResourceIdentifier id = default; + string name = default; + Core.ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = FleetTierProperties.DeserializeFleetTierProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new Core.ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetTierData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetTierData)} does not support writing '{options.Format}' format."); + } + } + + FleetTierData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetTierData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetTierData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.cs new file mode 100644 index 000000000000..b7d9416f249a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the FleetTier data model. + /// A SQL Database Fleet tier. + /// + public partial class FleetTierData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetTierData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Fleet tier properties. + /// Keeps track of any properties unknown to the library. + internal FleetTierData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, FleetTierProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A Fleet tier properties. + public FleetTierProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.Serialization.cs new file mode 100644 index 000000000000..5e5e193cc976 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetTierResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetTierData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetTierData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.cs new file mode 100644 index 000000000000..4b6723e281c2 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.cs @@ -0,0 +1,423 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A Class representing a FleetTier along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetTierResource method. + /// Otherwise you can get one from its parent resource using the GetFleetTier method. + /// + public partial class FleetTierResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The tierName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetTierClientDiagnostics; + private readonly FleetTiersRestOperations _fleetTierRestClient; + private readonly FleetTierData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets/tiers"; + + /// Initializes a new instance of the class for mocking. + protected FleetTierResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetTierResource(ArmClient client, FleetTierData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal FleetTierResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetTierClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetTierApiVersion); + _fleetTierRestClient = new FleetTiersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetTierApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual FleetTierData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Get"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Get"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Delete"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Delete"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Update"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetTierOperationSource(Client), _fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Update"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetTierOperationSource(Client), _fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Disables a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName}/disable + /// + /// + /// Operation Id + /// FleetTiers_Disable + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> DisableAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Disable"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.DisableAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Disables a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName}/disable + /// + /// + /// Operation Id + /// FleetTiers_Disable + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Disable(CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Disable"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Disable(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceCollection.cs new file mode 100644 index 000000000000..66e97247dfb7 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceCollection.cs @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleetspaces method from an instance of . + /// + public partial class FleetspaceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetspaceClientDiagnostics; + private readonly FleetspacesRestOperations _fleetspaceRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetspaceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetspaceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetspaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetspaceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetspaceResource.ResourceType, out string fleetspaceApiVersion); + _fleetspaceRestClient = new FleetspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetspaceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the fleetspace. + /// The fleet object to create or update. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetspaceOperationSource(Client), _fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the fleetspace. + /// The fleet object to create or update. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetspaceOperationSource(Client), _fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.Get"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.Get"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists fleetspaces in a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces + /// + /// + /// Operation Id + /// Fleetspace_ListByFleet + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetspaceRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetspaceRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetspaceResource(Client, FleetspaceData.DeserializeFleetspaceData(e)), _fleetspaceClientDiagnostics, Pipeline, "FleetspaceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists fleetspaces in a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces + /// + /// + /// Operation Id + /// Fleetspace_ListByFleet + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetspaceRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetspaceRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetspaceResource(Client, FleetspaceData.DeserializeFleetspaceData(e)), _fleetspaceClientDiagnostics, Pipeline, "FleetspaceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.Exists"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.Serialization.cs new file mode 100644 index 000000000000..3e4bf7c0a4c6 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetspaceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FleetspaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspaceData(document.RootElement, options); + } + + internal static FleetspaceData DeserializeFleetspaceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FleetspaceProperties properties = default; + ResourceIdentifier id = default; + string name = default; + Core.ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = FleetspaceProperties.DeserializeFleetspaceProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new Core.ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetspaceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetspaceData)} does not support writing '{options.Format}' format."); + } + } + + FleetspaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetspaceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspaceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.cs new file mode 100644 index 000000000000..ff1a45dd143b --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the Fleetspace data model. + /// A fleetspace. + /// + public partial class FleetspaceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetspaceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Fleetspace properties. + /// Keeps track of any properties unknown to the library. + internal FleetspaceData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, FleetspaceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A Fleetspace properties. + public FleetspaceProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.Serialization.cs new file mode 100644 index 000000000000..b75fae2c086c --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetspaceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetspaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetspaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.cs new file mode 100644 index 000000000000..09866a232bc4 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.cs @@ -0,0 +1,662 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A Class representing a Fleetspace along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetspaceResource method. + /// Otherwise you can get one from its parent resource using the GetFleetspace method. + /// + public partial class FleetspaceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The fleetspaceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetspaceClientDiagnostics; + private readonly FleetspacesRestOperations _fleetspaceRestClient; + private readonly FleetspaceData _data; + + /// Gets the resource type for the operations. + public static readonly Core.ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets/fleetspaces"; + + /// Initializes a new instance of the class for mocking. + protected FleetspaceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetspaceResource(ArmClient client, FleetspaceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal FleetspaceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetspaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetspaceApiVersion); + _fleetspaceRestClient = new FleetspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetspaceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual FleetspaceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of FleetDatabaseResources in the Fleetspace. + /// An object representing collection of FleetDatabaseResources and their operations over a FleetDatabaseResource. + public virtual FleetDatabaseCollection GetFleetDatabases() + { + return GetCachedClient(client => new FleetDatabaseCollection(client, Id)); + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) + { + return await GetFleetDatabases().GetAsync(databaseName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetDatabase(string databaseName, CancellationToken cancellationToken = default) + { + return GetFleetDatabases().Get(databaseName, cancellationToken); + } + + /// Gets a collection of FirewallRuleResources in the Fleetspace. + /// An object representing collection of FirewallRuleResources and their operations over a FirewallRuleResource. + public virtual FirewallRuleCollection GetFirewallRules() + { + return GetCachedClient(client => new FirewallRuleCollection(client, Id)); + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFirewallRuleAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + return await GetFirewallRules().GetAsync(firewallRuleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFirewallRule(string firewallRuleName, CancellationToken cancellationToken = default) + { + return GetFirewallRules().Get(firewallRuleName, cancellationToken); + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Get"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Get"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Delete"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Delete"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Modifies a fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Update"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetspaceOperationSource(Client), _fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Modifies a fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Update"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetspaceOperationSource(Client), _fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Migrates an existing logical server into fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/registerServer + /// + /// + /// Operation Id + /// Fleetspaces_RegisterServer + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The details of the register server operation. + /// The cancellation token to use. + /// is null. + public virtual async Task RegisterServerAsync(WaitUntil waitUntil, RegisterServerProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.RegisterServer"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.RegisterServerAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateRegisterServerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Migrates an existing logical server into fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/registerServer + /// + /// + /// Operation Id + /// Fleetspaces_RegisterServer + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The details of the register server operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation RegisterServer(WaitUntil waitUntil, RegisterServerProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.RegisterServer"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.RegisterServer(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateRegisterServerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Unregisters all databases from a fleetspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/unregister + /// + /// + /// Operation Id + /// Fleetspaces_Unregister + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task UnregisterAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Unregister"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.UnregisterAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateUnregisterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Unregisters all databases from a fleetspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/unregister + /// + /// + /// Operation Id + /// Fleetspaces_Unregister + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Unregister(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Unregister"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Unregister(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateUnregisterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Argument.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..0c8e7b17a1cd --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..240180f8f8a5 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingList.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..f5a2dd110e6e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..cf58591ad508 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal static class ModelSerializationExtensions + { + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Optional.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..c0a6938f59ff --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..39c287294c4d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperation.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperation.cs new file mode 100644 index 000000000000..6fd3fa7a1c7a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperation.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ +#pragma warning disable SA1649 // File name should match first type name + internal class DatabaseFleetManagerArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of DatabaseFleetManagerArmOperation for mocking. + protected DatabaseFleetManagerArmOperation() + { + } + + internal DatabaseFleetManagerArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal DatabaseFleetManagerArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "DatabaseFleetManagerArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperationOfT.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperationOfT.cs new file mode 100644 index 000000000000..86c5d39dd20e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperationOfT.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ +#pragma warning disable SA1649 // File name should match first type name + internal class DatabaseFleetManagerArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of DatabaseFleetManagerArmOperation for mocking. + protected DatabaseFleetManagerArmOperation() + { + } + + internal DatabaseFleetManagerArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal DatabaseFleetManagerArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "DatabaseFleetManagerArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FirewallRuleOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FirewallRuleOperationSource.cs new file mode 100644 index 000000000000..2604858bfca6 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FirewallRuleOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class FirewallRuleOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FirewallRuleOperationSource(ArmClient client) + { + _client = client; + } + + FirewallRuleResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FirewallRuleResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FirewallRuleResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetDatabaseOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetDatabaseOperationSource.cs new file mode 100644 index 000000000000..cf70c4e315a0 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetDatabaseOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class FleetDatabaseOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetDatabaseOperationSource(ArmClient client) + { + _client = client; + } + + FleetDatabaseResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FleetDatabaseResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FleetDatabaseResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetOperationSource.cs new file mode 100644 index 000000000000..7838c8a79c8a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class FleetOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetOperationSource(ArmClient client) + { + _client = client; + } + + FleetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FleetResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FleetResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetTierOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetTierOperationSource.cs new file mode 100644 index 000000000000..4067f6ded8bc --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetTierOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class FleetTierOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetTierOperationSource(ArmClient client) + { + _client = client; + } + + FleetTierResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FleetTierResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FleetTierResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetspaceOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetspaceOperationSource.cs new file mode 100644 index 000000000000..cd5e26bb8eee --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetspaceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal class FleetspaceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetspaceOperationSource(ArmClient client) + { + _client = client; + } + + FleetspaceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FleetspaceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FleetspaceResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/AzureProvisioningState.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/AzureProvisioningState.cs new file mode 100644 index 000000000000..c073fa2c2d75 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/AzureProvisioningState.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// The provisioning state of the resource. + public readonly partial struct AzureProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + private const string AcceptedValue = "Accepted"; + + /// Resource has been created. + public static AzureProvisioningState Succeeded { get; } = new AzureProvisioningState(SucceededValue); + /// Resource creation failed. + public static AzureProvisioningState Failed { get; } = new AzureProvisioningState(FailedValue); + /// Resource creation was canceled. + public static AzureProvisioningState Canceled { get; } = new AzureProvisioningState(CanceledValue); + /// Resource is provisioning. + public static AzureProvisioningState Provisioning { get; } = new AzureProvisioningState(ProvisioningValue); + /// Request on the resource has been accepted. + public static AzureProvisioningState Accepted { get; } = new AzureProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(AzureProvisioningState left, AzureProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureProvisioningState left, AzureProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureProvisioningState(string value) => new AzureProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureProvisioningState other && Equals(other); + /// + public bool Equals(AzureProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.Serialization.cs new file mode 100644 index 000000000000..32e011095089 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class DatabaseChangeTierProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseChangeTierProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TargetTierName)) + { + writer.WritePropertyName("targetTierName"u8); + writer.WriteStringValue(TargetTierName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DatabaseChangeTierProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseChangeTierProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseChangeTierProperties(document.RootElement, options); + } + + internal static DatabaseChangeTierProperties DeserializeDatabaseChangeTierProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string targetTierName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetTierName"u8)) + { + targetTierName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseChangeTierProperties(targetTierName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DatabaseChangeTierProperties)} does not support writing '{options.Format}' format."); + } + } + + DatabaseChangeTierProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDatabaseChangeTierProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseChangeTierProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.cs new file mode 100644 index 000000000000..8a70c7397149 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A database change tier definition. + public partial class DatabaseChangeTierProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DatabaseChangeTierProperties() + { + } + + /// Initializes a new instance of . + /// A target tier name. + /// Keeps track of any properties unknown to the library. + internal DatabaseChangeTierProperties(string targetTierName, IDictionary serializedAdditionalRawData) + { + TargetTierName = targetTierName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A target tier name. + public string TargetTierName { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseCreateMode.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseCreateMode.cs new file mode 100644 index 000000000000..cc3388d3483e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseCreateMode.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Create mode. Available options: Default - Create a database. Copy - Copy the source database (source database name must be specified) PointInTimeRestore - Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + public readonly partial struct DatabaseCreateMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DatabaseCreateMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string CopyValue = "Copy"; + private const string PointInTimeRestoreValue = "PointInTimeRestore"; + + /// Create a database. + public static DatabaseCreateMode Default { get; } = new DatabaseCreateMode(DefaultValue); + /// Copy the source database (source database name must be specified). + public static DatabaseCreateMode Copy { get; } = new DatabaseCreateMode(CopyValue); + /// Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + public static DatabaseCreateMode PointInTimeRestore { get; } = new DatabaseCreateMode(PointInTimeRestoreValue); + /// Determines if two values are the same. + public static bool operator ==(DatabaseCreateMode left, DatabaseCreateMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DatabaseCreateMode left, DatabaseCreateMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DatabaseCreateMode(string value) => new DatabaseCreateMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DatabaseCreateMode other && Equals(other); + /// + public bool Equals(DatabaseCreateMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.Serialization.cs new file mode 100644 index 000000000000..ebd6446153b4 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class DatabaseIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseIdentity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + if (Optional.IsDefined(PrincipalId)) + { + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId.Value); + } + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DatabaseIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseIdentity(document.RootElement, options); + } + + internal static DatabaseIdentity DeserializeDatabaseIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier resourceId = default; + Guid? principalId = default; + Guid? clientId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("principalId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("clientId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clientId = property.Value.GetGuid(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseIdentity(resourceId, principalId, clientId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DatabaseIdentity)} does not support writing '{options.Format}' format."); + } + } + + DatabaseIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDatabaseIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.cs new file mode 100644 index 000000000000..67808bbeb8a3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Database Identity properties. + public partial class DatabaseIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DatabaseIdentity() + { + } + + /// Initializes a new instance of . + /// Resource Id of the database identity. + /// Principal Id of the database identity. + /// Client Id of the database identity. + /// Keeps track of any properties unknown to the library. + internal DatabaseIdentity(ResourceIdentifier resourceId, Guid? principalId, Guid? clientId, IDictionary serializedAdditionalRawData) + { + ResourceId = resourceId; + PrincipalId = principalId; + ClientId = clientId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource Id of the database identity. + public ResourceIdentifier ResourceId { get; set; } + /// Principal Id of the database identity. + public Guid? PrincipalId { get; set; } + /// Client Id of the database identity. + public Guid? ClientId { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.Serialization.cs new file mode 100644 index 000000000000..4f6679d545d3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class DatabaseRenameProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseRenameProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NewName)) + { + writer.WritePropertyName("newName"u8); + writer.WriteStringValue(NewName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DatabaseRenameProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseRenameProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseRenameProperties(document.RootElement, options); + } + + internal static DatabaseRenameProperties DeserializeDatabaseRenameProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string newName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("newName"u8)) + { + newName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseRenameProperties(newName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DatabaseRenameProperties)} does not support writing '{options.Format}' format."); + } + } + + DatabaseRenameProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDatabaseRenameProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseRenameProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.cs new file mode 100644 index 000000000000..214a1aebc3b1 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A database rename definition. + public partial class DatabaseRenameProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DatabaseRenameProperties() + { + } + + /// Initializes a new instance of . + /// New database name. + /// Keeps track of any properties unknown to the library. + internal DatabaseRenameProperties(string newName, IDictionary serializedAdditionalRawData) + { + NewName = newName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// New database name. + public string NewName { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.Serialization.cs new file mode 100644 index 000000000000..d4b3b7c69463 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class DestinationTierOverride : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DestinationTierOverride)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType.ToString()); + writer.WritePropertyName("tierName"u8); + writer.WriteStringValue(TierName); + writer.WritePropertyName("resourceName"u8); + writer.WriteStringValue(ResourceName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DestinationTierOverride IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DestinationTierOverride)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDestinationTierOverride(document.RootElement, options); + } + + internal static DestinationTierOverride DeserializeDestinationTierOverride(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceType resourceType = default; + string tierName = default; + string resourceName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType"u8)) + { + resourceType = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("tierName"u8)) + { + tierName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceName"u8)) + { + resourceName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DestinationTierOverride(resourceType, tierName, resourceName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DestinationTierOverride)} does not support writing '{options.Format}' format."); + } + } + + DestinationTierOverride IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDestinationTierOverride(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DestinationTierOverride)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.cs new file mode 100644 index 000000000000..57d6395ac192 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A destination tier override. + public partial class DestinationTierOverride + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Resource type. + /// Destination tier name. + /// Resource name. + /// or is null. + public DestinationTierOverride(ResourceType resourceType, string tierName, string resourceName) + { + Argument.AssertNotNull(tierName, nameof(tierName)); + Argument.AssertNotNull(resourceName, nameof(resourceName)); + + ResourceType = resourceType; + TierName = tierName; + ResourceName = resourceName; + } + + /// Initializes a new instance of . + /// Resource type. + /// Destination tier name. + /// Resource name. + /// Keeps track of any properties unknown to the library. + internal DestinationTierOverride(ResourceType resourceType, string tierName, string resourceName, IDictionary serializedAdditionalRawData) + { + ResourceType = resourceType; + TierName = tierName; + ResourceName = resourceName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DestinationTierOverride() + { + } + + /// Resource type. + public ResourceType ResourceType { get; } + /// Destination tier name. + public string TierName { get; } + /// Resource name. + public string ResourceName { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.Serialization.cs new file mode 100644 index 000000000000..ccd82bf73663 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + internal partial class FirewallRuleListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FirewallRuleListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FirewallRuleListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FirewallRuleListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFirewallRuleListResult(document.RootElement, options); + } + + internal static FirewallRuleListResult DeserializeFirewallRuleListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FirewallRuleData.DeserializeFirewallRuleData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FirewallRuleListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FirewallRuleListResult)} does not support writing '{options.Format}' format."); + } + } + + FirewallRuleListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFirewallRuleListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FirewallRuleListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.cs new file mode 100644 index 000000000000..fac7d86244ec --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// The response of a FirewallRule list operation. + internal partial class FirewallRuleListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The FirewallRule items on this page. + /// is null. + internal FirewallRuleListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FirewallRule items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FirewallRuleListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FirewallRuleListResult() + { + } + + /// The FirewallRule items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.Serialization.cs new file mode 100644 index 000000000000..ba54c2d1e5c3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class FirewallRuleProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FirewallRuleProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(StartIPAddress)) + { + writer.WritePropertyName("startIpAddress"u8); + writer.WriteStringValue(StartIPAddress); + } + if (Optional.IsDefined(EndIPAddress)) + { + writer.WritePropertyName("endIpAddress"u8); + writer.WriteStringValue(EndIPAddress); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FirewallRuleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FirewallRuleProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFirewallRuleProperties(document.RootElement, options); + } + + internal static FirewallRuleProperties DeserializeFirewallRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string startIPAddress = default; + string endIPAddress = default; + AzureProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startIpAddress"u8)) + { + startIPAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("endIpAddress"u8)) + { + endIPAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FirewallRuleProperties(startIPAddress, endIPAddress, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FirewallRuleProperties)} does not support writing '{options.Format}' format."); + } + } + + FirewallRuleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFirewallRuleProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FirewallRuleProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.cs new file mode 100644 index 000000000000..2bf604d4345e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A Firewall rule properties. + public partial class FirewallRuleProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FirewallRuleProperties() + { + } + + /// Initializes a new instance of . + /// Start IP address. + /// End IP address. + /// Provisioning state. + /// Keeps track of any properties unknown to the library. + internal FirewallRuleProperties(string startIPAddress, string endIPAddress, AzureProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + StartIPAddress = startIPAddress; + EndIPAddress = endIPAddress; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Start IP address. + public string StartIPAddress { get; set; } + /// End IP address. + public string EndIPAddress { get; set; } + /// Provisioning state. + public AzureProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.Serialization.cs new file mode 100644 index 000000000000..192ef03dca0b --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + internal partial class FleetDatabaseListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetDatabaseListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetDatabaseListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetDatabaseListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetDatabaseListResult(document.RootElement, options); + } + + internal static FleetDatabaseListResult DeserializeFleetDatabaseListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetDatabaseData.DeserializeFleetDatabaseData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetDatabaseListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetDatabaseListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetDatabaseListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetDatabaseListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetDatabaseListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.cs new file mode 100644 index 000000000000..94d3204d6a4e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// The response of a FleetDatabase list operation. + internal partial class FleetDatabaseListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The FleetDatabase items on this page. + /// is null. + internal FleetDatabaseListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FleetDatabase items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetDatabaseListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetDatabaseListResult() + { + } + + /// The FleetDatabase items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.Serialization.cs new file mode 100644 index 000000000000..e94d8f475a9d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.Serialization.cs @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class FleetDatabaseProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetDatabaseProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(OriginalDatabaseId)) + { + writer.WritePropertyName("originalDatabaseId"u8); + writer.WriteStringValue(OriginalDatabaseId); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(CreateMode)) + { + writer.WritePropertyName("createMode"u8); + writer.WriteStringValue(CreateMode.Value.ToString()); + } + if (Optional.IsDefined(TierName)) + { + writer.WritePropertyName("tierName"u8); + writer.WriteStringValue(TierName); + } + if (options.Format != "W" && Optional.IsDefined(ConnectionString)) + { + writer.WritePropertyName("connectionString"u8); + writer.WriteStringValue(ConnectionString); + } + if (options.Format != "W" && Optional.IsDefined(Recoverable)) + { + writer.WritePropertyName("recoverable"u8); + writer.WriteBooleanValue(Recoverable.Value); + } + if (Optional.IsDefined(RestoreFromOn)) + { + writer.WritePropertyName("restoreFromTime"u8); + writer.WriteStringValue(RestoreFromOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(EarliestRestoreOn)) + { + writer.WritePropertyName("earliestRestoreTime"u8); + writer.WriteStringValue(EarliestRestoreOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LatestRestoreOn)) + { + writer.WritePropertyName("latestRestoreTime"u8); + writer.WriteStringValue(LatestRestoreOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(BackupRetentionDays)) + { + writer.WritePropertyName("backupRetentionDays"u8); + writer.WriteNumberValue(BackupRetentionDays.Value); + } + if (options.Format != "W" && Optional.IsDefined(DatabaseSizeGbMax)) + { + writer.WritePropertyName("databaseSizeGbMax"u8); + writer.WriteNumberValue(DatabaseSizeGbMax.Value); + } + if (Optional.IsDefined(SourceDatabaseName)) + { + writer.WritePropertyName("sourceDatabaseName"u8); + writer.WriteStringValue(SourceDatabaseName); + } + if (Optional.IsCollectionDefined(ResourceTags)) + { + writer.WritePropertyName("resourceTags"u8); + writer.WriteStartObject(); + foreach (var item in ResourceTags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + if (Optional.IsDefined(TransparentDataEncryption)) + { + writer.WritePropertyName("transparentDataEncryption"u8); + writer.WriteObjectValue(TransparentDataEncryption, options); + } + if (Optional.IsDefined(Collation)) + { + writer.WritePropertyName("collation"u8); + writer.WriteStringValue(Collation); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetDatabaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetDatabaseProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetDatabaseProperties(document.RootElement, options); + } + + internal static FleetDatabaseProperties DeserializeFleetDatabaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string originalDatabaseId = default; + AzureProvisioningState? provisioningState = default; + DatabaseCreateMode? createMode = default; + string tierName = default; + string connectionString = default; + bool? recoverable = default; + DateTimeOffset? restoreFromTime = default; + DateTimeOffset? earliestRestoreTime = default; + DateTimeOffset? latestRestoreTime = default; + int? backupRetentionDays = default; + int? databaseSizeGbMax = default; + string sourceDatabaseName = default; + IDictionary resourceTags = default; + IdentityProperties identity = default; + TransparentDataEncryption transparentDataEncryption = default; + string collation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("originalDatabaseId"u8)) + { + originalDatabaseId = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("createMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createMode = new DatabaseCreateMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("tierName"u8)) + { + tierName = property.Value.GetString(); + continue; + } + if (property.NameEquals("connectionString"u8)) + { + connectionString = property.Value.GetString(); + continue; + } + if (property.NameEquals("recoverable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoverable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("restoreFromTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + restoreFromTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("earliestRestoreTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + earliestRestoreTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("latestRestoreTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + latestRestoreTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("backupRetentionDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backupRetentionDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("databaseSizeGbMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseSizeGbMax = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sourceDatabaseName"u8)) + { + sourceDatabaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + resourceTags = dictionary; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = IdentityProperties.DeserializeIdentityProperties(property.Value, options); + continue; + } + if (property.NameEquals("transparentDataEncryption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + transparentDataEncryption = TransparentDataEncryption.DeserializeTransparentDataEncryption(property.Value, options); + continue; + } + if (property.NameEquals("collation"u8)) + { + collation = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetDatabaseProperties( + originalDatabaseId, + provisioningState, + createMode, + tierName, + connectionString, + recoverable, + restoreFromTime, + earliestRestoreTime, + latestRestoreTime, + backupRetentionDays, + databaseSizeGbMax, + sourceDatabaseName, + resourceTags ?? new ChangeTrackingDictionary(), + identity, + transparentDataEncryption, + collation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetDatabaseProperties)} does not support writing '{options.Format}' format."); + } + } + + FleetDatabaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetDatabaseProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetDatabaseProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.cs new file mode 100644 index 000000000000..f9af6806a77c --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Fleet database properties. + public partial class FleetDatabaseProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetDatabaseProperties() + { + ResourceTags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource identifier for the underlying database resource. + /// Database state. + /// Create mode. Available options: Default - Create a database. Copy - Copy the source database (source database name must be specified) PointInTimeRestore - Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + /// Name of the tier this database belongs to. + /// Connection string to connect to the database with. + /// If true, database is recoverable. + /// Restore from time when CreateMode is PointInTimeRestore. + /// Earliest restore time. + /// Latest restore time. + /// Backup retention in days. + /// Maximum database size in Gb. + /// Source database name used when CreateMode is Copy or PointInTimeRestore. + /// Additional database properties to be applied as the underlying database resource tags. + /// Identity property. + /// Transparent Data Encryption properties. + /// Database collation. + /// Keeps track of any properties unknown to the library. + internal FleetDatabaseProperties(string originalDatabaseId, AzureProvisioningState? provisioningState, DatabaseCreateMode? createMode, string tierName, string connectionString, bool? recoverable, DateTimeOffset? restoreFromOn, DateTimeOffset? earliestRestoreOn, DateTimeOffset? latestRestoreOn, int? backupRetentionDays, int? databaseSizeGbMax, string sourceDatabaseName, IDictionary resourceTags, IdentityProperties identity, TransparentDataEncryption transparentDataEncryption, string collation, IDictionary serializedAdditionalRawData) + { + OriginalDatabaseId = originalDatabaseId; + ProvisioningState = provisioningState; + CreateMode = createMode; + TierName = tierName; + ConnectionString = connectionString; + Recoverable = recoverable; + RestoreFromOn = restoreFromOn; + EarliestRestoreOn = earliestRestoreOn; + LatestRestoreOn = latestRestoreOn; + BackupRetentionDays = backupRetentionDays; + DatabaseSizeGbMax = databaseSizeGbMax; + SourceDatabaseName = sourceDatabaseName; + ResourceTags = resourceTags; + Identity = identity; + TransparentDataEncryption = transparentDataEncryption; + Collation = collation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource identifier for the underlying database resource. + public string OriginalDatabaseId { get; } + /// Database state. + public AzureProvisioningState? ProvisioningState { get; } + /// Create mode. Available options: Default - Create a database. Copy - Copy the source database (source database name must be specified) PointInTimeRestore - Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + public DatabaseCreateMode? CreateMode { get; set; } + /// Name of the tier this database belongs to. + public string TierName { get; set; } + /// Connection string to connect to the database with. + public string ConnectionString { get; } + /// If true, database is recoverable. + public bool? Recoverable { get; } + /// Restore from time when CreateMode is PointInTimeRestore. + public DateTimeOffset? RestoreFromOn { get; set; } + /// Earliest restore time. + public DateTimeOffset? EarliestRestoreOn { get; } + /// Latest restore time. + public DateTimeOffset? LatestRestoreOn { get; } + /// Backup retention in days. + public int? BackupRetentionDays { get; } + /// Maximum database size in Gb. + public int? DatabaseSizeGbMax { get; } + /// Source database name used when CreateMode is Copy or PointInTimeRestore. + public string SourceDatabaseName { get; set; } + /// Additional database properties to be applied as the underlying database resource tags. + public IDictionary ResourceTags { get; } + /// Identity property. + public IdentityProperties Identity { get; set; } + /// Transparent Data Encryption properties. + public TransparentDataEncryption TransparentDataEncryption { get; set; } + /// Database collation. + public string Collation { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.Serialization.cs new file mode 100644 index 000000000000..947fc827324d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + internal partial class FleetListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetListResult(document.RootElement, options); + } + + internal static FleetListResult DeserializeFleetListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetData.DeserializeFleetData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.cs new file mode 100644 index 000000000000..8f540541070e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// The response of a Fleet list operation. + internal partial class FleetListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Fleet items on this page. + /// is null. + internal FleetListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Fleet items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetListResult() + { + } + + /// The Fleet items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.Serialization.cs new file mode 100644 index 000000000000..1d3092cc5d97 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class FleetPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetPatch(document.RootElement, options); + } + + internal static FleetPatch DeserializeFleetPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + FleetProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = FleetProperties.DeserializeFleetProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetPatch)} does not support writing '{options.Format}' format."); + } + } + + FleetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.cs new file mode 100644 index 000000000000..5d094a941c76 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// An update to a Database Fleet. + public partial class FleetPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// The Database Fleet properties. + /// Keeps track of any properties unknown to the library. + internal FleetPatch(IDictionary tags, FleetProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// The Database Fleet properties. + public FleetProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.Serialization.cs new file mode 100644 index 000000000000..fe75ff9be114 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class FleetProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetProperties(document.RootElement, options); + } + + internal static FleetProperties DeserializeFleetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + AzureProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetProperties(description, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetProperties)} does not support writing '{options.Format}' format."); + } + } + + FleetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.cs new file mode 100644 index 000000000000..36f22956d71d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// The Database Fleet properties. + public partial class FleetProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetProperties() + { + } + + /// Initializes a new instance of . + /// Fleet description. + /// Provisioning state. + /// Keeps track of any properties unknown to the library. + internal FleetProperties(string description, AzureProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Description = description; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Fleet description. + public string Description { get; set; } + /// Provisioning state. + public AzureProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.Serialization.cs new file mode 100644 index 000000000000..d5f81ad9a9a5 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + internal partial class FleetTierListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetTierListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetTierListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetTierListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetTierListResult(document.RootElement, options); + } + + internal static FleetTierListResult DeserializeFleetTierListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetTierData.DeserializeFleetTierData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetTierListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetTierListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetTierListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetTierListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetTierListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.cs new file mode 100644 index 000000000000..b5e5af8cb162 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// The response of a FleetTier list operation. + internal partial class FleetTierListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The FleetTier items on this page. + /// is null. + internal FleetTierListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FleetTier items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetTierListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetTierListResult() + { + } + + /// The FleetTier items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.Serialization.cs new file mode 100644 index 000000000000..ed01f9dd45c4 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.Serialization.cs @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class FleetTierProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetTierProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Disabled)) + { + writer.WritePropertyName("disabled"u8); + writer.WriteBooleanValue(Disabled.Value); + } + if (Optional.IsDefined(Serverless)) + { + writer.WritePropertyName("serverless"u8); + writer.WriteBooleanValue(Serverless.Value); + } + if (Optional.IsDefined(Pooled)) + { + writer.WritePropertyName("pooled"u8); + writer.WriteBooleanValue(Pooled.Value); + } + if (Optional.IsDefined(ServiceTier)) + { + writer.WritePropertyName("serviceTier"u8); + writer.WriteStringValue(ServiceTier); + } + if (Optional.IsDefined(Family)) + { + writer.WritePropertyName("family"u8); + writer.WriteStringValue(Family); + } + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteNumberValue(Capacity.Value); + } + if (Optional.IsDefined(PoolNumOfDatabasesMax)) + { + writer.WritePropertyName("poolNumOfDatabasesMax"u8); + writer.WriteNumberValue(PoolNumOfDatabasesMax.Value); + } + if (Optional.IsDefined(HighAvailabilityReplicaCount)) + { + writer.WritePropertyName("highAvailabilityReplicaCount"u8); + writer.WriteNumberValue(HighAvailabilityReplicaCount.Value); + } + if (Optional.IsDefined(ZoneRedundancy)) + { + writer.WritePropertyName("zoneRedundancy"u8); + writer.WriteStringValue(ZoneRedundancy.Value.ToString()); + } + if (Optional.IsDefined(DatabaseCapacityMin)) + { + writer.WritePropertyName("databaseCapacityMin"u8); + writer.WriteNumberValue(DatabaseCapacityMin.Value); + } + if (Optional.IsDefined(DatabaseCapacityMax)) + { + writer.WritePropertyName("databaseCapacityMax"u8); + writer.WriteNumberValue(DatabaseCapacityMax.Value); + } + if (Optional.IsDefined(DatabaseSizeGbMax)) + { + writer.WritePropertyName("databaseSizeGbMax"u8); + writer.WriteNumberValue(DatabaseSizeGbMax.Value); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetTierProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetTierProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetTierProperties(document.RootElement, options); + } + + internal static FleetTierProperties DeserializeFleetTierProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? disabled = default; + bool? serverless = default; + bool? pooled = default; + string serviceTier = default; + string family = default; + int? capacity = default; + int? poolNumOfDatabasesMax = default; + int? highAvailabilityReplicaCount = default; + ZoneRedundancy? zoneRedundancy = default; + double? databaseCapacityMin = default; + double? databaseCapacityMax = default; + int? databaseSizeGbMax = default; + AzureProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("disabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("serverless"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverless = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("pooled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pooled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("serviceTier"u8)) + { + serviceTier = property.Value.GetString(); + continue; + } + if (property.NameEquals("family"u8)) + { + family = property.Value.GetString(); + continue; + } + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("poolNumOfDatabasesMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + poolNumOfDatabasesMax = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("highAvailabilityReplicaCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highAvailabilityReplicaCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("zoneRedundancy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zoneRedundancy = new ZoneRedundancy(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseCapacityMin"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseCapacityMin = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("databaseCapacityMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseCapacityMax = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("databaseSizeGbMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseSizeGbMax = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetTierProperties( + disabled, + serverless, + pooled, + serviceTier, + family, + capacity, + poolNumOfDatabasesMax, + highAvailabilityReplicaCount, + zoneRedundancy, + databaseCapacityMin, + databaseCapacityMax, + databaseSizeGbMax, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetTierProperties)} does not support writing '{options.Format}' format."); + } + } + + FleetTierProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetTierProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetTierProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.cs new file mode 100644 index 000000000000..35cb55d23201 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A Fleet tier properties. + public partial class FleetTierProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetTierProperties() + { + } + + /// Initializes a new instance of . + /// If true, tier is disabled. + /// If true, serverless resources are provisioned in the tier. + /// If true, databases are pooled. + /// Service tier of provisioned resources. Supported values: GeneralPurpose, Hyperscale. + /// Family of provisioned resources, for example Gen5. + /// Capacity of provisioned resources in the tier, in units matching the specified service tier, for example vCore for GeneralPurpose. + /// Maximum number of databases per pool. + /// Number of high availability replicas for databases in this tier. + /// Enable zone redundancy for all databases in this tier. + /// Minimum allocated capacity per database, in units matching the specified service tier. + /// Maximum allocated capacity per database, in units matching the specified service tier. + /// Maximum database size in Gb. + /// Provisioning state. + /// Keeps track of any properties unknown to the library. + internal FleetTierProperties(bool? disabled, bool? serverless, bool? pooled, string serviceTier, string family, int? capacity, int? poolNumOfDatabasesMax, int? highAvailabilityReplicaCount, ZoneRedundancy? zoneRedundancy, double? databaseCapacityMin, double? databaseCapacityMax, int? databaseSizeGbMax, AzureProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Disabled = disabled; + Serverless = serverless; + Pooled = pooled; + ServiceTier = serviceTier; + Family = family; + Capacity = capacity; + PoolNumOfDatabasesMax = poolNumOfDatabasesMax; + HighAvailabilityReplicaCount = highAvailabilityReplicaCount; + ZoneRedundancy = zoneRedundancy; + DatabaseCapacityMin = databaseCapacityMin; + DatabaseCapacityMax = databaseCapacityMax; + DatabaseSizeGbMax = databaseSizeGbMax; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// If true, tier is disabled. + public bool? Disabled { get; } + /// If true, serverless resources are provisioned in the tier. + public bool? Serverless { get; set; } + /// If true, databases are pooled. + public bool? Pooled { get; set; } + /// Service tier of provisioned resources. Supported values: GeneralPurpose, Hyperscale. + public string ServiceTier { get; set; } + /// Family of provisioned resources, for example Gen5. + public string Family { get; set; } + /// Capacity of provisioned resources in the tier, in units matching the specified service tier, for example vCore for GeneralPurpose. + public int? Capacity { get; set; } + /// Maximum number of databases per pool. + public int? PoolNumOfDatabasesMax { get; set; } + /// Number of high availability replicas for databases in this tier. + public int? HighAvailabilityReplicaCount { get; set; } + /// Enable zone redundancy for all databases in this tier. + public ZoneRedundancy? ZoneRedundancy { get; set; } + /// Minimum allocated capacity per database, in units matching the specified service tier. + public double? DatabaseCapacityMin { get; set; } + /// Maximum allocated capacity per database, in units matching the specified service tier. + public double? DatabaseCapacityMax { get; set; } + /// Maximum database size in Gb. + public int? DatabaseSizeGbMax { get; set; } + /// Provisioning state. + public AzureProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.Serialization.cs new file mode 100644 index 000000000000..5119e07ccddf --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + internal partial class FleetspaceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetspaceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspaceListResult(document.RootElement, options); + } + + internal static FleetspaceListResult DeserializeFleetspaceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetspaceData.DeserializeFleetspaceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetspaceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetspaceListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetspaceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetspaceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspaceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.cs new file mode 100644 index 000000000000..3f4024c0a31f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// The response of a Fleetspace list operation. + internal partial class FleetspaceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Fleetspace items on this page. + /// is null. + internal FleetspaceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Fleetspace items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetspaceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetspaceListResult() + { + } + + /// The Fleetspace items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.Serialization.cs new file mode 100644 index 000000000000..a433a4024b6c --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class FleetspaceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(CapacityMax)) + { + writer.WritePropertyName("capacityMax"u8); + writer.WriteNumberValue(CapacityMax.Value); + } + if (Optional.IsDefined(MainPrincipal)) + { + writer.WritePropertyName("mainPrincipal"u8); + writer.WriteObjectValue(MainPrincipal, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetspaceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspaceProperties(document.RootElement, options); + } + + internal static FleetspaceProperties DeserializeFleetspaceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureProvisioningState? provisioningState = default; + int? capacityMax = default; + MainPrincipal mainPrincipal = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("capacityMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityMax = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("mainPrincipal"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mainPrincipal = MainPrincipal.DeserializeMainPrincipal(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetspaceProperties(provisioningState, capacityMax, mainPrincipal, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetspaceProperties)} does not support writing '{options.Format}' format."); + } + } + + FleetspaceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetspaceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspaceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.cs new file mode 100644 index 000000000000..e9289aa3cdc4 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A Fleetspace properties. + public partial class FleetspaceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetspaceProperties() + { + } + + /// Initializes a new instance of . + /// Fleetspace state. + /// Maximum number of vCores database fleet manager is allowed to provision in the fleetspace. + /// Main Microsoft Entra ID principal that has admin access to all databases in the fleetspace. + /// Keeps track of any properties unknown to the library. + internal FleetspaceProperties(AzureProvisioningState? provisioningState, int? capacityMax, MainPrincipal mainPrincipal, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + CapacityMax = capacityMax; + MainPrincipal = mainPrincipal; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Fleetspace state. + public AzureProvisioningState? ProvisioningState { get; } + /// Maximum number of vCores database fleet manager is allowed to provision in the fleetspace. + public int? CapacityMax { get; set; } + /// Main Microsoft Entra ID principal that has admin access to all databases in the fleetspace. + public MainPrincipal MainPrincipal { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.Serialization.cs new file mode 100644 index 000000000000..488b4b2cfc27 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class IdentityProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IdentityProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IdentityType)) + { + writer.WritePropertyName("identityType"u8); + writer.WriteStringValue(IdentityType.Value.ToString()); + } + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"u8); + writer.WriteStartArray(); + foreach (var item in UserAssignedIdentities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(FederatedClientId)) + { + writer.WritePropertyName("federatedClientId"u8); + writer.WriteStringValue(FederatedClientId.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IdentityProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IdentityProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIdentityProperties(document.RootElement, options); + } + + internal static IdentityProperties DeserializeIdentityProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IdentityType? identityType = default; + IList userAssignedIdentities = default; + Guid? federatedClientId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityType = new IdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DatabaseIdentity.DeserializeDatabaseIdentity(item, options)); + } + userAssignedIdentities = array; + continue; + } + if (property.NameEquals("federatedClientId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + federatedClientId = property.Value.GetGuid(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IdentityProperties(identityType, userAssignedIdentities ?? new ChangeTrackingList(), federatedClientId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IdentityProperties)} does not support writing '{options.Format}' format."); + } + } + + IdentityProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIdentityProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IdentityProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.cs new file mode 100644 index 000000000000..c8aa59723fd3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Database Identity. + public partial class IdentityProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IdentityProperties() + { + UserAssignedIdentities = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Identity type of the main principal. + /// User identity ids. + /// The federated client id for the SQL Database. It is used for cross tenant CMK scenario. + /// Keeps track of any properties unknown to the library. + internal IdentityProperties(IdentityType? identityType, IList userAssignedIdentities, Guid? federatedClientId, IDictionary serializedAdditionalRawData) + { + IdentityType = identityType; + UserAssignedIdentities = userAssignedIdentities; + FederatedClientId = federatedClientId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Identity type of the main principal. + public IdentityType? IdentityType { get; set; } + /// User identity ids. + public IList UserAssignedIdentities { get; } + /// The federated client id for the SQL Database. It is used for cross tenant CMK scenario. + public Guid? FederatedClientId { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityType.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityType.cs new file mode 100644 index 000000000000..4c18df457266 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Identity type of the main principal. + public readonly partial struct IdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string UserAssignedValue = "UserAssigned"; + + /// No identity. + public static IdentityType None { get; } = new IdentityType(NoneValue); + /// User assigned identity. + public static IdentityType UserAssigned { get; } = new IdentityType(UserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(IdentityType left, IdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IdentityType left, IdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IdentityType(string value) => new IdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IdentityType other && Equals(other); + /// + public bool Equals(IdentityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.Serialization.cs new file mode 100644 index 000000000000..68c67e32b2d7 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.Serialization.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class MainPrincipal : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MainPrincipal)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Login)) + { + writer.WritePropertyName("login"u8); + writer.WriteStringValue(Login); + } + if (Optional.IsDefined(ApplicationId)) + { + writer.WritePropertyName("applicationId"u8); + writer.WriteStringValue(ApplicationId.Value); + } + if (Optional.IsDefined(ObjectId)) + { + writer.WritePropertyName("objectId"u8); + writer.WriteStringValue(ObjectId.Value); + } + if (Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId.Value); + } + if (Optional.IsDefined(PrincipalType)) + { + writer.WritePropertyName("principalType"u8); + writer.WriteStringValue(PrincipalType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MainPrincipal IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MainPrincipal)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMainPrincipal(document.RootElement, options); + } + + internal static MainPrincipal DeserializeMainPrincipal(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string login = default; + Guid? applicationId = default; + Guid? objectId = default; + Guid? tenantId = default; + PrincipalType? principalType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("login"u8)) + { + login = property.Value.GetString(); + continue; + } + if (property.NameEquals("applicationId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applicationId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("objectId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + objectId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tenantId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("principalType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalType = new PrincipalType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MainPrincipal( + login, + applicationId, + objectId, + tenantId, + principalType, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MainPrincipal)} does not support writing '{options.Format}' format."); + } + } + + MainPrincipal IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMainPrincipal(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MainPrincipal)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.cs new file mode 100644 index 000000000000..eb5d3839f132 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A main principal. + public partial class MainPrincipal + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MainPrincipal() + { + } + + /// Initializes a new instance of . + /// Login name of the main principal. + /// Application Id of the main principal. + /// Object Id of the main principal. + /// Tenant Id of the main principal. + /// Principal type of the main principal. + /// Keeps track of any properties unknown to the library. + internal MainPrincipal(string login, Guid? applicationId, Guid? objectId, Guid? tenantId, PrincipalType? principalType, IDictionary serializedAdditionalRawData) + { + Login = login; + ApplicationId = applicationId; + ObjectId = objectId; + TenantId = tenantId; + PrincipalType = principalType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Login name of the main principal. + public string Login { get; set; } + /// Application Id of the main principal. + public Guid? ApplicationId { get; set; } + /// Object Id of the main principal. + public Guid? ObjectId { get; set; } + /// Tenant Id of the main principal. + public Guid? TenantId { get; set; } + /// Principal type of the main principal. + public PrincipalType? PrincipalType { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/PrincipalType.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/PrincipalType.cs new file mode 100644 index 000000000000..a8fe0c148ff2 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/PrincipalType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Principal type of the authorized principal. + public readonly partial struct PrincipalType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PrincipalType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ApplicationValue = "Application"; + private const string UserValue = "User"; + + /// Application principal type. + public static PrincipalType Application { get; } = new PrincipalType(ApplicationValue); + /// User principal type. + public static PrincipalType User { get; } = new PrincipalType(UserValue); + /// Determines if two values are the same. + public static bool operator ==(PrincipalType left, PrincipalType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PrincipalType left, PrincipalType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PrincipalType(string value) => new PrincipalType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PrincipalType other && Equals(other); + /// + public bool Equals(PrincipalType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.Serialization.cs new file mode 100644 index 000000000000..1fba8d19e604 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class RegisterServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RegisterServerProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TierName)) + { + writer.WritePropertyName("tierName"u8); + writer.WriteStringValue(TierName); + } + if (Optional.IsDefined(SourceSubscriptionId)) + { + writer.WritePropertyName("sourceSubscriptionId"u8); + writer.WriteStringValue(SourceSubscriptionId); + } + if (Optional.IsDefined(SourceResourceGroupName)) + { + writer.WritePropertyName("sourceResourceGroupName"u8); + writer.WriteStringValue(SourceResourceGroupName); + } + if (Optional.IsDefined(SourceServerName)) + { + writer.WritePropertyName("sourceServerName"u8); + writer.WriteStringValue(SourceServerName); + } + if (Optional.IsCollectionDefined(DestinationTierOverrides)) + { + writer.WritePropertyName("destinationTierOverrides"u8); + writer.WriteStartArray(); + foreach (var item in DestinationTierOverrides) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RegisterServerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RegisterServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRegisterServerProperties(document.RootElement, options); + } + + internal static RegisterServerProperties DeserializeRegisterServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string tierName = default; + string sourceSubscriptionId = default; + string sourceResourceGroupName = default; + string sourceServerName = default; + IList destinationTierOverrides = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tierName"u8)) + { + tierName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceSubscriptionId"u8)) + { + sourceSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceResourceGroupName"u8)) + { + sourceResourceGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceServerName"u8)) + { + sourceServerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("destinationTierOverrides"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DestinationTierOverride.DeserializeDestinationTierOverride(item, options)); + } + destinationTierOverrides = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RegisterServerProperties( + tierName, + sourceSubscriptionId, + sourceResourceGroupName, + sourceServerName, + destinationTierOverrides ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RegisterServerProperties)} does not support writing '{options.Format}' format."); + } + } + + RegisterServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRegisterServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RegisterServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.cs new file mode 100644 index 000000000000..83270ed1034b --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Server registration definition. + public partial class RegisterServerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RegisterServerProperties() + { + DestinationTierOverrides = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Destination tier name. + /// Source subscription id. + /// Source resource group name. + /// Source SQL Server name. + /// Destination tier overrides. + /// Keeps track of any properties unknown to the library. + internal RegisterServerProperties(string tierName, string sourceSubscriptionId, string sourceResourceGroupName, string sourceServerName, IList destinationTierOverrides, IDictionary serializedAdditionalRawData) + { + TierName = tierName; + SourceSubscriptionId = sourceSubscriptionId; + SourceResourceGroupName = sourceResourceGroupName; + SourceServerName = sourceServerName; + DestinationTierOverrides = destinationTierOverrides; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Destination tier name. + public string TierName { get; set; } + /// Source subscription id. + public string SourceSubscriptionId { get; set; } + /// Source resource group name. + public string SourceResourceGroupName { get; set; } + /// Source SQL Server name. + public string SourceServerName { get; set; } + /// Destination tier overrides. + public IList DestinationTierOverrides { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ResourceType.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ResourceType.cs new file mode 100644 index 000000000000..47ce2d88086f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ResourceType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Resource type of the destination tier override. + public readonly partial struct ResourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DatabaseValue = "Database"; + private const string PoolValue = "Pool"; + + /// Database resource type. + public static ResourceType Database { get; } = new ResourceType(DatabaseValue); + /// Elastic pool resource type. + public static ResourceType Pool { get; } = new ResourceType(PoolValue); + /// Determines if two values are the same. + public static bool operator ==(ResourceType left, ResourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResourceType left, ResourceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ResourceType(string value) => new ResourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResourceType other && Equals(other); + /// + public bool Equals(ResourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.Serialization.cs new file mode 100644 index 000000000000..4410e7d3a802 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class TransparentDataEncryption : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TransparentDataEncryption)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(KeyUri)) + { + writer.WritePropertyName("keyUri"u8); + writer.WriteStringValue(KeyUri.AbsoluteUri); + } + if (Optional.IsCollectionDefined(Keys)) + { + writer.WritePropertyName("keys"u8); + writer.WriteStartArray(); + foreach (var item in Keys) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(EnableAutoRotation)) + { + writer.WritePropertyName("enableAutoRotation"u8); + writer.WriteBooleanValue(EnableAutoRotation.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TransparentDataEncryption IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TransparentDataEncryption)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTransparentDataEncryption(document.RootElement, options); + } + + internal static TransparentDataEncryption DeserializeTransparentDataEncryption(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri keyUri = default; + IList keys = default; + bool? enableAutoRotation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("keys"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + keys = array; + continue; + } + if (property.NameEquals("enableAutoRotation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutoRotation = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TransparentDataEncryption(keyUri, keys ?? new ChangeTrackingList(), enableAutoRotation, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TransparentDataEncryption)} does not support writing '{options.Format}' format."); + } + } + + TransparentDataEncryption IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTransparentDataEncryption(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TransparentDataEncryption)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.cs new file mode 100644 index 000000000000..8cf2e72658ff --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Transparent Data Encryption properties. + public partial class TransparentDataEncryption + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public TransparentDataEncryption() + { + Keys = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Customer Managed Key (CMK) Uri. + /// Additional Keys. + /// Enable key auto rotation. + /// Keeps track of any properties unknown to the library. + internal TransparentDataEncryption(Uri keyUri, IList keys, bool? enableAutoRotation, IDictionary serializedAdditionalRawData) + { + KeyUri = keyUri; + Keys = keys; + EnableAutoRotation = enableAutoRotation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Customer Managed Key (CMK) Uri. + public Uri KeyUri { get; set; } + /// Additional Keys. + public IList Keys { get; } + /// Enable key auto rotation. + public bool? EnableAutoRotation { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ZoneRedundancy.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ZoneRedundancy.cs new file mode 100644 index 000000000000..5aaa4d259d0d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ZoneRedundancy.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Status of zone redundancy in a tier. + public readonly partial struct ZoneRedundancy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ZoneRedundancy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Zone redundancy enabled. + public static ZoneRedundancy Enabled { get; } = new ZoneRedundancy(EnabledValue); + /// Zone redundancy disabled. + public static ZoneRedundancy Disabled { get; } = new ZoneRedundancy(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(ZoneRedundancy left, ZoneRedundancy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ZoneRedundancy left, ZoneRedundancy right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ZoneRedundancy(string value) => new ZoneRedundancy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ZoneRedundancy other && Equals(other); + /// + public bool Equals(ZoneRedundancy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ProviderConstants.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..978185b579aa --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FirewallRulesRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FirewallRulesRestOperations.cs new file mode 100644 index 000000000000..0f628e615d31 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FirewallRulesRestOperations.cs @@ -0,0 +1,585 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FirewallRulesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FirewallRulesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FirewallRulesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FirewallRuleData.DeserializeFirewallRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FirewallRuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FirewallRuleData.DeserializeFirewallRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FirewallRuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, FirewallRuleData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, FirewallRuleData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// The firewall rule object to create or update. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// The firewall rule object to create or update. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetspaceRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByFleetspaceRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all firewall rules in a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetspaceAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all firewall rules in a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByFleetspace(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetspaceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetspaceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all firewall rules in a fleetspace. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetspaceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all firewall rules in a fleetspace. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByFleetspaceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetDatabasesRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetDatabasesRestOperations.cs new file mode 100644 index 000000000000..826cdc4cd6d5 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetDatabasesRestOperations.cs @@ -0,0 +1,1021 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FleetDatabasesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetDatabasesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FleetDatabasesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetDatabaseData.DeserializeFleetDatabaseData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetDatabaseData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetDatabaseData.DeserializeFleetDatabaseData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetDatabaseData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The database object to create or update. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The database object to create or update. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The database object to patch. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The database object to patch. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetspaceRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string filter, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByFleetspaceRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string filter, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleet databases in a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetspaceAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, filter, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetDatabaseListResult.DeserializeFleetDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleet databases in a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByFleetspace(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, filter, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetDatabaseListResult.DeserializeFleetDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateChangeTierRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseChangeTierProperties body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/changeTier", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateChangeTierRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseChangeTierProperties body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/changeTier", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Moves database to a different tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The details of the change tier operation. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task ChangeTierAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseChangeTierProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateChangeTierRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Moves database to a different tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The details of the change tier operation. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ChangeTier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseChangeTierProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateChangeTierRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRenameRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseRenameProperties body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/rename", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRenameRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseRenameProperties body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/rename", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Renames a database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The details of the rename operation. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task RenameAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseRenameProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateRenameRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Renames a database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The details of the rename operation. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Rename(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseRenameProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateRenameRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRevertRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/revert", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRevertRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/revert", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Revert a database transparent data encryption (TDE). + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task RevertAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateRevertRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Revert a database transparent data encryption (TDE). + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Revert(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateRevertRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetspaceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string filter, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetspaceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string filter, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleet databases in a fleetspace. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetspaceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, filter, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetDatabaseListResult.DeserializeFleetDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleet databases in a fleetspace. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByFleetspaceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, filter, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetDatabaseListResult.DeserializeFleetDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetTiersRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetTiersRestOperations.cs new file mode 100644 index 000000000000..03a7e139c584 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetTiersRestOperations.cs @@ -0,0 +1,751 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FleetTiersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetTiersRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FleetTiersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a tier resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, tierName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetTierData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetTierData.DeserializeFleetTierData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetTierData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a tier resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, tierName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetTierData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetTierData.DeserializeFleetTierData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetTierData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The tier object to create or update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, tierName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The tier object to create or update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, tierName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, tierName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, tierName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, tierName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, tierName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List tiers in a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetTierListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetTierListResult.DeserializeFleetTierListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List tiers in a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetTierListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetTierListResult.DeserializeFleetTierListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDisableRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendPath("/disable", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDisableRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendPath("/disable", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Disables a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> DisableAsync(string subscriptionId, string resourceGroupName, string fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateDisableRequest(subscriptionId, resourceGroupName, fleetName, tierName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetTierData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetTierData.DeserializeFleetTierData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Disables a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Disable(string subscriptionId, string resourceGroupName, string fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateDisableRequest(subscriptionId, resourceGroupName, fleetName, tierName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetTierData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetTierData.DeserializeFleetTierData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List tiers in a fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetTierListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetTierListResult.DeserializeFleetTierListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List tiers in a fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetTierListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetTierListResult.DeserializeFleetTierListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetsRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetsRestOperations.cs new file mode 100644 index 000000000000..0a6aa9468696 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetsRestOperations.cs @@ -0,0 +1,759 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FleetsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FleetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetData.DeserializeFleetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetData.DeserializeFleetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, FleetData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, FleetData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The fleet object to create or update. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, FleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The fleet object to create or update. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, FleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Modifies a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The fleet object to patch. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Modifies a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The fleet object to patch. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleets in a resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleets in a resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleets in a subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleets in a subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleets in a resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleets in a resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleets in a subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleets in a subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetspacesRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetspacesRestOperations.cs new file mode 100644 index 000000000000..b090d734346c --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetspacesRestOperations.cs @@ -0,0 +1,841 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FleetspacesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetspacesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FleetspacesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetspaceData.DeserializeFleetspaceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetspaceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetspaceData.DeserializeFleetspaceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetspaceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The fleet object to create or update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The fleet object to create or update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Modifies a fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Modifies a fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists fleetspaces in a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists fleetspaces in a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRegisterServerRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, RegisterServerProperties body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/registerServer", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRegisterServerRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, RegisterServerProperties body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/registerServer", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Migrates an existing logical server into fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The details of the register server operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task RegisterServerAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, RegisterServerProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateRegisterServerRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Migrates an existing logical server into fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The details of the register server operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response RegisterServer(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, RegisterServerProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateRegisterServerRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUnregisterRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/unregister", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUnregisterRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/unregister", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Unregisters all databases from a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UnregisterAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateUnregisterRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Unregisters all databases from a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Unregister(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateUnregisterRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists fleetspaces in a fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists fleetspaces in a fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Properties/AssemblyInfo.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..5054b8d16600 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.DatabaseFleetManager.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("DatabaseFleetManager")] diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/Azure.ResourceManager.DatabaseFleetManager.Tests.csproj b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/Azure.ResourceManager.DatabaseFleetManager.Tests.csproj new file mode 100644 index 000000000000..0d3762ddbdc3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/Azure.ResourceManager.DatabaseFleetManager.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestBase.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestBase.cs new file mode 100644 index 000000000000..7ffd79d94660 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.DatabaseFleetManager.Tests +{ + public class DatabaseFleetManagerManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected DatabaseFleetManagerManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected DatabaseFleetManagerManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestEnvironment.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestEnvironment.cs new file mode 100644 index 000000000000..9582ae45e94a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Tests +{ + public class DatabaseFleetManagerManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tsp-location.yaml b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tsp-location.yaml new file mode 100644 index 000000000000..028164652ea6 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/databasefleetmanager/DatabaseFleetManager.Management +commit: 216cc05a932c0770a40b19ebafd0c76a5c17809b +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/databasefleetmanager/ci.mgmt.yml b/sdk/databasefleetmanager/ci.mgmt.yml new file mode 100644 index 000000000000..97b2f849f23c --- /dev/null +++ b/sdk/databasefleetmanager/ci.mgmt.yml @@ -0,0 +1,26 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databasefleetmanager /ci.mgmt.yml + - sdk/databasefleetmanager /Azure.ResourceManager.DatabaseFleetManager / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: databasefleetmanager + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.DatabaseFleetManager + safeName: AzureResourceManagerDatabaseFleetManager diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ActionParameters.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ActionParameters.Serialization.cs new file mode 100644 index 000000000000..d7f704f11148 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ActionParameters.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.Analytics.Defender.Easm +{ + public partial class ActionParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionParameters)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ActionParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActionParameters(document.RootElement, options); + } + + internal static ActionParameters DeserializeActionParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ActionParameters(value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ActionParameters)} does not support writing '{options.Format}' format."); + } + } + + ActionParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeActionParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActionParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ActionParameters FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeActionParameters(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ActionParameters.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ActionParameters.cs new file mode 100644 index 000000000000..54e07325de47 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ActionParameters.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.Analytics.Defender.Easm +{ + /// This is an object that exists to provide a common schema definition for the action parameters. + public partial class ActionParameters + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ActionParameters() + { + } + + /// Initializes a new instance of . + /// + /// The value parameter that is used by the policy action. This is action specific, + /// for further information please refer to documentation here: + /// https://learn.microsoft.com/en-us/azure/external-attack-surface-management/policy-engine + /// + /// Keeps track of any properties unknown to the library. + internal ActionParameters(string value, IDictionary serializedAdditionalRawData) + { + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The value parameter that is used by the policy action. This is action specific, + /// for further information please refer to documentation here: + /// https://learn.microsoft.com/en-us/azure/external-attack-surface-management/policy-engine + /// + public string Value { get; set; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmModelFactory.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmModelFactory.cs index 6333520b7dc2..81af844b25c1 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmModelFactory.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmModelFactory.cs @@ -54,7 +54,7 @@ public static AssetResource AssetResource(string kind = null, string id = null, } /// Initializes a new instance of . - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. /// The caller provided unique name for the resource. /// The name that can be used for display purposes. /// The kind of asset. @@ -1979,15 +1979,152 @@ public static TaskResource TaskResource(string id = null, DateTimeOffset? starte serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The total number of elements. + /// The summary of observation counts by priority. + /// The list of observation results. + /// A new instance for mocking. + public static ObservationPageResult ObservationPageResult(long totalElements = default, IReadOnlyDictionary prioritySummary = null, IEnumerable value = null) + { + prioritySummary ??= new Dictionary(); + value ??= new List(); + + return new ObservationPageResult(totalElements, prioritySummary, value?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the observation. + /// The list of applicable types. + /// The priority of the observation. + /// The CVSS v2 score. + /// The CVSS v3 score. + /// The remediation state of the observation. + /// The source of the remediation state of the observation. + /// A new instance for mocking. + public static ObservationResult ObservationResult(string name = null, IEnumerable types = null, ObservationPriority priority = default, double cvssScoreV2 = default, double cvssScoreV3 = default, ObservationRemediationState remediationState = default, ObservationRemediationSource remediationSource = default) + { + types ??= new List(); + + return new ObservationResult( + name, + types?.ToList(), + priority, + cvssScoreV2, + cvssScoreV3, + remediationState, + remediationSource, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The type of delta detail to retrieve. + /// The number of days prior to retrieve deltas for. + /// The type of asset. + /// expected format to be: yyyy-MM-dd. + /// A new instance for mocking. + public static DeltaDetailsRequest DeltaDetailsRequest(DeltaDetailType deltaDetailType = default, int? priorDays = null, GlobalAssetType kind = default, string date = null) + { + return new DeltaDetailsRequest(deltaDetailType, priorDays, kind, date, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Shows the asset kind. + /// Shows the asset name. + /// Shows the date when the asset was originally created. + /// Shows the date when the asset was last updated, usually the date the we trying to pull up the results for. + /// Shows the inventory state. + /// A new instance for mocking. + public static DeltaResult DeltaResult(GlobalAssetType kind = default, string name = null, DateTimeOffset createdAt = default, DateTimeOffset updatedAt = default, GlobalInventoryState state = default) + { + return new DeltaResult( + kind, + name, + createdAt, + updatedAt, + state, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Contains added, removed, and difference values for the whole range either 7 or 30 days. + /// Contains added, removed, count, and difference values for each day. + /// A new instance for mocking. + public static DeltaSummaryResult DeltaSummaryResult(DeltaRangeResult summary = null, IEnumerable daily = null) + { + daily ??= new List(); + + return new DeltaSummaryResult(summary, daily?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The range of dates requested. + /// The total amount of assets removed over a date range. + /// The total amount of assets added over a date range. + /// The total amount of assets changed removed over a date range. + /// A list of summary changes per asset kind. + /// A new instance for mocking. + public static DeltaRangeResult DeltaRangeResult(long range = default, long removed = default, long added = default, long difference = default, IEnumerable kindSummaries = null) + { + kindSummaries ??= new List(); + + return new DeltaRangeResult( + range, + removed, + added, + difference, + kindSummaries?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The kind of asset. + /// The amount of assets removed for one asset kind. + /// The amount of assets added for one asset kind. + /// The amount of assets changed for one asset kind. + /// A new instance for mocking. + public static DeltaTypeResponse DeltaTypeResponse(GlobalAssetType kind = default, long removed = default, long added = default, long difference = default) + { + return new DeltaTypeResponse(kind, removed, added, difference, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The date that is being requested. + /// A list of summary counts per day. + /// A new instance for mocking. + public static DeltaDateResult DeltaDateResult(DateTimeOffset date = default, IEnumerable deltas = null) + { + deltas ??= new List(); + + return new DeltaDateResult(date, deltas?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The kind of asset. + /// The amount of assets removed for one asset kind. + /// The amount of assets added for one asset kind. + /// The amount of assets changed for one asset kind. + /// The current number of assets for one asset kind. + /// A new instance for mocking. + public static DailyDeltaTypeResponse DailyDeltaTypeResponse(GlobalAssetType kind = default, long removed = default, long added = default, long difference = default, long count = default) + { + return new DailyDeltaTypeResponse( + kind, + removed, + added, + difference, + serializedAdditionalRawData: null, + count); + } + /// Initializes a new instance of . /// Discriminator property for DataConnection. - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. /// The caller provided unique name for the resource. /// The name that can be used for display purposes. /// The type of data the data connection will transfer. /// The date the data connection was created. /// The rate at which the data connection will receive updates. - /// The day to update the data connection on. + /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly). /// The date the data connection was last updated. /// The date the data connection was last updated by user. /// An indicator of whether the data connection is active. @@ -2012,13 +2149,13 @@ public static DataConnection DataConnection(string kind = null, string id = null } /// Initializes a new instance of . - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. /// The caller provided unique name for the resource. /// The name that can be used for display purposes. /// The type of data the data connection will transfer. /// The date the data connection was created. /// The rate at which the data connection will receive updates. - /// The day to update the data connection on. + /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly). /// The date the data connection was last updated. /// The date the data connection was last updated by user. /// An indicator of whether the data connection is active. @@ -2045,13 +2182,13 @@ public static LogAnalyticsDataConnection LogAnalyticsDataConnection(string id = } /// Initializes a new instance of . - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. /// The caller provided unique name for the resource. /// The name that can be used for display purposes. /// The type of data the data connection will transfer. /// The date the data connection was created. /// The rate at which the data connection will receive updates. - /// The day to update the data connection on. + /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly). /// The date the data connection was last updated. /// The date the data connection was last updated by user. /// An indicator of whether the data connection is active. @@ -2153,7 +2290,7 @@ public static InnerError InnerError(string code = null, BinaryData value = null) } /// Initializes a new instance of . - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. /// The caller provided unique name for the resource. /// The name that can be used for display purposes. /// The description for a disco group. @@ -2218,6 +2355,47 @@ public static DiscoveryRunResult DiscoveryRunResult(DateTimeOffset? submittedDat serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// A list of asset chain summaries per asset kind. + /// A list of disco group summaries. + /// The list of exceptions. + /// A new instance for mocking. + public static AssetChainSummaryResult AssetChainSummaryResult(IEnumerable affectedAssetsSummary = null, IEnumerable affectedGroupsSummary = null, IEnumerable errors = null) + { + affectedAssetsSummary ??= new List(); + affectedGroupsSummary ??= new List(); + errors ??= new List(); + + return new AssetChainSummaryResult(affectedAssetsSummary?.ToList(), affectedGroupsSummary?.ToList(), errors?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The kind of asset. + /// The amount of assets affected for a given asset kind. + /// A new instance for mocking. + public static AssetChainKindSummaryResult AssetChainKindSummaryResult(AssetKind kind = default, long affectedCount = default) + { + return new AssetChainKindSummaryResult(kind, affectedCount, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// A new instance for mocking. + public static DiscoGroupSummaryResult DiscoGroupSummaryResult(string id = null, string name = null, string displayName = null) + { + return new DiscoGroupSummaryResult(id, name, displayName, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The error object. + /// A new instance for mocking. + public static ErrorResponse ErrorResponse(ResponseError error = null) + { + return new ErrorResponse(error, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The system generated unique id for the resource. /// The caller provided unique name for the resource. @@ -2358,7 +2536,7 @@ public static AssetSummaryResult AssetSummaryResult(string displayName = null, s } /// Initializes a new instance of . - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. /// The caller provided unique name for the resource. /// The name that can be used for display purposes. /// @@ -2374,5 +2552,65 @@ public static SavedFilter SavedFilter(string id = null, string name = null, stri description, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits. + /// The vendor or project name for the vulnerability. + /// The vulnerability product. + /// The name of the vulnerability. + /// A short description of the vulnerability. + /// The required action to address the vulnerability. + /// Any additional notes about the vulnerability. + /// The date the vulnerability was added to the catalog in the format YYYY-MM-DD. + /// The date the required action is due in the format YYYY-MM-DD. + /// The date the vulnerability was updated. + /// The number of assets affected by the vulnerability. + /// A new instance for mocking. + public static CisaCveResult CisaCveResult(string cveId = null, string vendorProject = null, string product = null, string vulnerabilityName = null, string shortDescription = null, string requiredAction = null, string notes = null, DateTimeOffset dateAdded = default, DateTimeOffset dueDate = default, DateTimeOffset updatedAt = default, long count = default) + { + return new CisaCveResult( + cveId, + vendorProject, + product, + vulnerabilityName, + shortDescription, + requiredAction, + notes, + dateAdded, + dueDate, + updatedAt, + count, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// This is typically the same as the name but might be different for different models. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// A human readable description of what the policy should do. + /// Name of the saved filter query to be used to select assets that are to be updated by a given policy. + /// Action specifying what the policy should do. + /// Number of assets in inventory that have been updated by this policy. + /// The unique name of the user that created the policy user@gmail.com. + /// The date this policy was created, in RFC3339 format. + /// The date this policy was last updated, in RFC3339 format. + /// Additional parameters needed to perform the policy action. + /// A new instance for mocking. + public static Policy Policy(string id = null, string name = null, string displayName = null, string description = null, string filterName = null, PolicyAction action = default, long? updatedAssetsCount = null, string user = null, DateTimeOffset? createdDate = null, DateTimeOffset? updatedDate = null, ActionParameters actionParameters = null) + { + return new Policy( + id, + name, + displayName, + description, + filterName, + action, + updatedAssetsCount, + user, + createdDate, + updatedDate, + actionParameters, + serializedAdditionalRawData: null); + } } } diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.Serialization.cs new file mode 100644 index 000000000000..e38a0dd24b9c --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AssetChainKindSummaryResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetChainKindSummaryResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + writer.WritePropertyName("affectedCount"u8); + writer.WriteNumberValue(AffectedCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssetChainKindSummaryResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetChainKindSummaryResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssetChainKindSummaryResult(document.RootElement, options); + } + + internal static AssetChainKindSummaryResult DeserializeAssetChainKindSummaryResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AssetKind kind = default; + long affectedCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = new AssetKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("affectedCount"u8)) + { + affectedCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssetChainKindSummaryResult(kind, affectedCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssetChainKindSummaryResult)} does not support writing '{options.Format}' format."); + } + } + + AssetChainKindSummaryResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAssetChainKindSummaryResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssetChainKindSummaryResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssetChainKindSummaryResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAssetChainKindSummaryResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.cs new file mode 100644 index 000000000000..255ca689194f --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainKindSummaryResult.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.Analytics.Defender.Easm +{ + /// A list of asset chain summaries per asset kind. + public partial class AssetChainKindSummaryResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 kind of asset. + /// The amount of assets affected for a given asset kind. + internal AssetChainKindSummaryResult(AssetKind kind, long affectedCount) + { + Kind = kind; + AffectedCount = affectedCount; + } + + /// Initializes a new instance of . + /// The kind of asset. + /// The amount of assets affected for a given asset kind. + /// Keeps track of any properties unknown to the library. + internal AssetChainKindSummaryResult(AssetKind kind, long affectedCount, IDictionary serializedAdditionalRawData) + { + Kind = kind; + AffectedCount = affectedCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssetChainKindSummaryResult() + { + } + + /// The kind of asset. + public AssetKind Kind { get; } + /// The amount of assets affected for a given asset kind. + public long AffectedCount { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.Serialization.cs new file mode 100644 index 000000000000..b391f514fba1 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AssetChainRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetChainRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("assetChainSource"u8); + writer.WriteStringValue(AssetChainSource.ToString()); + writer.WritePropertyName("sourceIds"u8); + writer.WriteStartArray(); + foreach (var item in SourceIds) + { + 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 + } + } + } + + AssetChainRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetChainRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssetChainRequest(document.RootElement, options); + } + + internal static AssetChainRequest DeserializeAssetChainRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AssetChainSource assetChainSource = default; + IList sourceIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assetChainSource"u8)) + { + assetChainSource = new AssetChainSource(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceIds"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sourceIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssetChainRequest(assetChainSource, sourceIds, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssetChainRequest)} does not support writing '{options.Format}' format."); + } + } + + AssetChainRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAssetChainRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssetChainRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssetChainRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAssetChainRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.cs new file mode 100644 index 000000000000..31ae0976c45c --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainRequest.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.Analytics.Defender.Easm +{ + /// AssetChainRequest containing information needed for the retrieval of the asset chain summary. + public partial class AssetChainRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Asset chain source. + /// A collection of asset chain source ids. + /// is null. + public AssetChainRequest(AssetChainSource assetChainSource, IEnumerable sourceIds) + { + Argument.AssertNotNull(sourceIds, nameof(sourceIds)); + + AssetChainSource = assetChainSource; + SourceIds = sourceIds.ToList(); + } + + /// Initializes a new instance of . + /// Asset chain source. + /// A collection of asset chain source ids. + /// Keeps track of any properties unknown to the library. + internal AssetChainRequest(AssetChainSource assetChainSource, IList sourceIds, IDictionary serializedAdditionalRawData) + { + AssetChainSource = assetChainSource; + SourceIds = sourceIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssetChainRequest() + { + } + + /// Asset chain source. + public AssetChainSource AssetChainSource { get; } + /// A collection of asset chain source ids. + public IList SourceIds { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSource.cs new file mode 100644 index 000000000000..0ef98b3e3b64 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSource.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.Analytics.Defender.Easm +{ + /// A list of asset chain sources. + public readonly partial struct AssetChainSource : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssetChainSource(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DISCOGROUPValue = "DISCO_GROUP"; + private const string ASSETValue = "ASSET"; + + /// discovery group. + public static AssetChainSource DISCOGROUP { get; } = new AssetChainSource(DISCOGROUPValue); + /// asset. + public static AssetChainSource ASSET { get; } = new AssetChainSource(ASSETValue); + /// Determines if two values are the same. + public static bool operator ==(AssetChainSource left, AssetChainSource right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssetChainSource left, AssetChainSource right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssetChainSource(string value) => new AssetChainSource(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssetChainSource other && Equals(other); + /// + public bool Equals(AssetChainSource 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/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.Serialization.cs new file mode 100644 index 000000000000..404346d78b1b --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.Serialization.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AssetChainSummaryResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetChainSummaryResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("affectedAssetsSummary"u8); + writer.WriteStartArray(); + foreach (var item in AffectedAssetsSummary) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("affectedGroupsSummary"u8); + writer.WriteStartArray(); + foreach (var item in AffectedGroupsSummary) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + 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 + } + } + } + + AssetChainSummaryResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetChainSummaryResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssetChainSummaryResult(document.RootElement, options); + } + + internal static AssetChainSummaryResult DeserializeAssetChainSummaryResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList affectedAssetsSummary = default; + IReadOnlyList affectedGroupsSummary = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("affectedAssetsSummary"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssetChainKindSummaryResult.DeserializeAssetChainKindSummaryResult(item, options)); + } + affectedAssetsSummary = array; + continue; + } + if (property.NameEquals("affectedGroupsSummary"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiscoGroupSummaryResult.DeserializeDiscoGroupSummaryResult(item, options)); + } + affectedGroupsSummary = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ErrorResponse.DeserializeErrorResponse(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssetChainSummaryResult(affectedAssetsSummary, affectedGroupsSummary, errors ?? 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(AssetChainSummaryResult)} does not support writing '{options.Format}' format."); + } + } + + AssetChainSummaryResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAssetChainSummaryResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssetChainSummaryResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssetChainSummaryResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAssetChainSummaryResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.cs new file mode 100644 index 000000000000..b97b8cdb4826 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetChainSummaryResult.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 System.Linq; + +namespace Azure.Analytics.Defender.Easm +{ + /// Response for the asset chain summary. + public partial class AssetChainSummaryResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// A list of asset chain summaries per asset kind. + /// A list of disco group summaries. + /// or is null. + internal AssetChainSummaryResult(IEnumerable affectedAssetsSummary, IEnumerable affectedGroupsSummary) + { + Argument.AssertNotNull(affectedAssetsSummary, nameof(affectedAssetsSummary)); + Argument.AssertNotNull(affectedGroupsSummary, nameof(affectedGroupsSummary)); + + AffectedAssetsSummary = affectedAssetsSummary.ToList(); + AffectedGroupsSummary = affectedGroupsSummary.ToList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// A list of asset chain summaries per asset kind. + /// A list of disco group summaries. + /// The list of exceptions. + /// Keeps track of any properties unknown to the library. + internal AssetChainSummaryResult(IReadOnlyList affectedAssetsSummary, IReadOnlyList affectedGroupsSummary, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + AffectedAssetsSummary = affectedAssetsSummary; + AffectedGroupsSummary = affectedGroupsSummary; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssetChainSummaryResult() + { + } + + /// A list of asset chain summaries per asset kind. + public IReadOnlyList AffectedAssetsSummary { get; } + /// A list of disco group summaries. + public IReadOnlyList AffectedGroupsSummary { get; } + /// The list of exceptions. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetKind.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetKind.cs new file mode 100644 index 000000000000..92da5b5a4e53 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetKind.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + /// The kind of asset. + public readonly partial struct AssetKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssetKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AsValue = "as"; + private const string ContactValue = "contact"; + private const string DomainValue = "domain"; + private const string HostValue = "host"; + private const string IpAddressValue = "ipAddress"; + private const string IpBlockValue = "ipBlock"; + private const string PageValue = "page"; + private const string SslCertValue = "sslCert"; + + /// as. + public static AssetKind As { get; } = new AssetKind(AsValue); + /// contact. + public static AssetKind Contact { get; } = new AssetKind(ContactValue); + /// domain. + public static AssetKind Domain { get; } = new AssetKind(DomainValue); + /// host. + public static AssetKind Host { get; } = new AssetKind(HostValue); + /// ipAddress. + public static AssetKind IpAddress { get; } = new AssetKind(IpAddressValue); + /// ipBlock. + public static AssetKind IpBlock { get; } = new AssetKind(IpBlockValue); + /// page. + public static AssetKind Page { get; } = new AssetKind(PageValue); + /// sslCert. + public static AssetKind SslCert { get; } = new AssetKind(SslCertValue); + /// Determines if two values are the same. + public static bool operator ==(AssetKind left, AssetKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssetKind left, AssetKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssetKind(string value) => new AssetKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssetKind other && Equals(other); + /// + public bool Equals(AssetKind 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/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResponseType.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResponseType.cs new file mode 100644 index 000000000000..ff23400e2008 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResponseType.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.Analytics.Defender.Easm +{ + /// A list of asset response type. + public readonly partial struct AssetResponseType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssetResponseType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string IdValue = "id"; + private const string StandardValue = "standard"; + private const string FullValue = "full"; + private const string ReducedValue = "reduced"; + + /// Return only the asset id. + public static AssetResponseType Id { get; } = new AssetResponseType(IdValue); + /// Return the standard set of asset fields. + public static AssetResponseType Standard { get; } = new AssetResponseType(StandardValue); + /// Return the full set of asset fields. + public static AssetResponseType Full { get; } = new AssetResponseType(FullValue); + /// Return a reduced set of fields. + public static AssetResponseType Reduced { get; } = new AssetResponseType(ReducedValue); + /// Determines if two values are the same. + public static bool operator ==(AssetResponseType left, AssetResponseType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssetResponseType left, AssetResponseType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssetResponseType(string value) => new AssetResponseType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssetResponseType other && Equals(other); + /// + public bool Equals(AssetResponseType 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/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.Serialization.cs index 4643f109bb1d..4e718a8af96d 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.Serialization.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.Serialization.cs @@ -60,6 +60,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("transfers"u8); writer.WriteStringValue(Transfers.Value.ToString()); } + if (Optional.IsCollectionDefined(Remediations)) + { + writer.WritePropertyName("remediations"u8); + writer.WriteStartArray(); + foreach (var item in Remediations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,6 +111,7 @@ internal static AssetUpdatePayload DeserializeAssetUpdatePayload(JsonElement ele string externalId = default; IDictionary labels = default; AssetUpdateTransfers? transfers = default; + IList remediations = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -142,13 +153,33 @@ internal static AssetUpdatePayload DeserializeAssetUpdatePayload(JsonElement ele transfers = new AssetUpdateTransfers(property.Value.GetString()); continue; } + if (property.NameEquals("remediations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservationRemediationItem.DeserializeObservationRemediationItem(item, options)); + } + remediations = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new AssetUpdatePayload(state, externalId, labels ?? new ChangeTrackingDictionary(), transfers, serializedAdditionalRawData); + return new AssetUpdatePayload( + state, + externalId, + labels ?? new ChangeTrackingDictionary(), + transfers, + remediations ?? new ChangeTrackingList(), + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.cs index fd1c4c850a68..8139a5faf306 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdatePayload.cs @@ -49,6 +49,7 @@ public partial class AssetUpdatePayload public AssetUpdatePayload() { Labels = new ChangeTrackingDictionary(); + Remediations = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -56,13 +57,15 @@ public AssetUpdatePayload() /// A string which can be used to identify the asset in external systems. /// Any Labels to update the asset with. /// A list of asset types to cascade the updates to. + /// A list of observation remediations to apply to the asset. /// Keeps track of any properties unknown to the library. - internal AssetUpdatePayload(AssetUpdateState? state, string externalId, IDictionary labels, AssetUpdateTransfers? transfers, IDictionary serializedAdditionalRawData) + internal AssetUpdatePayload(AssetUpdateState? state, string externalId, IDictionary labels, AssetUpdateTransfers? transfers, IList remediations, IDictionary serializedAdditionalRawData) { State = state; ExternalId = externalId; Labels = labels; Transfers = transfers; + Remediations = remediations; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -74,5 +77,7 @@ internal AssetUpdatePayload(AssetUpdateState? state, string externalId, IDiction public IDictionary Labels { get; } /// A list of asset types to cascade the updates to. public AssetUpdateTransfers? Transfers { get; set; } + /// A list of observation remediations to apply to the asset. + public IList Remediations { get; } } } diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.Serialization.cs new file mode 100644 index 000000000000..04f83f745eb1 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AssetsExportRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetsExportRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("fileName"u8); + writer.WriteStringValue(FileName); + writer.WritePropertyName("columns"u8); + writer.WriteStartArray(); + foreach (var item in Columns) + { + 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 + } + } + } + + AssetsExportRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssetsExportRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssetsExportRequest(document.RootElement, options); + } + + internal static AssetsExportRequest DeserializeAssetsExportRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string fileName = default; + IList columns = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fileName"u8)) + { + fileName = property.Value.GetString(); + continue; + } + if (property.NameEquals("columns"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + columns = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssetsExportRequest(fileName, columns, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssetsExportRequest)} does not support writing '{options.Format}' format."); + } + } + + AssetsExportRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAssetsExportRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssetsExportRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssetsExportRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAssetsExportRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.cs new file mode 100644 index 000000000000..a32f3acef2e9 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetsExportRequest.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 System.Linq; + +namespace Azure.Analytics.Defender.Easm +{ + /// A request body used to export an asset. + public partial class AssetsExportRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 file to export. + /// The columns to export. + /// or is null. + public AssetsExportRequest(string fileName, IEnumerable columns) + { + Argument.AssertNotNull(fileName, nameof(fileName)); + Argument.AssertNotNull(columns, nameof(columns)); + + FileName = fileName; + Columns = columns.ToList(); + } + + /// Initializes a new instance of . + /// The name of the file to export. + /// The columns to export. + /// Keeps track of any properties unknown to the library. + internal AssetsExportRequest(string fileName, IList columns, IDictionary serializedAdditionalRawData) + { + FileName = fileName; + Columns = columns; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssetsExportRequest() + { + } + + /// The name of the file to export. + public string FileName { get; } + /// The columns to export. + public IList Columns { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.cs index b4269bc0fb74..556300c2ad74 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.cs @@ -51,7 +51,7 @@ internal AuditTrailItem() } /// Initializes a new instance of . - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. /// The caller provided unique name for the resource. /// The name that can be used for display purposes. /// The kind of asset. @@ -67,7 +67,7 @@ internal AuditTrailItem(string id, string name, string displayName, AuditTrailIt _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. public string Id { get; } /// The caller provided unique name for the resource. public string Name { get; } diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.cs index 690b1b97f475..2204e266508c 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.cs @@ -26,13 +26,13 @@ internal AzureDataExplorerDataConnection(AzureDataExplorerDataConnectionProperti /// Initializes a new instance of . /// Discriminator property for DataConnection. - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. /// The caller provided unique name for the resource. /// The name that can be used for display purposes. /// The type of data the data connection will transfer. /// The date the data connection was created. /// The rate at which the data connection will receive updates. - /// The day to update the data connection on. + /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly). /// The date the data connection was last updated. /// The date the data connection was last updated by user. /// An indicator of whether the data connection is active. diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionPayload.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionPayload.cs index b98a0f227ee5..10d82d783d74 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionPayload.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionPayload.cs @@ -25,7 +25,7 @@ public AzureDataExplorerDataConnectionPayload(AzureDataExplorerDataConnectionPro } /// Initializes a new instance of . - /// Discriminator property for DataConnectionPayload. + /// Discriminator property for DataConnectionData. /// The name of data connection. /// The type of data the data connection will transfer. /// The rate at which the data connection will receive updates. diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.Serialization.cs new file mode 100644 index 000000000000..4c674dcf3404 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.Serialization.cs @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class CisaCveResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CisaCveResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("cveId"u8); + writer.WriteStringValue(CveId); + } + writer.WritePropertyName("vendorProject"u8); + writer.WriteStringValue(VendorProject); + writer.WritePropertyName("product"u8); + writer.WriteStringValue(Product); + writer.WritePropertyName("vulnerabilityName"u8); + writer.WriteStringValue(VulnerabilityName); + writer.WritePropertyName("shortDescription"u8); + writer.WriteStringValue(ShortDescription); + writer.WritePropertyName("requiredAction"u8); + writer.WriteStringValue(RequiredAction); + writer.WritePropertyName("notes"u8); + writer.WriteStringValue(Notes); + writer.WritePropertyName("dateAdded"u8); + writer.WriteStringValue(DateAdded, "O"); + writer.WritePropertyName("dueDate"u8); + writer.WriteStringValue(DueDate, "O"); + writer.WritePropertyName("updatedAt"u8); + writer.WriteStringValue(UpdatedAt, "O"); + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CisaCveResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CisaCveResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCisaCveResult(document.RootElement, options); + } + + internal static CisaCveResult DeserializeCisaCveResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string cveId = default; + string vendorProject = default; + string product = default; + string vulnerabilityName = default; + string shortDescription = default; + string requiredAction = default; + string notes = default; + DateTimeOffset dateAdded = default; + DateTimeOffset dueDate = default; + DateTimeOffset updatedAt = default; + long count = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("cveId"u8)) + { + cveId = property.Value.GetString(); + continue; + } + if (property.NameEquals("vendorProject"u8)) + { + vendorProject = property.Value.GetString(); + continue; + } + if (property.NameEquals("product"u8)) + { + product = property.Value.GetString(); + continue; + } + if (property.NameEquals("vulnerabilityName"u8)) + { + vulnerabilityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("shortDescription"u8)) + { + shortDescription = property.Value.GetString(); + continue; + } + if (property.NameEquals("requiredAction"u8)) + { + requiredAction = property.Value.GetString(); + continue; + } + if (property.NameEquals("notes"u8)) + { + notes = property.Value.GetString(); + continue; + } + if (property.NameEquals("dateAdded"u8)) + { + dateAdded = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("dueDate"u8)) + { + dueDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedAt"u8)) + { + updatedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + count = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CisaCveResult( + cveId, + vendorProject, + product, + vulnerabilityName, + shortDescription, + requiredAction, + notes, + dateAdded, + dueDate, + updatedAt, + count, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CisaCveResult)} does not support writing '{options.Format}' format."); + } + } + + CisaCveResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCisaCveResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CisaCveResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CisaCveResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCisaCveResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.cs new file mode 100644 index 000000000000..b232b946b07f --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/CisaCveResult.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Analytics.Defender.Easm +{ + /// cisa cve in a given workspace. + public partial class CisaCveResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 vendor or project name for the vulnerability. + /// The vulnerability product. + /// The name of the vulnerability. + /// A short description of the vulnerability. + /// The required action to address the vulnerability. + /// Any additional notes about the vulnerability. + /// The date the vulnerability was added to the catalog in the format YYYY-MM-DD. + /// The date the required action is due in the format YYYY-MM-DD. + /// The date the vulnerability was updated. + /// The number of assets affected by the vulnerability. + /// , , , , or is null. + internal CisaCveResult(string vendorProject, string product, string vulnerabilityName, string shortDescription, string requiredAction, string notes, DateTimeOffset dateAdded, DateTimeOffset dueDate, DateTimeOffset updatedAt, long count) + { + Argument.AssertNotNull(vendorProject, nameof(vendorProject)); + Argument.AssertNotNull(product, nameof(product)); + Argument.AssertNotNull(vulnerabilityName, nameof(vulnerabilityName)); + Argument.AssertNotNull(shortDescription, nameof(shortDescription)); + Argument.AssertNotNull(requiredAction, nameof(requiredAction)); + Argument.AssertNotNull(notes, nameof(notes)); + + VendorProject = vendorProject; + Product = product; + VulnerabilityName = vulnerabilityName; + ShortDescription = shortDescription; + RequiredAction = requiredAction; + Notes = notes; + DateAdded = dateAdded; + DueDate = dueDate; + UpdatedAt = updatedAt; + Count = count; + } + + /// Initializes a new instance of . + /// The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits. + /// The vendor or project name for the vulnerability. + /// The vulnerability product. + /// The name of the vulnerability. + /// A short description of the vulnerability. + /// The required action to address the vulnerability. + /// Any additional notes about the vulnerability. + /// The date the vulnerability was added to the catalog in the format YYYY-MM-DD. + /// The date the required action is due in the format YYYY-MM-DD. + /// The date the vulnerability was updated. + /// The number of assets affected by the vulnerability. + /// Keeps track of any properties unknown to the library. + internal CisaCveResult(string cveId, string vendorProject, string product, string vulnerabilityName, string shortDescription, string requiredAction, string notes, DateTimeOffset dateAdded, DateTimeOffset dueDate, DateTimeOffset updatedAt, long count, IDictionary serializedAdditionalRawData) + { + CveId = cveId; + VendorProject = vendorProject; + Product = product; + VulnerabilityName = vulnerabilityName; + ShortDescription = shortDescription; + RequiredAction = requiredAction; + Notes = notes; + DateAdded = dateAdded; + DueDate = dueDate; + UpdatedAt = updatedAt; + Count = count; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CisaCveResult() + { + } + + /// The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits. + public string CveId { get; } + /// The vendor or project name for the vulnerability. + public string VendorProject { get; } + /// The vulnerability product. + public string Product { get; } + /// The name of the vulnerability. + public string VulnerabilityName { get; } + /// A short description of the vulnerability. + public string ShortDescription { get; } + /// The required action to address the vulnerability. + public string RequiredAction { get; } + /// Any additional notes about the vulnerability. + public string Notes { get; } + /// The date the vulnerability was added to the catalog in the format YYYY-MM-DD. + public DateTimeOffset DateAdded { get; } + /// The date the required action is due in the format YYYY-MM-DD. + public DateTimeOffset DueDate { get; } + /// The date the vulnerability was updated. + public DateTimeOffset UpdatedAt { get; } + /// The number of assets affected by the vulnerability. + public long Count { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.Serialization.cs new file mode 100644 index 000000000000..951840724529 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.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.Analytics.Defender.Easm +{ + public partial class DailyDeltaTypeResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DailyDeltaTypeResponse)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count); + } + + DailyDeltaTypeResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DailyDeltaTypeResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDailyDeltaTypeResponse(document.RootElement, options); + } + + internal static DailyDeltaTypeResponse DeserializeDailyDeltaTypeResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long count = default; + GlobalAssetType kind = default; + long removed = default; + long added = default; + long difference = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("count"u8)) + { + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new GlobalAssetType(property.Value.GetString()); + continue; + } + if (property.NameEquals("removed"u8)) + { + removed = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("added"u8)) + { + added = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("difference"u8)) + { + difference = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DailyDeltaTypeResponse( + kind, + removed, + added, + difference, + serializedAdditionalRawData, + count); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DailyDeltaTypeResponse)} does not support writing '{options.Format}' format."); + } + } + + DailyDeltaTypeResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDailyDeltaTypeResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DailyDeltaTypeResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new DailyDeltaTypeResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDailyDeltaTypeResponse(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.cs new file mode 100644 index 000000000000..bf7813c7e4e5 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DailyDeltaTypeResponse.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.Analytics.Defender.Easm +{ + /// Delta response for each day. + public partial class DailyDeltaTypeResponse : DeltaTypeResponse + { + /// Initializes a new instance of . + /// The kind of asset. + /// The amount of assets removed for one asset kind. + /// The amount of assets added for one asset kind. + /// The amount of assets changed for one asset kind. + /// The current number of assets for one asset kind. + internal DailyDeltaTypeResponse(GlobalAssetType kind, long removed, long added, long difference, long count) : base(kind, removed, added, difference) + { + Count = count; + } + + /// Initializes a new instance of . + /// The kind of asset. + /// The amount of assets removed for one asset kind. + /// The amount of assets added for one asset kind. + /// The amount of assets changed for one asset kind. + /// Keeps track of any properties unknown to the library. + /// The current number of assets for one asset kind. + internal DailyDeltaTypeResponse(GlobalAssetType kind, long removed, long added, long difference, IDictionary serializedAdditionalRawData, long count) : base(kind, removed, added, difference, serializedAdditionalRawData) + { + Count = count; + } + + /// Initializes a new instance of for deserialization. + internal DailyDeltaTypeResponse() + { + } + + /// The current number of assets for one asset kind. + public long Count { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.cs index f5cd01907046..eea63fcd0e7c 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.cs @@ -56,13 +56,13 @@ protected DataConnection() /// Initializes a new instance of . /// Discriminator property for DataConnection. - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. /// The caller provided unique name for the resource. /// The name that can be used for display purposes. /// The type of data the data connection will transfer. /// The date the data connection was created. /// The rate at which the data connection will receive updates. - /// The day to update the data connection on. + /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly). /// The date the data connection was last updated. /// The date the data connection was last updated by user. /// An indicator of whether the data connection is active. @@ -87,7 +87,7 @@ internal DataConnection(string kind, string id, string name, string displayName, /// Discriminator property for DataConnection. internal string Kind { get; set; } - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. public string Id { get; } /// The caller provided unique name for the resource. public string Name { get; } @@ -99,7 +99,7 @@ internal DataConnection(string kind, string id, string name, string displayName, public DateTimeOffset? CreatedDate { get; } /// The rate at which the data connection will receive updates. public DataConnectionFrequency? Frequency { get; } - /// The day to update the data connection on. + /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly). public int? FrequencyOffset { get; } /// The date the data connection was last updated. public DateTimeOffset? UpdatedDate { get; } diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionPayload.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionPayload.cs index a10e83a8ee34..d059fceb8aa5 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionPayload.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionPayload.cs @@ -55,7 +55,7 @@ protected DataConnectionPayload() } /// Initializes a new instance of . - /// Discriminator property for DataConnectionPayload. + /// Discriminator property for DataConnectionData. /// The name of data connection. /// The type of data the data connection will transfer. /// The rate at which the data connection will receive updates. @@ -71,7 +71,7 @@ internal DataConnectionPayload(string kind, string name, DataConnectionContent? _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Discriminator property for DataConnectionPayload. + /// Discriminator property for DataConnectionData. internal string Kind { get; set; } /// The name of data connection. public string Name { get; set; } diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.Serialization.cs new file mode 100644 index 000000000000..7a373307e991 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class DeltaDateResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaDateResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("date"u8); + writer.WriteStringValue(Date, "O"); + writer.WritePropertyName("deltas"u8); + writer.WriteStartArray(); + foreach (var item in Deltas) + { + 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 + } + } + } + + DeltaDateResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaDateResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeltaDateResult(document.RootElement, options); + } + + internal static DeltaDateResult DeserializeDeltaDateResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset date = default; + IReadOnlyList deltas = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("date"u8)) + { + date = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("deltas"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DailyDeltaTypeResponse.DeserializeDailyDeltaTypeResponse(item, options)); + } + deltas = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeltaDateResult(date, deltas, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeltaDateResult)} does not support writing '{options.Format}' format."); + } + } + + DeltaDateResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeltaDateResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeltaDateResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeltaDateResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeltaDateResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.cs new file mode 100644 index 000000000000..ee5af7f2ec93 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDateResult.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.Analytics.Defender.Easm +{ + /// Date information for the delta response. + public partial class DeltaDateResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 date that is being requested. + /// A list of summary counts per day. + /// is null. + internal DeltaDateResult(DateTimeOffset date, IEnumerable deltas) + { + Argument.AssertNotNull(deltas, nameof(deltas)); + + Date = date; + Deltas = deltas.ToList(); + } + + /// Initializes a new instance of . + /// The date that is being requested. + /// A list of summary counts per day. + /// Keeps track of any properties unknown to the library. + internal DeltaDateResult(DateTimeOffset date, IReadOnlyList deltas, IDictionary serializedAdditionalRawData) + { + Date = date; + Deltas = deltas; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeltaDateResult() + { + } + + /// The date that is being requested. + public DateTimeOffset Date { get; } + /// A list of summary counts per day. + public IReadOnlyList Deltas { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailType.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailType.cs new file mode 100644 index 000000000000..d2d8937f1c8c --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailType.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.Analytics.Defender.Easm +{ + /// A list of delta detail type. + public readonly partial struct DeltaDetailType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DeltaDetailType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AddedValue = "added"; + private const string RemovedValue = "removed"; + + /// added. + public static DeltaDetailType Added { get; } = new DeltaDetailType(AddedValue); + /// removed. + public static DeltaDetailType Removed { get; } = new DeltaDetailType(RemovedValue); + /// Determines if two values are the same. + public static bool operator ==(DeltaDetailType left, DeltaDetailType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DeltaDetailType left, DeltaDetailType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DeltaDetailType(string value) => new DeltaDetailType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DeltaDetailType other && Equals(other); + /// + public bool Equals(DeltaDetailType 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/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.Serialization.cs new file mode 100644 index 000000000000..95291a3cc248 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.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.Analytics.Defender.Easm +{ + public partial class DeltaDetailsRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaDetailsRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("deltaDetailType"u8); + writer.WriteStringValue(DeltaDetailType.ToString()); + if (Optional.IsDefined(PriorDays)) + { + writer.WritePropertyName("priorDays"u8); + writer.WriteNumberValue(PriorDays.Value); + } + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + if (Optional.IsDefined(Date)) + { + writer.WritePropertyName("date"u8); + writer.WriteStringValue(Date); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeltaDetailsRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaDetailsRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeltaDetailsRequest(document.RootElement, options); + } + + internal static DeltaDetailsRequest DeserializeDeltaDetailsRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DeltaDetailType deltaDetailType = default; + int? priorDays = default; + GlobalAssetType kind = default; + string date = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deltaDetailType"u8)) + { + deltaDetailType = new DeltaDetailType(property.Value.GetString()); + continue; + } + if (property.NameEquals("priorDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priorDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = new GlobalAssetType(property.Value.GetString()); + continue; + } + if (property.NameEquals("date"u8)) + { + date = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeltaDetailsRequest(deltaDetailType, priorDays, kind, date, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeltaDetailsRequest)} does not support writing '{options.Format}' format."); + } + } + + DeltaDetailsRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeltaDetailsRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeltaDetailsRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeltaDetailsRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeltaDetailsRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.cs new file mode 100644 index 000000000000..42095a187362 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaDetailsRequest.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.Analytics.Defender.Easm +{ + /// A request body used to retrieve a list of deltas. + public partial class DeltaDetailsRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 delta detail to retrieve. + /// The type of asset. + public DeltaDetailsRequest(DeltaDetailType deltaDetailType, GlobalAssetType kind) + { + DeltaDetailType = deltaDetailType; + Kind = kind; + } + + /// Initializes a new instance of . + /// The type of delta detail to retrieve. + /// The number of days prior to retrieve deltas for. + /// The type of asset. + /// expected format to be: yyyy-MM-dd. + /// Keeps track of any properties unknown to the library. + internal DeltaDetailsRequest(DeltaDetailType deltaDetailType, int? priorDays, GlobalAssetType kind, string date, IDictionary serializedAdditionalRawData) + { + DeltaDetailType = deltaDetailType; + PriorDays = priorDays; + Kind = kind; + Date = date; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeltaDetailsRequest() + { + } + + /// The type of delta detail to retrieve. + public DeltaDetailType DeltaDetailType { get; } + /// The number of days prior to retrieve deltas for. + public int? PriorDays { get; set; } + /// The type of asset. + public GlobalAssetType Kind { get; } + /// expected format to be: yyyy-MM-dd. + public string Date { get; set; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.Serialization.cs new file mode 100644 index 000000000000..06cedf906e53 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.Serialization.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class DeltaRangeResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaRangeResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("range"u8); + writer.WriteNumberValue(Range); + writer.WritePropertyName("removed"u8); + writer.WriteNumberValue(Removed); + writer.WritePropertyName("added"u8); + writer.WriteNumberValue(Added); + writer.WritePropertyName("difference"u8); + writer.WriteNumberValue(Difference); + writer.WritePropertyName("kindSummaries"u8); + writer.WriteStartArray(); + foreach (var item in KindSummaries) + { + 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 + } + } + } + + DeltaRangeResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaRangeResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeltaRangeResult(document.RootElement, options); + } + + internal static DeltaRangeResult DeserializeDeltaRangeResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long range = default; + long removed = default; + long added = default; + long difference = default; + IReadOnlyList kindSummaries = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("range"u8)) + { + range = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("removed"u8)) + { + removed = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("added"u8)) + { + added = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("difference"u8)) + { + difference = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("kindSummaries"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeltaTypeResponse.DeserializeDeltaTypeResponse(item, options)); + } + kindSummaries = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeltaRangeResult( + range, + removed, + added, + difference, + kindSummaries, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeltaRangeResult)} does not support writing '{options.Format}' format."); + } + } + + DeltaRangeResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeltaRangeResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeltaRangeResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeltaRangeResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeltaRangeResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.cs new file mode 100644 index 000000000000..2a64af73cbc1 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaRangeResult.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Analytics.Defender.Easm +{ + /// Contains added, removed, and difference values for the whole range either 7 or 30 days. + public partial class DeltaRangeResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 range of dates requested. + /// The total amount of assets removed over a date range. + /// The total amount of assets added over a date range. + /// The total amount of assets changed removed over a date range. + /// A list of summary changes per asset kind. + /// is null. + internal DeltaRangeResult(long range, long removed, long added, long difference, IEnumerable kindSummaries) + { + Argument.AssertNotNull(kindSummaries, nameof(kindSummaries)); + + Range = range; + Removed = removed; + Added = added; + Difference = difference; + KindSummaries = kindSummaries.ToList(); + } + + /// Initializes a new instance of . + /// The range of dates requested. + /// The total amount of assets removed over a date range. + /// The total amount of assets added over a date range. + /// The total amount of assets changed removed over a date range. + /// A list of summary changes per asset kind. + /// Keeps track of any properties unknown to the library. + internal DeltaRangeResult(long range, long removed, long added, long difference, IReadOnlyList kindSummaries, IDictionary serializedAdditionalRawData) + { + Range = range; + Removed = removed; + Added = added; + Difference = difference; + KindSummaries = kindSummaries; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeltaRangeResult() + { + } + + /// The range of dates requested. + public long Range { get; } + /// The total amount of assets removed over a date range. + public long Removed { get; } + /// The total amount of assets added over a date range. + public long Added { get; } + /// The total amount of assets changed removed over a date range. + public long Difference { get; } + /// A list of summary changes per asset kind. + public IReadOnlyList KindSummaries { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.Serialization.cs new file mode 100644 index 000000000000..3ed8ba85f496 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.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.Analytics.Defender.Easm +{ + public partial class DeltaResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt, "O"); + writer.WritePropertyName("updatedAt"u8); + writer.WriteStringValue(UpdatedAt, "O"); + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.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 + } + } + } + + DeltaResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeltaResult(document.RootElement, options); + } + + internal static DeltaResult DeserializeDeltaResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + GlobalAssetType kind = default; + string name = default; + DateTimeOffset createdAt = default; + DateTimeOffset updatedAt = default; + GlobalInventoryState state = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = new GlobalAssetType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedAt"u8)) + { + updatedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + state = new GlobalInventoryState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeltaResult( + kind, + name, + createdAt, + updatedAt, + state, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeltaResult)} does not support writing '{options.Format}' format."); + } + } + + DeltaResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeltaResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeltaResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeltaResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeltaResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.cs new file mode 100644 index 000000000000..574e2526e978 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaResult.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Analytics.Defender.Easm +{ + /// Result for each of the delta detail response. + public partial class DeltaResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Shows the asset kind. + /// Shows the asset name. + /// Shows the date when the asset was originally created. + /// Shows the date when the asset was last updated, usually the date the we trying to pull up the results for. + /// Shows the inventory state. + /// is null. + internal DeltaResult(GlobalAssetType kind, string name, DateTimeOffset createdAt, DateTimeOffset updatedAt, GlobalInventoryState state) + { + Argument.AssertNotNull(name, nameof(name)); + + Kind = kind; + Name = name; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + State = state; + } + + /// Initializes a new instance of . + /// Shows the asset kind. + /// Shows the asset name. + /// Shows the date when the asset was originally created. + /// Shows the date when the asset was last updated, usually the date the we trying to pull up the results for. + /// Shows the inventory state. + /// Keeps track of any properties unknown to the library. + internal DeltaResult(GlobalAssetType kind, string name, DateTimeOffset createdAt, DateTimeOffset updatedAt, GlobalInventoryState state, IDictionary serializedAdditionalRawData) + { + Kind = kind; + Name = name; + CreatedAt = createdAt; + UpdatedAt = updatedAt; + State = state; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeltaResult() + { + } + + /// Shows the asset kind. + public GlobalAssetType Kind { get; } + /// Shows the asset name. + public string Name { get; } + /// Shows the date when the asset was originally created. + public DateTimeOffset CreatedAt { get; } + /// Shows the date when the asset was last updated, usually the date the we trying to pull up the results for. + public DateTimeOffset UpdatedAt { get; } + /// Shows the inventory state. + public GlobalInventoryState State { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryRequest.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryRequest.Serialization.cs new file mode 100644 index 000000000000..25eed8ca86a5 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryRequest.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class DeltaSummaryRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaSummaryRequest)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PriorDays)) + { + writer.WritePropertyName("priorDays"u8); + writer.WriteNumberValue(PriorDays.Value); + } + if (Optional.IsDefined(Date)) + { + writer.WritePropertyName("date"u8); + writer.WriteStringValue(Date); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeltaSummaryRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaSummaryRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeltaSummaryRequest(document.RootElement, options); + } + + internal static DeltaSummaryRequest DeserializeDeltaSummaryRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? priorDays = default; + string date = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("priorDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priorDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("date"u8)) + { + date = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeltaSummaryRequest(priorDays, date, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeltaSummaryRequest)} does not support writing '{options.Format}' format."); + } + } + + DeltaSummaryRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeltaSummaryRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeltaSummaryRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeltaSummaryRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeltaSummaryRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryRequest.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryRequest.cs new file mode 100644 index 000000000000..b28a577ccb9c --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryRequest.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.Analytics.Defender.Easm +{ + /// A request body used to retrieve a delta summary. + public partial class DeltaSummaryRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DeltaSummaryRequest() + { + } + + /// Initializes a new instance of . + /// The number of days prior to retrieve deltas for. + /// expected format to be: yyyy-MM-dd. + /// Keeps track of any properties unknown to the library. + internal DeltaSummaryRequest(int? priorDays, string date, IDictionary serializedAdditionalRawData) + { + PriorDays = priorDays; + Date = date; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The number of days prior to retrieve deltas for. + public int? PriorDays { get; set; } + /// expected format to be: yyyy-MM-dd. + public string Date { get; set; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryResult.Serialization.cs new file mode 100644 index 000000000000..d6f17ee02d55 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryResult.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class DeltaSummaryResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaSummaryResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("summary"u8); + writer.WriteObjectValue(Summary, options); + writer.WritePropertyName("daily"u8); + writer.WriteStartArray(); + foreach (var item in Daily) + { + 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 + } + } + } + + DeltaSummaryResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaSummaryResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeltaSummaryResult(document.RootElement, options); + } + + internal static DeltaSummaryResult DeserializeDeltaSummaryResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DeltaRangeResult summary = default; + IReadOnlyList daily = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("summary"u8)) + { + summary = DeltaRangeResult.DeserializeDeltaRangeResult(property.Value, options); + continue; + } + if (property.NameEquals("daily"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeltaDateResult.DeserializeDeltaDateResult(item, options)); + } + daily = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeltaSummaryResult(summary, daily, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeltaSummaryResult)} does not support writing '{options.Format}' format."); + } + } + + DeltaSummaryResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeltaSummaryResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeltaSummaryResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeltaSummaryResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeltaSummaryResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryResult.cs new file mode 100644 index 000000000000..659416679db8 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaSummaryResult.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 System.Linq; + +namespace Azure.Analytics.Defender.Easm +{ + /// Define response body for getting delta summary. + public partial class DeltaSummaryResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Contains added, removed, and difference values for the whole range either 7 or 30 days. + /// Contains added, removed, count, and difference values for each day. + /// or is null. + internal DeltaSummaryResult(DeltaRangeResult summary, IEnumerable daily) + { + Argument.AssertNotNull(summary, nameof(summary)); + Argument.AssertNotNull(daily, nameof(daily)); + + Summary = summary; + Daily = daily.ToList(); + } + + /// Initializes a new instance of . + /// Contains added, removed, and difference values for the whole range either 7 or 30 days. + /// Contains added, removed, count, and difference values for each day. + /// Keeps track of any properties unknown to the library. + internal DeltaSummaryResult(DeltaRangeResult summary, IReadOnlyList daily, IDictionary serializedAdditionalRawData) + { + Summary = summary; + Daily = daily; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeltaSummaryResult() + { + } + + /// Contains added, removed, and difference values for the whole range either 7 or 30 days. + public DeltaRangeResult Summary { get; } + /// Contains added, removed, count, and difference values for each day. + public IReadOnlyList Daily { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaTypeResponse.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaTypeResponse.Serialization.cs new file mode 100644 index 000000000000..5f8737daf209 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaTypeResponse.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.Analytics.Defender.Easm +{ + public partial class DeltaTypeResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaTypeResponse)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + writer.WritePropertyName("removed"u8); + writer.WriteNumberValue(Removed); + writer.WritePropertyName("added"u8); + writer.WriteNumberValue(Added); + writer.WritePropertyName("difference"u8); + writer.WriteNumberValue(Difference); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeltaTypeResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaTypeResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeltaTypeResponse(document.RootElement, options); + } + + internal static DeltaTypeResponse DeserializeDeltaTypeResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + GlobalAssetType kind = default; + long removed = default; + long added = default; + long difference = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = new GlobalAssetType(property.Value.GetString()); + continue; + } + if (property.NameEquals("removed"u8)) + { + removed = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("added"u8)) + { + added = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("difference"u8)) + { + difference = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeltaTypeResponse(kind, removed, added, difference, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeltaTypeResponse)} does not support writing '{options.Format}' format."); + } + } + + DeltaTypeResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeltaTypeResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeltaTypeResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeltaTypeResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeltaTypeResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaTypeResponse.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaTypeResponse.cs new file mode 100644 index 000000000000..ad7b5a9d5f8a --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DeltaTypeResponse.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Analytics.Defender.Easm +{ + /// The type of Delta response for each asset kind. + public partial class DeltaTypeResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 kind of asset. + /// The amount of assets removed for one asset kind. + /// The amount of assets added for one asset kind. + /// The amount of assets changed for one asset kind. + internal DeltaTypeResponse(GlobalAssetType kind, long removed, long added, long difference) + { + Kind = kind; + Removed = removed; + Added = added; + Difference = difference; + } + + /// Initializes a new instance of . + /// The kind of asset. + /// The amount of assets removed for one asset kind. + /// The amount of assets added for one asset kind. + /// The amount of assets changed for one asset kind. + /// Keeps track of any properties unknown to the library. + internal DeltaTypeResponse(GlobalAssetType kind, long removed, long added, long difference, IDictionary serializedAdditionalRawData) + { + Kind = kind; + Removed = removed; + Added = added; + Difference = difference; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeltaTypeResponse() + { + } + + /// The kind of asset. + public GlobalAssetType Kind { get; } + /// The amount of assets removed for one asset kind. + public long Removed { get; } + /// The amount of assets added for one asset kind. + public long Added { get; } + /// The amount of assets changed for one asset kind. + public long Difference { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupSummaryResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupSummaryResult.Serialization.cs new file mode 100644 index 000000000000..4d53f536d838 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupSummaryResult.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.Analytics.Defender.Easm +{ + public partial class DiscoGroupSummaryResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoGroupSummaryResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiscoGroupSummaryResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoGroupSummaryResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoGroupSummaryResult(document.RootElement, options); + } + + internal static DiscoGroupSummaryResult DeserializeDiscoGroupSummaryResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string name = default; + string displayName = 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("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiscoGroupSummaryResult(id, name, displayName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DiscoGroupSummaryResult)} does not support writing '{options.Format}' format."); + } + } + + DiscoGroupSummaryResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiscoGroupSummaryResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoGroupSummaryResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DiscoGroupSummaryResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiscoGroupSummaryResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupSummaryResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupSummaryResult.cs new file mode 100644 index 000000000000..8a3fcd7758d4 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupSummaryResult.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.Analytics.Defender.Easm +{ + /// A list of disco group summaries. + public partial class DiscoGroupSummaryResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// , or is null. + internal DiscoGroupSummaryResult(string id, string name, string displayName) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(displayName, nameof(displayName)); + + Id = id; + Name = name; + DisplayName = displayName; + } + + /// Initializes a new instance of . + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Keeps track of any properties unknown to the library. + internal DiscoGroupSummaryResult(string id, string name, string displayName, IDictionary serializedAdditionalRawData) + { + Id = id; + Name = name; + DisplayName = displayName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DiscoGroupSummaryResult() + { + } + + /// The system generated unique id for the resource. + public string Id { get; } + /// The caller provided unique name for the resource. + public string Name { get; } + /// The name that can be used for display purposes. + public string DisplayName { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoveryGroup.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoveryGroup.cs index 467ce65ae68d..a503e1391073 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoveryGroup.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoveryGroup.cs @@ -54,7 +54,7 @@ internal DiscoveryGroup() } /// Initializes a new instance of . - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. /// The caller provided unique name for the resource. /// The name that can be used for display purposes. /// The description for a disco group. @@ -84,7 +84,7 @@ internal DiscoveryGroup(string id, string name, string displayName, string descr _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. public string Id { get; } /// The caller provided unique name for the resource. public string Name { get; } diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Docs/EasmClient.xml b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Docs/EasmClient.xml index 57b7b001be07..e04e7484b5a5 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Docs/EasmClient.xml +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Docs/EasmClient.xml @@ -17,6 +17,7 @@ AssetUpdatePayload body = new AssetUpdatePayload { ["contosoLabel"] = true }, + Remediations = { new ObservationRemediationItem(ObservationType.Cve, "CVE-0000-00000", ObservationRemediationState.Active), new ObservationRemediationItem(ObservationType.Insight, "This is an insight", ObservationRemediationState.NonApplicable) }, }; Response response = await client.UpdateAssetsAsync("state%20%3D%20%22confirmed%22%20AND%20name%20%5E%3D%20%22contoso.com%22", body); ]]> @@ -37,6 +38,7 @@ AssetUpdatePayload body = new AssetUpdatePayload { ["contosoLabel"] = true }, + Remediations = { new ObservationRemediationItem(ObservationType.Cve, "CVE-0000-00000", ObservationRemediationState.Active), new ObservationRemediationItem(ObservationType.Insight, "This is an insight", ObservationRemediationState.NonApplicable) }, }; Response response = client.UpdateAssets("state%20%3D%20%22confirmed%22%20AND%20name%20%5E%3D%20%22contoso.com%22", body); ]]> @@ -57,6 +59,21 @@ using RequestContent content = RequestContent.Create(new { contosoLabel = true, }, + remediations = new object[] + { + new + { + name = "CVE-0000-00000", + kind = "cve", + state = "active", + }, + new + { + name = "This is an insight", + kind = "insight", + state = "nonApplicable", + } + }, }); Response response = await client.UpdateAssetsAsync("state%20%3D%20%22confirmed%22%20AND%20name%20%5E%3D%20%22contoso.com%22", content); @@ -80,6 +97,21 @@ using RequestContent content = RequestContent.Create(new { contosoLabel = true, }, + remediations = new object[] + { + new + { + name = "CVE-0000-00000", + kind = "cve", + state = "active", + }, + new + { + name = "This is an insight", + kind = "insight", + state = "nonApplicable", + } + }, }); Response response = client.UpdateAssets("state%20%3D%20%22confirmed%22%20AND%20name%20%5E%3D%20%22contoso.com%22", content); @@ -137,6 +169,238 @@ Response response = client.GetAssetResource("aG9zdCQkY29udG9zby5jb20", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("kind").ToString()); Console.WriteLine(result.GetProperty("id").ToString()); +]]> + + + +This sample shows how to call GetAssetsExportAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +AssetsExportRequest body = new AssetsExportRequest("ThisisaFileName", new string[] { "asset", "name" }); +Response response = await client.GetAssetsExportAsync(body); +]]> + + + +This sample shows how to call GetAssetsExport. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +AssetsExportRequest body = new AssetsExportRequest("ThisisaFileName", new string[] { "asset", "name" }); +Response response = client.GetAssetsExport(body); +]]> + + + +This sample shows how to call GetAssetsExportAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + fileName = "ThisisaFileName", + columns = new object[] + { + "asset", + "name" + }, +}); +Response response = await client.GetAssetsExportAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> + + + +This sample shows how to call GetAssetsExport and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + fileName = "ThisisaFileName", + columns = new object[] + { + "asset", + "name" + }, +}); +Response response = client.GetAssetsExport(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> + + + +This sample shows how to call GetObservationsAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = await client.GetObservationsAsync("aG9zdCQkY29udG9zby5jb20"); +]]> + + + +This sample shows how to call GetObservations. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.GetObservations("aG9zdCQkY29udG9zby5jb20"); +]]> + + + +This sample shows how to call GetObservationsAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = await client.GetObservationsAsync("aG9zdCQkY29udG9zby5jb20", null, null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("totalElements").ToString()); +Console.WriteLine(result.GetProperty("prioritySummary").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("types")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("priority").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("cvssScoreV2").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("cvssScoreV3").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("remediationState").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("remediationSource").ToString()); +]]> + + + +This sample shows how to call GetObservations and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.GetObservations("aG9zdCQkY29udG9zby5jb20", null, null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("totalElements").ToString()); +Console.WriteLine(result.GetProperty("prioritySummary").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("types")[0].ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("priority").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("cvssScoreV2").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("cvssScoreV3").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("remediationState").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("remediationSource").ToString()); +]]> + + + +This sample shows how to call GetDeltaSummaryAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +DeltaSummaryRequest body = new DeltaSummaryRequest +{ + PriorDays = 30, + Date = "2024-03-17", +}; +Response response = await client.GetDeltaSummaryAsync(body); +]]> + + + +This sample shows how to call GetDeltaSummary. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +DeltaSummaryRequest body = new DeltaSummaryRequest +{ + PriorDays = 30, + Date = "2024-03-17", +}; +Response response = client.GetDeltaSummary(body); +]]> + + + +This sample shows how to call GetDeltaSummaryAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + priorDays = 30, + date = "2024-03-17", +}); +Response response = await client.GetDeltaSummaryAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("summary").GetProperty("range").ToString()); +Console.WriteLine(result.GetProperty("summary").GetProperty("removed").ToString()); +Console.WriteLine(result.GetProperty("summary").GetProperty("added").ToString()); +Console.WriteLine(result.GetProperty("summary").GetProperty("difference").ToString()); +Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("removed").ToString()); +Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("added").ToString()); +Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("difference").ToString()); +Console.WriteLine(result.GetProperty("daily")[0].GetProperty("date").ToString()); +Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("count").ToString()); +Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("removed").ToString()); +Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("added").ToString()); +Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("difference").ToString()); +]]> + + + +This sample shows how to call GetDeltaSummary and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + priorDays = 30, + date = "2024-03-17", +}); +Response response = client.GetDeltaSummary(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("summary").GetProperty("range").ToString()); +Console.WriteLine(result.GetProperty("summary").GetProperty("removed").ToString()); +Console.WriteLine(result.GetProperty("summary").GetProperty("added").ToString()); +Console.WriteLine(result.GetProperty("summary").GetProperty("difference").ToString()); +Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("removed").ToString()); +Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("added").ToString()); +Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("difference").ToString()); +Console.WriteLine(result.GetProperty("daily")[0].GetProperty("date").ToString()); +Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("count").ToString()); +Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("removed").ToString()); +Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("added").ToString()); +Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("difference").ToString()); ]]> @@ -403,9 +667,9 @@ Response response = client.DeleteDataConnection("ThisisaDataConnection"); Console.WriteLine(response.Status); ]]> - + -This sample shows how to call ValidateDiscoveryGroupAsync. +This sample shows how to call ValidateDiscoGroupAsync. "); TokenCredential credential = new DefaultAzureCredential(); @@ -413,6 +677,7 @@ EasmClient client = new EasmClient(endpoint, credential); DiscoveryGroupPayload body = new DiscoveryGroupPayload { + Name = "ThisisaDiscoGroup", Description = "This is a disco group", Tier = "advanced", FrequencyMilliseconds = 604800000L, @@ -422,12 +687,12 @@ DiscoveryGroupPayload body = new DiscoveryGroupPayload Name = "thisisatest.microsoft.com", }}, }; -Response response = await client.ValidateDiscoveryGroupAsync(body); +Response response = await client.ValidateDiscoGroupAsync(body); ]]> - + -This sample shows how to call ValidateDiscoveryGroup. +This sample shows how to call ValidateDiscoGroup. "); TokenCredential credential = new DefaultAzureCredential(); @@ -435,6 +700,7 @@ EasmClient client = new EasmClient(endpoint, credential); DiscoveryGroupPayload body = new DiscoveryGroupPayload { + Name = "ThisisaDiscoGroup", Description = "This is a disco group", Tier = "advanced", FrequencyMilliseconds = 604800000L, @@ -444,12 +710,12 @@ DiscoveryGroupPayload body = new DiscoveryGroupPayload Name = "thisisatest.microsoft.com", }}, }; -Response response = client.ValidateDiscoveryGroup(body); +Response response = client.ValidateDiscoGroup(body); ]]> - + -This sample shows how to call ValidateDiscoveryGroupAsync and parse the result. +This sample shows how to call ValidateDiscoGroupAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); @@ -457,6 +723,7 @@ EasmClient client = new EasmClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { + name = "ThisisaDiscoGroup", description = "This is a disco group", frequencyMilliseconds = 604800000L, tier = "advanced", @@ -469,15 +736,15 @@ using RequestContent content = RequestContent.Create(new } }, }); -Response response = await client.ValidateDiscoveryGroupAsync(content); +Response response = await client.ValidateDiscoGroupAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.ToString()); ]]> - + -This sample shows how to call ValidateDiscoveryGroup and parse the result. +This sample shows how to call ValidateDiscoGroup and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); @@ -485,6 +752,7 @@ EasmClient client = new EasmClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { + name = "ThisisaDiscoGroup", description = "This is a disco group", frequencyMilliseconds = 604800000L, tier = "advanced", @@ -497,65 +765,91 @@ using RequestContent content = RequestContent.Create(new } }, }); -Response response = client.ValidateDiscoveryGroup(content); +Response response = client.ValidateDiscoGroup(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.ToString()); ]]> - + -This sample shows how to call GetDiscoveryGroupAsync. +This sample shows how to call GetDiscoGroupAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.GetDiscoveryGroupAsync("ThisisaDiscoGroup"); +Response response = await client.GetDiscoGroupAsync("ThisisaDiscoGroup"); ]]> - + -This sample shows how to call GetDiscoveryGroup. +This sample shows how to call GetDiscoGroup. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.GetDiscoveryGroup("ThisisaDiscoGroup"); +Response response = client.GetDiscoGroup("ThisisaDiscoGroup"); ]]> - + -This sample shows how to call GetDiscoveryGroupAsync and parse the result. +This sample shows how to call GetDiscoGroupAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.GetDiscoveryGroupAsync("ThisisaDiscoGroup", null); +Response response = await client.GetDiscoGroupAsync("ThisisaDiscoGroup", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); ]]> - + -This sample shows how to call GetDiscoveryGroup and parse the result. +This sample shows how to call GetDiscoGroup and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.GetDiscoveryGroup("ThisisaDiscoGroup", null); +Response response = client.GetDiscoGroup("ThisisaDiscoGroup", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); ]]> - + + +This sample shows how to call DeleteDiscoGroupAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = await client.DeleteDiscoGroupAsync("ThisisaDiscoGroup"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteDiscoGroup. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.DeleteDiscoGroup("ThisisaDiscoGroup"); + +Console.WriteLine(response.Status); +]]> + + -This sample shows how to call CreateOrReplaceDiscoveryGroupAsync. +This sample shows how to call CreateOrReplaceDiscoGroupAsync. "); TokenCredential credential = new DefaultAzureCredential(); @@ -572,12 +866,12 @@ DiscoveryGroupPayload body = new DiscoveryGroupPayload Name = "thisisatest.microsoft.com", }}, }; -Response response = await client.CreateOrReplaceDiscoveryGroupAsync("ThisisaDiscoGroup", body); +Response response = await client.CreateOrReplaceDiscoGroupAsync("ThisisaDiscoGroup", body); ]]> - + -This sample shows how to call CreateOrReplaceDiscoveryGroup. +This sample shows how to call CreateOrReplaceDiscoGroup. "); TokenCredential credential = new DefaultAzureCredential(); @@ -594,12 +888,12 @@ DiscoveryGroupPayload body = new DiscoveryGroupPayload Name = "thisisatest.microsoft.com", }}, }; -Response response = client.CreateOrReplaceDiscoveryGroup("ThisisaDiscoGroup", body); +Response response = client.CreateOrReplaceDiscoGroup("ThisisaDiscoGroup", body); ]]> - + -This sample shows how to call CreateOrReplaceDiscoveryGroupAsync and parse the result. +This sample shows how to call CreateOrReplaceDiscoGroupAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); @@ -619,15 +913,15 @@ using RequestContent content = RequestContent.Create(new } }, }); -Response response = await client.CreateOrReplaceDiscoveryGroupAsync("ThisisaDiscoGroup", content); +Response response = await client.CreateOrReplaceDiscoGroupAsync("ThisisaDiscoGroup", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); ]]> - + -This sample shows how to call CreateOrReplaceDiscoveryGroup and parse the result. +This sample shows how to call CreateOrReplaceDiscoGroup and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); @@ -647,230 +941,374 @@ using RequestContent content = RequestContent.Create(new } }, }); -Response response = client.CreateOrReplaceDiscoveryGroup("ThisisaDiscoGroup", content); +Response response = client.CreateOrReplaceDiscoGroup("ThisisaDiscoGroup", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); ]]> - + -This sample shows how to call RunDiscoveryGroupAsync. +This sample shows how to call RunDiscoGroupAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.RunDiscoveryGroupAsync("ThisisaDiscoGroup"); +Response response = await client.RunDiscoGroupAsync("ThisisaDiscoGroup"); Console.WriteLine(response.Status); ]]> - + -This sample shows how to call RunDiscoveryGroup. +This sample shows how to call RunDiscoGroup. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.RunDiscoveryGroup("ThisisaDiscoGroup"); +Response response = client.RunDiscoGroup("ThisisaDiscoGroup"); Console.WriteLine(response.Status); ]]> - + -This sample shows how to call GetDiscoveryTemplateAsync. +This sample shows how to call GetAssetChainSummaryAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.GetDiscoveryTemplateAsync("12345"); +AssetChainRequest body = new AssetChainRequest(AssetChainSource.ASSET, new string[] { "DOMAIN$$contoso.com" }); +Response response = await client.GetAssetChainSummaryAsync(body); ]]> - + -This sample shows how to call GetDiscoveryTemplate. +This sample shows how to call GetAssetChainSummary. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.GetDiscoveryTemplate("12345"); +AssetChainRequest body = new AssetChainRequest(AssetChainSource.ASSET, new string[] { "DOMAIN$$contoso.com" }); +Response response = client.GetAssetChainSummary(body); ]]> - + -This sample shows how to call GetDiscoveryTemplateAsync and parse the result. +This sample shows how to call GetAssetChainSummaryAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.GetDiscoveryTemplateAsync("12345", null); +using RequestContent content = RequestContent.Create(new +{ + assetChainSource = "ASSET", + sourceIds = new object[] + { + "DOMAIN$$contoso.com" + }, +}); +Response response = await client.GetAssetChainSummaryAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("affectedAssetsSummary")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("affectedAssetsSummary")[0].GetProperty("affectedCount").ToString()); +Console.WriteLine(result.GetProperty("affectedGroupsSummary")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("affectedGroupsSummary")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("affectedGroupsSummary")[0].GetProperty("displayName").ToString()); ]]> - + -This sample shows how to call GetDiscoveryTemplate and parse the result. +This sample shows how to call GetAssetChainSummary and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.GetDiscoveryTemplate("12345", null); +using RequestContent content = RequestContent.Create(new +{ + assetChainSource = "ASSET", + sourceIds = new object[] + { + "DOMAIN$$contoso.com" + }, +}); +Response response = client.GetAssetChainSummary(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("affectedAssetsSummary")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("affectedAssetsSummary")[0].GetProperty("affectedCount").ToString()); +Console.WriteLine(result.GetProperty("affectedGroupsSummary")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("affectedGroupsSummary")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("affectedGroupsSummary")[0].GetProperty("displayName").ToString()); ]]> - + -This sample shows how to call GetBillableAsync. +This sample shows how to call DismissAssetChainAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.GetBillableAsync(); +AssetChainRequest body = new AssetChainRequest(AssetChainSource.ASSET, new string[] { "DOMAIN$$contoso.com" }); +Response response = await client.DismissAssetChainAsync(body); ]]> - + -This sample shows how to call GetBillable. +This sample shows how to call DismissAssetChain. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.GetBillable(); +AssetChainRequest body = new AssetChainRequest(AssetChainSource.ASSET, new string[] { "DOMAIN$$contoso.com" }); +Response response = client.DismissAssetChain(body); ]]> - + -This sample shows how to call GetBillableAsync and parse the result. +This sample shows how to call DismissAssetChainAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.GetBillableAsync(null); +using RequestContent content = RequestContent.Create(new +{ + assetChainSource = "ASSET", + sourceIds = new object[] + { + "DOMAIN$$contoso.com" + }, +}); +Response response = await client.DismissAssetChainAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); ]]> - + -This sample shows how to call GetBillable and parse the result. +This sample shows how to call DismissAssetChain and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.GetBillable(null); +using RequestContent content = RequestContent.Create(new +{ + assetChainSource = "ASSET", + sourceIds = new object[] + { + "DOMAIN$$contoso.com" + }, +}); +Response response = client.DismissAssetChain(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); ]]> - + -This sample shows how to call GetSnapshotAsync. +This sample shows how to call GetDiscoTemplateAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -ReportAssetSnapshotPayload body = new ReportAssetSnapshotPayload -{ - Metric = "site_status_active", - Size = 5, - Page = 0, -}; -Response response = await client.GetSnapshotAsync(body); +Response response = await client.GetDiscoTemplateAsync("12345"); ]]> - + -This sample shows how to call GetSnapshot. +This sample shows how to call GetDiscoTemplate. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -ReportAssetSnapshotPayload body = new ReportAssetSnapshotPayload -{ - Metric = "site_status_active", - Size = 5, - Page = 0, -}; -Response response = client.GetSnapshot(body); +Response response = client.GetDiscoTemplate("12345"); ]]> - + -This sample shows how to call GetSnapshotAsync and parse the result. +This sample shows how to call GetDiscoTemplateAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - metric = "site_status_active", - page = 0, - size = 5, -}); -Response response = await client.GetSnapshotAsync(content); +Response response = await client.GetDiscoTemplateAsync("12345", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); ]]> - + -This sample shows how to call GetSnapshot and parse the result. +This sample shows how to call GetDiscoTemplate and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - metric = "site_status_active", - page = 0, - size = 5, -}); -Response response = client.GetSnapshot(content); +Response response = client.GetDiscoTemplate("12345", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); ]]> - + -This sample shows how to call GetSummaryAsync. +This sample shows how to call GetBillableAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -ReportAssetSummaryPayload body = new ReportAssetSummaryPayload -{ - Filters = { "state = \"confirmed\" AND kind = \"domain\"", "state = \"confirmed\" AND kind = \"host\"", "state = \"confirmed\" AND kind = \"page\"" }, -}; -Response response = await client.GetSummaryAsync(body); +Response response = await client.GetBillableAsync(); ]]> - + -This sample shows how to call GetSummary. +This sample shows how to call GetBillable. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.GetBillable(); +]]> + + + +This sample shows how to call GetBillableAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = await client.GetBillableAsync(null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call GetBillable and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.GetBillable(null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call GetSnapshotAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +ReportAssetSnapshotPayload body = new ReportAssetSnapshotPayload +{ + Metric = "site_status_active", + Size = 5, + Page = 0, +}; +Response response = await client.GetSnapshotAsync(body); +]]> + + + +This sample shows how to call GetSnapshot. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +ReportAssetSnapshotPayload body = new ReportAssetSnapshotPayload +{ + Metric = "site_status_active", + Size = 5, + Page = 0, +}; +Response response = client.GetSnapshot(body); +]]> + + + +This sample shows how to call GetSnapshotAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + metric = "site_status_active", + page = 0, + size = 5, +}); +Response response = await client.GetSnapshotAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call GetSnapshot and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + metric = "site_status_active", + page = 0, + size = 5, +}); +Response response = client.GetSnapshot(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call GetSummaryAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +ReportAssetSummaryPayload body = new ReportAssetSummaryPayload +{ + Filters = { "state = \"confirmed\" AND kind = \"domain\"", "state = \"confirmed\" AND kind = \"host\"", "state = \"confirmed\" AND kind = \"page\"" }, +}; +Response response = await client.GetSummaryAsync(body); +]]> + + + +This sample shows how to call GetSummary. "); TokenCredential credential = new DefaultAzureCredential(); @@ -883,345 +1321,859 @@ ReportAssetSummaryPayload body = new ReportAssetSummaryPayload Response response = client.GetSummary(body); ]]> - + + +This sample shows how to call GetSummaryAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + filters = new object[] + { + "state = \"confirmed\" AND kind = \"domain\"", + "state = \"confirmed\" AND kind = \"host\"", + "state = \"confirmed\" AND kind = \"page\"" + }, +}); +Response response = await client.GetSummaryAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call GetSummary and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + filters = new object[] + { + "state = \"confirmed\" AND kind = \"domain\"", + "state = \"confirmed\" AND kind = \"host\"", + "state = \"confirmed\" AND kind = \"page\"" + }, +}); +Response response = client.GetSummary(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call GetSnapshotExportAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +ReportAssetSnapshotExportPayload body = new ReportAssetSnapshotExportPayload +{ + Metric = "ThisisaMetricName", + FileName = "exportedFileName", + Columns = { "Column1", "Column2", "Column3" }, +}; +Response response = await client.GetSnapshotExportAsync(body); +]]> + + + +This sample shows how to call GetSnapshotExport. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +ReportAssetSnapshotExportPayload body = new ReportAssetSnapshotExportPayload +{ + Metric = "ThisisaMetricName", + FileName = "exportedFileName", + Columns = { "Column1", "Column2", "Column3" }, +}; +Response response = client.GetSnapshotExport(body); +]]> + + + +This sample shows how to call GetSnapshotExportAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + metric = "ThisisaMetricName", + fileName = "exportedFileName", + columns = new object[] + { + "Column1", + "Column2", + "Column3" + }, +}); +Response response = await client.GetSnapshotExportAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> + + + +This sample shows how to call GetSnapshotExport and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + metric = "ThisisaMetricName", + fileName = "exportedFileName", + columns = new object[] + { + "Column1", + "Column2", + "Column3" + }, +}); +Response response = client.GetSnapshotExport(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> + + + +This sample shows how to call GetSavedFilterAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = await client.GetSavedFilterAsync("ThisisaSavedFilter"); +]]> + + + +This sample shows how to call GetSavedFilter. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.GetSavedFilter("ThisisaSavedFilter"); +]]> + + + +This sample shows how to call GetSavedFilterAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = await client.GetSavedFilterAsync("ThisisaSavedFilter", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> + + + +This sample shows how to call GetSavedFilter and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.GetSavedFilter("ThisisaSavedFilter", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> + + + +This sample shows how to call CreateOrReplaceSavedFilterAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +SavedFilterPayload body = new SavedFilterPayload("state IN (\"confirmed\")", "This is a saved filter"); +Response response = await client.CreateOrReplaceSavedFilterAsync("ThisisaSavedFilter", body); +]]> + + + +This sample shows how to call CreateOrReplaceSavedFilter. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +SavedFilterPayload body = new SavedFilterPayload("state IN (\"confirmed\")", "This is a saved filter"); +Response response = client.CreateOrReplaceSavedFilter("ThisisaSavedFilter", body); +]]> + + + +This sample shows how to call CreateOrReplaceSavedFilterAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + filter = "state IN (\"confirmed\")", + description = "This is a saved filter", +}); +Response response = await client.CreateOrReplaceSavedFilterAsync("ThisisaSavedFilter", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> + + + +This sample shows how to call CreateOrReplaceSavedFilter and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + filter = "state IN (\"confirmed\")", + description = "This is a saved filter", +}); +Response response = client.CreateOrReplaceSavedFilter("ThisisaSavedFilter", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> + + + +This sample shows how to call DeleteSavedFilterAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = await client.DeleteSavedFilterAsync("ThisisaSavedFilter"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteSavedFilter. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.DeleteSavedFilter("ThisisaSavedFilter"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetTaskAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = await client.GetTaskAsync("ThisisaTaskId"); +]]> + + + +This sample shows how to call GetTask. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.GetTask("ThisisaTaskId"); +]]> + + + +This sample shows how to call GetTaskAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = await client.GetTaskAsync("ThisisaTaskId", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> + + + +This sample shows how to call GetTask and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.GetTask("ThisisaTaskId", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> + + + +This sample shows how to call CancelTaskAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = await client.CancelTaskAsync("ThisisaTaskId"); +]]> + + + +This sample shows how to call CancelTask. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.CancelTask("ThisisaTaskId"); +]]> + + + +This sample shows how to call CancelTaskAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = await client.CancelTaskAsync("ThisisaTaskId", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> + + + +This sample shows how to call CancelTask and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.CancelTask("ThisisaTaskId", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> + + + +This sample shows how to call RunTaskAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = await client.RunTaskAsync("ThisisaTaskId"); +]]> + + + +This sample shows how to call RunTask. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.RunTask("ThisisaTaskId"); +]]> + + + +This sample shows how to call RunTaskAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = await client.RunTaskAsync("ThisisaTaskId", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> + + + +This sample shows how to call RunTask and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.RunTask("ThisisaTaskId", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> + + + +This sample shows how to call DownloadTaskAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = await client.DownloadTaskAsync("ThisisaTaskId"); +]]> + + + +This sample shows how to call DownloadTask. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +Response response = client.DownloadTask("ThisisaTaskId"); +]]> + + -This sample shows how to call GetSummaryAsync and parse the result. +This sample shows how to call DownloadTaskAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - filters = new object[] - { - "state = \"confirmed\" AND kind = \"domain\"", - "state = \"confirmed\" AND kind = \"host\"", - "state = \"confirmed\" AND kind = \"page\"" - }, -}); -Response response = await client.GetSummaryAsync(content); +Response response = await client.DownloadTaskAsync("ThisisaTaskId", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); ]]> - + -This sample shows how to call GetSummary and parse the result. +This sample shows how to call DownloadTask and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - filters = new object[] - { - "state = \"confirmed\" AND kind = \"domain\"", - "state = \"confirmed\" AND kind = \"host\"", - "state = \"confirmed\" AND kind = \"page\"" - }, -}); -Response response = client.GetSummary(content); +Response response = client.DownloadTask("ThisisaTaskId", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); ]]> - + -This sample shows how to call GetSavedFilterAsync. +This sample shows how to call GetCisaCveAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.GetSavedFilterAsync("ThisisaSavedFilter"); +Response response = await client.GetCisaCveAsync("CVE-2021-40438"); ]]> - + -This sample shows how to call GetSavedFilter. +This sample shows how to call GetCisaCve. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.GetSavedFilter("ThisisaSavedFilter"); +Response response = client.GetCisaCve("CVE-2021-40438"); ]]> - + -This sample shows how to call GetSavedFilterAsync and parse the result. +This sample shows how to call GetCisaCveAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.GetSavedFilterAsync("ThisisaSavedFilter", null); +Response response = await client.GetCisaCveAsync("CVE-2021-40438", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("cveId").ToString()); +Console.WriteLine(result.GetProperty("vendorProject").ToString()); +Console.WriteLine(result.GetProperty("product").ToString()); +Console.WriteLine(result.GetProperty("vulnerabilityName").ToString()); +Console.WriteLine(result.GetProperty("shortDescription").ToString()); +Console.WriteLine(result.GetProperty("requiredAction").ToString()); +Console.WriteLine(result.GetProperty("notes").ToString()); +Console.WriteLine(result.GetProperty("dateAdded").ToString()); +Console.WriteLine(result.GetProperty("dueDate").ToString()); +Console.WriteLine(result.GetProperty("updatedAt").ToString()); +Console.WriteLine(result.GetProperty("count").ToString()); ]]> - + -This sample shows how to call GetSavedFilter and parse the result. +This sample shows how to call GetCisaCve and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.GetSavedFilter("ThisisaSavedFilter", null); +Response response = client.GetCisaCve("CVE-2021-40438", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("cveId").ToString()); +Console.WriteLine(result.GetProperty("vendorProject").ToString()); +Console.WriteLine(result.GetProperty("product").ToString()); +Console.WriteLine(result.GetProperty("vulnerabilityName").ToString()); +Console.WriteLine(result.GetProperty("shortDescription").ToString()); +Console.WriteLine(result.GetProperty("requiredAction").ToString()); +Console.WriteLine(result.GetProperty("notes").ToString()); +Console.WriteLine(result.GetProperty("dateAdded").ToString()); +Console.WriteLine(result.GetProperty("dueDate").ToString()); +Console.WriteLine(result.GetProperty("updatedAt").ToString()); +Console.WriteLine(result.GetProperty("count").ToString()); ]]> - + -This sample shows how to call CreateOrReplaceSavedFilterAsync. +This sample shows how to call GetPolicyAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -SavedFilterPayload body = new SavedFilterPayload("state IN (\"confirmed\")", "This is a saved filter"); -Response response = await client.CreateOrReplaceSavedFilterAsync("ThisisaSavedFilter", body); +Response response = await client.GetPolicyAsync("ThisisaPolicy"); ]]> - + -This sample shows how to call CreateOrReplaceSavedFilter. +This sample shows how to call GetPolicy. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -SavedFilterPayload body = new SavedFilterPayload("state IN (\"confirmed\")", "This is a saved filter"); -Response response = client.CreateOrReplaceSavedFilter("ThisisaSavedFilter", body); +Response response = client.GetPolicy("ThisisaPolicy"); ]]> - + -This sample shows how to call CreateOrReplaceSavedFilterAsync and parse the result. +This sample shows how to call GetPolicyAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - filter = "state IN (\"confirmed\")", - description = "This is a saved filter", -}); -Response response = await client.CreateOrReplaceSavedFilterAsync("ThisisaSavedFilter", content); +Response response = await client.GetPolicyAsync("ThisisaPolicy", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("filterName").ToString()); +Console.WriteLine(result.GetProperty("action").ToString()); +Console.WriteLine(result.GetProperty("actionParameters").ToString()); ]]> - + -This sample shows how to call CreateOrReplaceSavedFilter and parse the result. +This sample shows how to call GetPolicy and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new -{ - filter = "state IN (\"confirmed\")", - description = "This is a saved filter", -}); -Response response = client.CreateOrReplaceSavedFilter("ThisisaSavedFilter", content); +Response response = client.GetPolicy("ThisisaPolicy", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("filterName").ToString()); +Console.WriteLine(result.GetProperty("action").ToString()); +Console.WriteLine(result.GetProperty("actionParameters").ToString()); ]]> - + -This sample shows how to call DeleteSavedFilterAsync. +This sample shows how to call DeletePolicyAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.DeleteSavedFilterAsync("ThisisaSavedFilter"); +Response response = await client.DeletePolicyAsync("ThisisaPolicy"); Console.WriteLine(response.Status); ]]> - + -This sample shows how to call DeleteSavedFilter. +This sample shows how to call DeletePolicy. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.DeleteSavedFilter("ThisisaSavedFilter"); +Response response = client.DeletePolicy("ThisisaPolicy"); Console.WriteLine(response.Status); ]]> - + -This sample shows how to call GetTaskAsync. +This sample shows how to call CreateOrReplacePolicyAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.GetTaskAsync("ThisisaTaskId"); +Policy body = new Policy("ThisisaFilter", PolicyAction.SetState, new ActionParameters +{ + Value = "confirmed", +}) +{ + Description = "This is a policy", +}; +Response response = await client.CreateOrReplacePolicyAsync("ThisisaPolicy", body); ]]> - + -This sample shows how to call GetTask. +This sample shows how to call CreateOrReplacePolicy. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.GetTask("ThisisaTaskId"); +Policy body = new Policy("ThisisaFilter", PolicyAction.SetState, new ActionParameters +{ + Value = "confirmed", +}) +{ + Description = "This is a policy", +}; +Response response = client.CreateOrReplacePolicy("ThisisaPolicy", body); ]]> - + -This sample shows how to call GetTaskAsync and parse the result. +This sample shows how to call CreateOrReplacePolicyAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.GetTaskAsync("ThisisaTaskId", null); +using RequestContent content = RequestContent.Create(new +{ + filterName = "ThisisaFilter", + description = "This is a policy", + action = "setState", + actionParameters = new + { + value = "confirmed", + }, +}); +Response response = await client.CreateOrReplacePolicyAsync("ThisisaPolicy", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("filterName").ToString()); +Console.WriteLine(result.GetProperty("action").ToString()); +Console.WriteLine(result.GetProperty("actionParameters").ToString()); ]]> - + -This sample shows how to call GetTask and parse the result. +This sample shows how to call CreateOrReplacePolicy and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.GetTask("ThisisaTaskId", null); +using RequestContent content = RequestContent.Create(new +{ + filterName = "ThisisaFilter", + description = "This is a policy", + action = "setState", + actionParameters = new + { + value = "confirmed", + }, +}); +Response response = client.CreateOrReplacePolicy("ThisisaPolicy", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("filterName").ToString()); +Console.WriteLine(result.GetProperty("action").ToString()); +Console.WriteLine(result.GetProperty("actionParameters").ToString()); ]]> - + -This sample shows how to call CancelTaskAsync. +This sample shows how to call GetAssetResourcesAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.CancelTaskAsync("ThisisaTaskId"); +await foreach (AssetResource item in client.GetAssetResourcesAsync()) +{ +} ]]> - + -This sample shows how to call CancelTask. +This sample shows how to call GetAssetResources. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.CancelTask("ThisisaTaskId"); +foreach (AssetResource item in client.GetAssetResources()) +{ +} ]]> - + -This sample shows how to call CancelTaskAsync and parse the result. +This sample shows how to call GetAssetResourcesAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.CancelTaskAsync("ThisisaTaskId", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); +await foreach (BinaryData item in client.GetAssetResourcesAsync("state%20%3D%20%22confirmed%22", null, 0, 5, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); +} ]]> - + -This sample shows how to call CancelTask and parse the result. +This sample shows how to call GetAssetResources and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.CancelTask("ThisisaTaskId", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); +foreach (BinaryData item in client.GetAssetResources("state%20%3D%20%22confirmed%22", null, 0, 5, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); +} ]]> - + -This sample shows how to call GetAssetResourcesAsync. +This sample shows how to call GetDeltaDetailsAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -await foreach (AssetResource item in client.GetAssetResourcesAsync()) +DeltaDetailsRequest body = new DeltaDetailsRequest(DeltaDetailType.Added, GlobalAssetType.Domain) +{ + PriorDays = 30, + Date = "2024-03-17", +}; +await foreach (DeltaResult item in client.GetDeltaDetailsAsync(body)) { } ]]> - + -This sample shows how to call GetAssetResources. +This sample shows how to call GetDeltaDetails. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -foreach (AssetResource item in client.GetAssetResources()) +DeltaDetailsRequest body = new DeltaDetailsRequest(DeltaDetailType.Added, GlobalAssetType.Domain) +{ + PriorDays = 30, + Date = "2024-03-17", +}; +foreach (DeltaResult item in client.GetDeltaDetails(body)) { } ]]> - + -This sample shows how to call GetAssetResourcesAsync and parse the result. +This sample shows how to call GetDeltaDetailsAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -await foreach (BinaryData item in client.GetAssetResourcesAsync("state%20%3D%20%22confirmed%22", null, 0, 5, null, null)) +using RequestContent content = RequestContent.Create(new +{ + deltaDetailType = "added", + priorDays = 30, + kind = "domain", + date = "2024-03-17", +}); +await foreach (BinaryData item in client.GetDeltaDetailsAsync(content)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("updatedAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); } ]]> - + -This sample shows how to call GetAssetResources and parse the result. +This sample shows how to call GetDeltaDetails and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -foreach (BinaryData item in client.GetAssetResources("state%20%3D%20%22confirmed%22", null, 0, 5, null, null)) +using RequestContent content = RequestContent.Create(new +{ + deltaDetailType = "added", + priorDays = 30, + kind = "domain", + date = "2024-03-17", +}); +foreach (BinaryData item in client.GetDeltaDetails(content)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("updatedAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); } ]]> @@ -1283,168 +2235,168 @@ foreach (BinaryData item in client.GetDataConnections(null, null, null)) } ]]> - + -This sample shows how to call GetDiscoveryGroupsAsync. +This sample shows how to call GetDiscoGroupsAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -await foreach (DiscoveryGroup item in client.GetDiscoveryGroupsAsync()) +await foreach (DiscoveryGroup item in client.GetDiscoGroupsAsync()) { } ]]> - + -This sample shows how to call GetDiscoveryGroups. +This sample shows how to call GetDiscoGroups. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -foreach (DiscoveryGroup item in client.GetDiscoveryGroups()) +foreach (DiscoveryGroup item in client.GetDiscoGroups()) { } ]]> - + -This sample shows how to call GetDiscoveryGroupsAsync and parse the result. +This sample shows how to call GetDiscoGroupsAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -await foreach (BinaryData item in client.GetDiscoveryGroupsAsync(null, null, null, null)) +await foreach (BinaryData item in client.GetDiscoGroupsAsync(null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); } ]]> - + -This sample shows how to call GetDiscoveryGroups and parse the result. +This sample shows how to call GetDiscoGroups and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -foreach (BinaryData item in client.GetDiscoveryGroups(null, null, null, null)) +foreach (BinaryData item in client.GetDiscoGroups(null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); } ]]> - + -This sample shows how to call GetDiscoveryGroupRunsAsync. +This sample shows how to call GetRunsAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -await foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRunsAsync("ThisisaDiscoGroup")) +await foreach (DiscoveryRunResult item in client.GetRunsAsync("ThisisaDiscoGroup")) { } ]]> - + -This sample shows how to call GetDiscoveryGroupRuns. +This sample shows how to call GetRuns. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRuns("ThisisaDiscoGroup")) +foreach (DiscoveryRunResult item in client.GetRuns("ThisisaDiscoGroup")) { } ]]> - + -This sample shows how to call GetDiscoveryGroupRunsAsync and parse the result. +This sample shows how to call GetRunsAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -await foreach (BinaryData item in client.GetDiscoveryGroupRunsAsync("ThisisaDiscoGroup", null, null, null, null)) +await foreach (BinaryData item in client.GetRunsAsync("ThisisaDiscoGroup", null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.ToString()); } ]]> - + -This sample shows how to call GetDiscoveryGroupRuns and parse the result. +This sample shows how to call GetRuns and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -foreach (BinaryData item in client.GetDiscoveryGroupRuns("ThisisaDiscoGroup", null, null, null, null)) +foreach (BinaryData item in client.GetRuns("ThisisaDiscoGroup", null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.ToString()); } ]]> - + -This sample shows how to call GetDiscoveryTemplatesAsync. +This sample shows how to call GetDiscoTemplatesAsync. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -await foreach (DiscoveryTemplate item in client.GetDiscoveryTemplatesAsync()) +await foreach (DiscoveryTemplate item in client.GetDiscoTemplatesAsync()) { } ]]> - + -This sample shows how to call GetDiscoveryTemplates. +This sample shows how to call GetDiscoTemplates. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -foreach (DiscoveryTemplate item in client.GetDiscoveryTemplates()) +foreach (DiscoveryTemplate item in client.GetDiscoTemplates()) { } ]]> - + -This sample shows how to call GetDiscoveryTemplatesAsync and parse the result. +This sample shows how to call GetDiscoTemplatesAsync and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -await foreach (BinaryData item in client.GetDiscoveryTemplatesAsync(null, null, null, null)) +await foreach (BinaryData item in client.GetDiscoTemplatesAsync(null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("id").ToString()); } ]]> - + -This sample shows how to call GetDiscoveryTemplates and parse the result. +This sample shows how to call GetDiscoTemplates and parse the result. "); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -foreach (BinaryData item in client.GetDiscoveryTemplates(null, null, null, null)) +foreach (BinaryData item in client.GetDiscoTemplates(null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("id").ToString()); @@ -1561,6 +2513,144 @@ foreach (BinaryData item in client.GetTasks(null, null, null, null, null)) JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("id").ToString()); } +]]> + + + +This sample shows how to call GetCisaCvesAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +await foreach (CisaCveResult item in client.GetCisaCvesAsync()) +{ +} +]]> + + + +This sample shows how to call GetCisaCves. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +foreach (CisaCveResult item in client.GetCisaCves()) +{ +} +]]> + + + +This sample shows how to call GetCisaCvesAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +await foreach (BinaryData item in client.GetCisaCvesAsync(null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("cveId").ToString()); + Console.WriteLine(result.GetProperty("vendorProject").ToString()); + Console.WriteLine(result.GetProperty("product").ToString()); + Console.WriteLine(result.GetProperty("vulnerabilityName").ToString()); + Console.WriteLine(result.GetProperty("shortDescription").ToString()); + Console.WriteLine(result.GetProperty("requiredAction").ToString()); + Console.WriteLine(result.GetProperty("notes").ToString()); + Console.WriteLine(result.GetProperty("dateAdded").ToString()); + Console.WriteLine(result.GetProperty("dueDate").ToString()); + Console.WriteLine(result.GetProperty("updatedAt").ToString()); + Console.WriteLine(result.GetProperty("count").ToString()); +} +]]> + + + +This sample shows how to call GetCisaCves and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +foreach (BinaryData item in client.GetCisaCves(null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("cveId").ToString()); + Console.WriteLine(result.GetProperty("vendorProject").ToString()); + Console.WriteLine(result.GetProperty("product").ToString()); + Console.WriteLine(result.GetProperty("vulnerabilityName").ToString()); + Console.WriteLine(result.GetProperty("shortDescription").ToString()); + Console.WriteLine(result.GetProperty("requiredAction").ToString()); + Console.WriteLine(result.GetProperty("notes").ToString()); + Console.WriteLine(result.GetProperty("dateAdded").ToString()); + Console.WriteLine(result.GetProperty("dueDate").ToString()); + Console.WriteLine(result.GetProperty("updatedAt").ToString()); + Console.WriteLine(result.GetProperty("count").ToString()); +} +]]> + + + +This sample shows how to call GetPoliciesAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +await foreach (Policy item in client.GetPoliciesAsync()) +{ +} +]]> + + + +This sample shows how to call GetPolicies. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +foreach (Policy item in client.GetPolicies()) +{ +} +]]> + + + +This sample shows how to call GetPoliciesAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +await foreach (BinaryData item in client.GetPoliciesAsync(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("filterName").ToString()); + Console.WriteLine(result.GetProperty("action").ToString()); + Console.WriteLine(result.GetProperty("actionParameters").ToString()); +} +]]> + + + +This sample shows how to call GetPolicies and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, credential); + +foreach (BinaryData item in client.GetPolicies(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("filterName").ToString()); + Console.WriteLine(result.GetProperty("action").ToString()); + Console.WriteLine(result.GetProperty("actionParameters").ToString()); +} ]]> diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClient.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClient.cs index 9c4827dee90d..60d2f4b6d7d2 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClient.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClient.cs @@ -6,6 +6,7 @@ #nullable disable using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Autorest.CSharp.Core; @@ -287,38 +288,1280 @@ public virtual Response GetAssetResource(string assetId, RequestContext context) } } + /// Export a list of assets for the provided search parameters. + /// Body parameter. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> GetAssetsExportAsync(AssetsExportRequest body, string filter = null, string orderby = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAssetsExportAsync(content, filter, orderby, context).ConfigureAwait(false); + return Response.FromValue(TaskResource.FromResponse(response), response); + } + + /// Export a list of assets for the provided search parameters. + /// Body parameter. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The cancellation token to use. + /// is null. + /// + public virtual Response GetAssetsExport(AssetsExportRequest body, string filter = null, string orderby = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAssetsExport(content, filter, orderby, context); + return Response.FromValue(TaskResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Export a list of assets for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetAssetsExportAsync(RequestContent content, string filter = null, string orderby = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetAssetsExport"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssetsExportRequest(content, filter, orderby, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Export a list of assets for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetAssetsExport(RequestContent content, string filter = null, string orderby = null, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetAssetsExport"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssetsExportRequest(content, filter, orderby, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieve observations on an asset. + /// The system generated unique id for the resource. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetObservationsAsync(string assetId, string filter = null, string orderby = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assetId, nameof(assetId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetObservationsAsync(assetId, filter, orderby, skip, maxpagesize, context).ConfigureAwait(false); + return Response.FromValue(ObservationPageResult.FromResponse(response), response); + } + + /// Retrieve observations on an asset. + /// The system generated unique id for the resource. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetObservations(string assetId, string filter = null, string orderby = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assetId, nameof(assetId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetObservations(assetId, filter, orderby, skip, maxpagesize, context); + return Response.FromValue(ObservationPageResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieve observations on an asset + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The system generated unique id for the resource. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetObservationsAsync(string assetId, string filter, string orderby, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(assetId, nameof(assetId)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetObservations"); + scope.Start(); + try + { + using HttpMessage message = CreateGetObservationsRequest(assetId, filter, orderby, skip, maxpagesize, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieve observations on an asset + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The system generated unique id for the resource. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetObservations(string assetId, string filter, string orderby, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(assetId, nameof(assetId)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetObservations"); + scope.Start(); + try + { + using HttpMessage message = CreateGetObservationsRequest(assetId, filter, orderby, skip, maxpagesize, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieve a list of deltas with overall summary changes for the provided time range. + /// Body parameter. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> GetDeltaSummaryAsync(DeltaSummaryRequest body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeltaSummaryAsync(content, context).ConfigureAwait(false); + return Response.FromValue(DeltaSummaryResult.FromResponse(response), response); + } + + /// Retrieve a list of deltas with overall summary changes for the provided time range. + /// Body parameter. + /// The cancellation token to use. + /// is null. + /// + public virtual Response GetDeltaSummary(DeltaSummaryRequest body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeltaSummary(content, context); + return Response.FromValue(DeltaSummaryResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieve a list of deltas with overall summary changes for the provided time range. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetDeltaSummaryAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDeltaSummary"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeltaSummaryRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieve a list of deltas with overall summary changes for the provided time range. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetDeltaSummary(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDeltaSummary"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeltaSummaryRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Validate a data connection with a given dataConnectionName. + /// Body parameter. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> ValidateDataConnectionAsync(DataConnectionPayload body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await ValidateDataConnectionAsync(content, context).ConfigureAwait(false); + return Response.FromValue(ValidateResult.FromResponse(response), response); + } + /// Validate a data connection with a given dataConnectionName. /// Body parameter. /// The cancellation token to use. /// is null. - /// - public virtual async Task> ValidateDataConnectionAsync(DataConnectionPayload body, CancellationToken cancellationToken = default) + /// + public virtual Response ValidateDataConnection(DataConnectionPayload body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = ValidateDataConnection(content, context); + return Response.FromValue(ValidateResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Validate a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task ValidateDataConnectionAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.ValidateDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateValidateDataConnectionRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Validate a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response ValidateDataConnection(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.ValidateDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateValidateDataConnectionRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieve a data connection with a given dataConnectionName. + /// The caller provided unique name for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDataConnectionAsync(string dataConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDataConnectionAsync(dataConnectionName, context).ConfigureAwait(false); + return Response.FromValue(DataConnection.FromResponse(response), response); + } + + /// Retrieve a data connection with a given dataConnectionName. + /// The caller provided unique name for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDataConnection(string dataConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDataConnection(dataConnectionName, context); + return Response.FromValue(DataConnection.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieve a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetDataConnectionAsync(string dataConnectionName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDataConnectionRequest(dataConnectionName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieve a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetDataConnection(string dataConnectionName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDataConnectionRequest(dataConnectionName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create or replace a data connection with a given dataConnectionName. + /// The caller provided unique name for the resource. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CreateOrReplaceDataConnectionAsync(string dataConnectionName, DataConnectionPayload body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateOrReplaceDataConnectionAsync(dataConnectionName, content, context).ConfigureAwait(false); + return Response.FromValue(DataConnection.FromResponse(response), response); + } + + /// Create or replace a data connection with a given dataConnectionName. + /// The caller provided unique name for the resource. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CreateOrReplaceDataConnection(string dataConnectionName, DataConnectionPayload body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateOrReplaceDataConnection(dataConnectionName, content, context); + return Response.FromValue(DataConnection.FromResponse(response), response); + } + + /// + /// [Protocol Method] Create or replace a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrReplaceDataConnectionAsync(string dataConnectionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceDataConnectionRequest(dataConnectionName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create or replace a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrReplaceDataConnection(string dataConnectionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceDataConnectionRequest(dataConnectionName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteDataConnectionAsync(string dataConnectionName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.DeleteDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDataConnectionRequest(dataConnectionName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DeleteDataConnection(string dataConnectionName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.DeleteDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDataConnectionRequest(dataConnectionName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Validate a discovery group with a given groupName. + /// Body parameter. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> ValidateDiscoGroupAsync(DiscoveryGroupPayload body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await ValidateDiscoGroupAsync(content, context).ConfigureAwait(false); + return Response.FromValue(ValidateResult.FromResponse(response), response); + } + + /// Validate a discovery group with a given groupName. + /// Body parameter. + /// The cancellation token to use. + /// is null. + /// + public virtual Response ValidateDiscoGroup(DiscoveryGroupPayload body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = ValidateDiscoGroup(content, context); + return Response.FromValue(ValidateResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Validate a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task ValidateDiscoGroupAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.ValidateDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateValidateDiscoGroupRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Validate a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response ValidateDiscoGroup(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.ValidateDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateValidateDiscoGroupRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieve a discovery group with a given groupName. + /// The caller provided unique name for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDiscoGroupAsync(string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDiscoGroupAsync(groupName, context).ConfigureAwait(false); + return Response.FromValue(DiscoveryGroup.FromResponse(response), response); + } + + /// Retrieve a discovery group with a given groupName. + /// The caller provided unique name for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDiscoGroup(string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDiscoGroup(groupName, context); + return Response.FromValue(DiscoveryGroup.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieve a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetDiscoGroupAsync(string groupName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDiscoGroupRequest(groupName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieve a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetDiscoGroup(string groupName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDiscoGroupRequest(groupName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete a discovery group with a given discovery group name. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteDiscoGroupAsync(string groupName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.DeleteDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDiscoGroupRequest(groupName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete a discovery group with a given discovery group name. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DeleteDiscoGroup(string groupName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.DeleteDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDiscoGroupRequest(groupName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create a discovery group with a given groupName. + /// The caller provided unique name for the resource. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CreateOrReplaceDiscoGroupAsync(string groupName, DiscoveryGroupPayload body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateOrReplaceDiscoGroupAsync(groupName, content, context).ConfigureAwait(false); + return Response.FromValue(DiscoveryGroup.FromResponse(response), response); + } + + /// Create a discovery group with a given groupName. + /// The caller provided unique name for the resource. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CreateOrReplaceDiscoGroup(string groupName, DiscoveryGroupPayload body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateOrReplaceDiscoGroup(groupName, content, context); + return Response.FromValue(DiscoveryGroup.FromResponse(response), response); + } + + /// + /// [Protocol Method] Create a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrReplaceDiscoGroupAsync(string groupName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceDiscoGroupRequest(groupName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrReplaceDiscoGroup(string groupName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceDiscoGroupRequest(groupName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Run a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task RunDiscoGroupAsync(string groupName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.RunDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateRunDiscoGroupRequest(groupName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Run a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response RunDiscoGroup(string groupName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.RunDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateRunDiscoGroupRequest(groupName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieve an asset chain summary. + /// Body parameter. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> GetAssetChainSummaryAsync(AssetChainRequest body, CancellationToken cancellationToken = default) { Argument.AssertNotNull(body, nameof(body)); using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await ValidateDataConnectionAsync(content, context).ConfigureAwait(false); - return Response.FromValue(ValidateResult.FromResponse(response), response); + Response response = await GetAssetChainSummaryAsync(content, context).ConfigureAwait(false); + return Response.FromValue(AssetChainSummaryResult.FromResponse(response), response); } - /// Validate a data connection with a given dataConnectionName. + /// Retrieve an asset chain summary. /// Body parameter. /// The cancellation token to use. /// is null. - /// - public virtual Response ValidateDataConnection(DataConnectionPayload body, CancellationToken cancellationToken = default) + /// + public virtual Response GetAssetChainSummary(AssetChainRequest body, CancellationToken cancellationToken = default) { Argument.AssertNotNull(body, nameof(body)); using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = ValidateDataConnection(content, context); - return Response.FromValue(ValidateResult.FromResponse(response), response); + Response response = GetAssetChainSummary(content, context); + return Response.FromValue(AssetChainSummaryResult.FromResponse(response), response); } /// - /// [Protocol Method] Validate a data connection with a given dataConnectionName. + /// [Protocol Method] Retrieve an asset chain summary. /// /// /// @@ -327,7 +1570,7 @@ public virtual Response ValidateDataConnection(DataConnectionPay /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -337,16 +1580,16 @@ public virtual Response ValidateDataConnection(DataConnectionPay /// is null. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task ValidateDataConnectionAsync(RequestContent content, RequestContext context = null) + /// + public virtual async Task GetAssetChainSummaryAsync(RequestContent content, RequestContext context = null) { Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.ValidateDataConnection"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetAssetChainSummary"); scope.Start(); try { - using HttpMessage message = CreateValidateDataConnectionRequest(content, context); + using HttpMessage message = CreateGetAssetChainSummaryRequest(content, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -357,7 +1600,7 @@ public virtual async Task ValidateDataConnectionAsync(RequestContent c } /// - /// [Protocol Method] Validate a data connection with a given dataConnectionName. + /// [Protocol Method] Retrieve an asset chain summary. /// /// /// @@ -366,7 +1609,7 @@ public virtual async Task ValidateDataConnectionAsync(RequestContent c /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -376,16 +1619,16 @@ public virtual async Task ValidateDataConnectionAsync(RequestContent c /// is null. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response ValidateDataConnection(RequestContent content, RequestContext context = null) + /// + public virtual Response GetAssetChainSummary(RequestContent content, RequestContext context = null) { Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.ValidateDataConnection"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetAssetChainSummary"); scope.Start(); try { - using HttpMessage message = CreateValidateDataConnectionRequest(content, context); + using HttpMessage message = CreateGetAssetChainSummaryRequest(content, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -395,38 +1638,38 @@ public virtual Response ValidateDataConnection(RequestContent content, RequestCo } } - /// Retrieve a data connection with a given dataConnectionName. - /// The caller provided unique name for the resource. + /// Dismiss discovery chain for a given asset chain source. + /// Body parameter. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetDataConnectionAsync(string dataConnectionName, CancellationToken cancellationToken = default) + /// is null. + /// + public virtual async Task> DismissAssetChainAsync(AssetChainRequest body, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + Argument.AssertNotNull(body, nameof(body)); + using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetDataConnectionAsync(dataConnectionName, context).ConfigureAwait(false); - return Response.FromValue(DataConnection.FromResponse(response), response); + Response response = await DismissAssetChainAsync(content, context).ConfigureAwait(false); + return Response.FromValue(TaskResource.FromResponse(response), response); } - /// Retrieve a data connection with a given dataConnectionName. - /// The caller provided unique name for the resource. + /// Dismiss discovery chain for a given asset chain source. + /// Body parameter. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response GetDataConnection(string dataConnectionName, CancellationToken cancellationToken = default) + /// is null. + /// + public virtual Response DismissAssetChain(AssetChainRequest body, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + Argument.AssertNotNull(body, nameof(body)); + using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetDataConnection(dataConnectionName, context); - return Response.FromValue(DataConnection.FromResponse(response), response); + Response response = DismissAssetChain(content, context); + return Response.FromValue(TaskResource.FromResponse(response), response); } /// - /// [Protocol Method] Retrieve a data connection with a given dataConnectionName. + /// [Protocol Method] Dismiss discovery chain for a given asset chain source /// /// /// @@ -435,27 +1678,230 @@ public virtual Response GetDataConnection(string dataConnectionN /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The caller provided unique name for the resource. + /// The content to send as the body of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task GetDataConnectionAsync(string dataConnectionName, RequestContext context) + /// + public virtual async Task DismissAssetChainAsync(RequestContent content, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDataConnection"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.DismissAssetChain"); scope.Start(); try { - using HttpMessage message = CreateGetDataConnectionRequest(dataConnectionName, context); + using HttpMessage message = CreateDismissAssetChainRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Dismiss discovery chain for a given asset chain source + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DismissAssetChain(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.DismissAssetChain"); + scope.Start(); + try + { + using HttpMessage message = CreateDismissAssetChainRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieve a disco template with a given templateId. + /// The system generated unique id for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDiscoTemplateAsync(string templateId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(templateId, nameof(templateId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDiscoTemplateAsync(templateId, context).ConfigureAwait(false); + return Response.FromValue(DiscoveryTemplate.FromResponse(response), response); + } + + /// Retrieve a disco template with a given templateId. + /// The system generated unique id for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDiscoTemplate(string templateId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(templateId, nameof(templateId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDiscoTemplate(templateId, context); + return Response.FromValue(DiscoveryTemplate.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieve a disco template with a given templateId. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The system generated unique id for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetDiscoTemplateAsync(string templateId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(templateId, nameof(templateId)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDiscoTemplate"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDiscoTemplateRequest(templateId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieve a disco template with a given templateId. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The system generated unique id for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetDiscoTemplate(string templateId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(templateId, nameof(templateId)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDiscoTemplate"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDiscoTemplateRequest(templateId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get billable assets summary for the workspace. + /// The cancellation token to use. + /// + public virtual async Task> GetBillableAsync(CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetBillableAsync(context).ConfigureAwait(false); + return Response.FromValue(ReportBillableAssetSummaryResult.FromResponse(response), response); + } + + /// Get billable assets summary for the workspace. + /// The cancellation token to use. + /// + public virtual Response GetBillable(CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetBillable(context); + return Response.FromValue(ReportBillableAssetSummaryResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get billable assets summary for the workspace. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetBillableAsync(RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetBillable"); + scope.Start(); + try + { + using HttpMessage message = CreateGetBillableRequest(context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -466,7 +1912,7 @@ public virtual async Task GetDataConnectionAsync(string dataConnection } /// - /// [Protocol Method] Retrieve a data connection with a given dataConnectionName. + /// [Protocol Method] Get billable assets summary for the workspace. /// /// /// @@ -475,27 +1921,22 @@ public virtual async Task GetDataConnectionAsync(string dataConnection /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The caller provided unique name for the resource. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response GetDataConnection(string dataConnectionName, RequestContext context) + /// + public virtual Response GetBillable(RequestContext context) { - Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); - - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDataConnection"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetBillable"); scope.Start(); try { - using HttpMessage message = CreateGetDataConnectionRequest(dataConnectionName, context); + using HttpMessage message = CreateGetBillableRequest(context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -505,44 +1946,38 @@ public virtual Response GetDataConnection(string dataConnectionName, RequestCont } } - /// Create or replace a data connection with a given dataConnectionName. - /// The caller provided unique name for the resource. + /// Get the most recent snapshot of asset summary values for the snapshot request. /// Body parameter. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> CreateOrReplaceDataConnectionAsync(string dataConnectionName, DataConnectionPayload body, CancellationToken cancellationToken = default) + /// is null. + /// + public virtual async Task> GetSnapshotAsync(ReportAssetSnapshotPayload body, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); Argument.AssertNotNull(body, nameof(body)); using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await CreateOrReplaceDataConnectionAsync(dataConnectionName, content, context).ConfigureAwait(false); - return Response.FromValue(DataConnection.FromResponse(response), response); + Response response = await GetSnapshotAsync(content, context).ConfigureAwait(false); + return Response.FromValue(ReportAssetSnapshotResult.FromResponse(response), response); } - /// Create or replace a data connection with a given dataConnectionName. - /// The caller provided unique name for the resource. + /// Get the most recent snapshot of asset summary values for the snapshot request. /// Body parameter. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response CreateOrReplaceDataConnection(string dataConnectionName, DataConnectionPayload body, CancellationToken cancellationToken = default) + /// is null. + /// + public virtual Response GetSnapshot(ReportAssetSnapshotPayload body, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); Argument.AssertNotNull(body, nameof(body)); using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = CreateOrReplaceDataConnection(dataConnectionName, content, context); - return Response.FromValue(DataConnection.FromResponse(response), response); + Response response = GetSnapshot(content, context); + return Response.FromValue(ReportAssetSnapshotResult.FromResponse(response), response); } /// - /// [Protocol Method] Create or replace a data connection with a given dataConnectionName. + /// [Protocol Method] Get the most recent snapshot of asset summary values for the snapshot request. /// /// /// @@ -551,29 +1986,26 @@ public virtual Response CreateOrReplaceDataConnection(string dat /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The caller provided unique name for the resource. /// The content to send as the body of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// is null. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task CreateOrReplaceDataConnectionAsync(string dataConnectionName, RequestContent content, RequestContext context = null) + /// + public virtual async Task GetSnapshotAsync(RequestContent content, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceDataConnection"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSnapshot"); scope.Start(); try { - using HttpMessage message = CreateCreateOrReplaceDataConnectionRequest(dataConnectionName, content, context); + using HttpMessage message = CreateGetSnapshotRequest(content, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -584,7 +2016,7 @@ public virtual async Task CreateOrReplaceDataConnectionAsync(string da } /// - /// [Protocol Method] Create or replace a data connection with a given dataConnectionName. + /// [Protocol Method] Get the most recent snapshot of asset summary values for the snapshot request. /// /// /// @@ -593,29 +2025,26 @@ public virtual async Task CreateOrReplaceDataConnectionAsync(string da /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The caller provided unique name for the resource. /// The content to send as the body of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// is null. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response CreateOrReplaceDataConnection(string dataConnectionName, RequestContent content, RequestContext context = null) + /// + public virtual Response GetSnapshot(RequestContent content, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceDataConnection"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSnapshot"); scope.Start(); try { - using HttpMessage message = CreateCreateOrReplaceDataConnectionRequest(dataConnectionName, content, context); + using HttpMessage message = CreateGetSnapshotRequest(content, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -625,33 +2054,66 @@ public virtual Response CreateOrReplaceDataConnection(string dataConnectionName, } } - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// Get asset summary details for the summary request. + /// Body parameter. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> GetSummaryAsync(ReportAssetSummaryPayload body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSummaryAsync(content, context).ConfigureAwait(false); + return Response.FromValue(ReportAssetSummaryResult.FromResponse(response), response); + } + + /// Get asset summary details for the summary request. + /// Body parameter. + /// The cancellation token to use. + /// is null. + /// + public virtual Response GetSummary(ReportAssetSummaryPayload body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSummary(content, context); + return Response.FromValue(ReportAssetSummaryResult.FromResponse(response), response); + } + /// - /// [Protocol Method] Delete a data connection with a given dataConnectionName. + /// [Protocol Method] Get asset summary details for the summary request. /// /// /// /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. /// /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// /// /// - /// The caller provided unique name for the resource. + /// The content to send as the body of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task DeleteDataConnectionAsync(string dataConnectionName, RequestContext context = null) + /// + public virtual async Task GetSummaryAsync(RequestContent content, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.DeleteDataConnection"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSummary"); scope.Start(); try { - using HttpMessage message = CreateDeleteDataConnectionRequest(dataConnectionName, context); + using HttpMessage message = CreateGetSummaryRequest(content, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -661,33 +2123,36 @@ public virtual async Task DeleteDataConnectionAsync(string dataConnect } } - // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method /// - /// [Protocol Method] Delete a data connection with a given dataConnectionName. + /// [Protocol Method] Get asset summary details for the summary request. /// /// /// /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. /// /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// /// /// - /// The caller provided unique name for the resource. + /// The content to send as the body of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response DeleteDataConnection(string dataConnectionName, RequestContext context = null) + /// + public virtual Response GetSummary(RequestContent content, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.DeleteDataConnection"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSummary"); scope.Start(); try { - using HttpMessage message = CreateDeleteDataConnectionRequest(dataConnectionName, context); + using HttpMessage message = CreateGetSummaryRequest(content, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -697,38 +2162,38 @@ public virtual Response DeleteDataConnection(string dataConnectionName, RequestC } } - /// Validate a discovery group with a given groupName. + /// Get the most recent snapshot of asset summary values for the snapshot request exported to a file. /// Body parameter. /// The cancellation token to use. /// is null. - /// - public virtual async Task> ValidateDiscoveryGroupAsync(DiscoveryGroupPayload body, CancellationToken cancellationToken = default) + /// + public virtual async Task> GetSnapshotExportAsync(ReportAssetSnapshotExportPayload body, CancellationToken cancellationToken = default) { Argument.AssertNotNull(body, nameof(body)); using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await ValidateDiscoveryGroupAsync(content, context).ConfigureAwait(false); - return Response.FromValue(ValidateResult.FromResponse(response), response); + Response response = await GetSnapshotExportAsync(content, context).ConfigureAwait(false); + return Response.FromValue(TaskResource.FromResponse(response), response); } - /// Validate a discovery group with a given groupName. + /// Get the most recent snapshot of asset summary values for the snapshot request exported to a file. /// Body parameter. /// The cancellation token to use. /// is null. - /// - public virtual Response ValidateDiscoveryGroup(DiscoveryGroupPayload body, CancellationToken cancellationToken = default) + /// + public virtual Response GetSnapshotExport(ReportAssetSnapshotExportPayload body, CancellationToken cancellationToken = default) { Argument.AssertNotNull(body, nameof(body)); using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = ValidateDiscoveryGroup(content, context); - return Response.FromValue(ValidateResult.FromResponse(response), response); + Response response = GetSnapshotExport(content, context); + return Response.FromValue(TaskResource.FromResponse(response), response); } /// - /// [Protocol Method] Validate a discovery group with a given groupName. + /// [Protocol Method] Get the most recent snapshot of asset summary values for the snapshot request exported to a file. /// /// /// @@ -737,7 +2202,7 @@ public virtual Response ValidateDiscoveryGroup(DiscoveryGroupPay /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -747,16 +2212,16 @@ public virtual Response ValidateDiscoveryGroup(DiscoveryGroupPay /// is null. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task ValidateDiscoveryGroupAsync(RequestContent content, RequestContext context = null) + /// + public virtual async Task GetSnapshotExportAsync(RequestContent content, RequestContext context = null) { Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.ValidateDiscoveryGroup"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSnapshotExport"); scope.Start(); try { - using HttpMessage message = CreateValidateDiscoveryGroupRequest(content, context); + using HttpMessage message = CreateGetSnapshotExportRequest(content, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -767,7 +2232,7 @@ public virtual async Task ValidateDiscoveryGroupAsync(RequestContent c } /// - /// [Protocol Method] Validate a discovery group with a given groupName. + /// [Protocol Method] Get the most recent snapshot of asset summary values for the snapshot request exported to a file. /// /// /// @@ -776,7 +2241,7 @@ public virtual async Task ValidateDiscoveryGroupAsync(RequestContent c /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -786,16 +2251,16 @@ public virtual async Task ValidateDiscoveryGroupAsync(RequestContent c /// is null. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response ValidateDiscoveryGroup(RequestContent content, RequestContext context = null) + /// + public virtual Response GetSnapshotExport(RequestContent content, RequestContext context = null) { Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.ValidateDiscoveryGroup"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSnapshotExport"); scope.Start(); try { - using HttpMessage message = CreateValidateDiscoveryGroupRequest(content, context); + using HttpMessage message = CreateGetSnapshotExportRequest(content, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -805,38 +2270,38 @@ public virtual Response ValidateDiscoveryGroup(RequestContent content, RequestCo } } - /// Retrieve a discovery group with a given groupName. - /// The caller provided unique name for the resource. + /// Retrieve a saved filter by filterName. + /// The caller provided unique name for the resource. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetDiscoveryGroupAsync(string groupName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetSavedFilterAsync(string filterName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetDiscoveryGroupAsync(groupName, context).ConfigureAwait(false); - return Response.FromValue(DiscoveryGroup.FromResponse(response), response); + Response response = await GetSavedFilterAsync(filterName, context).ConfigureAwait(false); + return Response.FromValue(SavedFilter.FromResponse(response), response); } - /// Retrieve a discovery group with a given groupName. - /// The caller provided unique name for the resource. + /// Retrieve a saved filter by filterName. + /// The caller provided unique name for the resource. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response GetDiscoveryGroup(string groupName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetSavedFilter(string filterName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetDiscoveryGroup(groupName, context); - return Response.FromValue(DiscoveryGroup.FromResponse(response), response); + Response response = GetSavedFilter(filterName, context); + return Response.FromValue(SavedFilter.FromResponse(response), response); } /// - /// [Protocol Method] Retrieve a discovery group with a given groupName. + /// [Protocol Method] Retrieve a saved filter by filterName. /// /// /// @@ -845,27 +2310,27 @@ public virtual Response GetDiscoveryGroup(string groupName, Canc /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The caller provided unique name for the resource. + /// The caller provided unique name for the resource. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task GetDiscoveryGroupAsync(string groupName, RequestContext context) + /// + public virtual async Task GetSavedFilterAsync(string filterName, RequestContext context) { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDiscoveryGroup"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSavedFilter"); scope.Start(); try { - using HttpMessage message = CreateGetDiscoveryGroupRequest(groupName, context); + using HttpMessage message = CreateGetSavedFilterRequest(filterName, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -876,7 +2341,7 @@ public virtual async Task GetDiscoveryGroupAsync(string groupName, Req } /// - /// [Protocol Method] Retrieve a discovery group with a given groupName. + /// [Protocol Method] Retrieve a saved filter by filterName. /// /// /// @@ -885,27 +2350,27 @@ public virtual async Task GetDiscoveryGroupAsync(string groupName, Req /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The caller provided unique name for the resource. + /// The caller provided unique name for the resource. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response GetDiscoveryGroup(string groupName, RequestContext context) + /// + public virtual Response GetSavedFilter(string filterName, RequestContext context) { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDiscoveryGroup"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSavedFilter"); scope.Start(); try { - using HttpMessage message = CreateGetDiscoveryGroupRequest(groupName, context); + using HttpMessage message = CreateGetSavedFilterRequest(filterName, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -915,44 +2380,44 @@ public virtual Response GetDiscoveryGroup(string groupName, RequestContext conte } } - /// Create a discovery group with a given groupName. - /// The caller provided unique name for the resource. + /// Create or replace a saved filter with a given filterName. + /// The caller provided unique name for the resource. /// Body parameter. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> CreateOrReplaceDiscoveryGroupAsync(string groupName, DiscoveryGroupPayload body, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CreateOrReplaceSavedFilterAsync(string filterName, SavedFilterPayload body, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); Argument.AssertNotNull(body, nameof(body)); using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await CreateOrReplaceDiscoveryGroupAsync(groupName, content, context).ConfigureAwait(false); - return Response.FromValue(DiscoveryGroup.FromResponse(response), response); + Response response = await CreateOrReplaceSavedFilterAsync(filterName, content, context).ConfigureAwait(false); + return Response.FromValue(SavedFilter.FromResponse(response), response); } - /// Create a discovery group with a given groupName. - /// The caller provided unique name for the resource. + /// Create or replace a saved filter with a given filterName. + /// The caller provided unique name for the resource. /// Body parameter. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response CreateOrReplaceDiscoveryGroup(string groupName, DiscoveryGroupPayload body, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CreateOrReplaceSavedFilter(string filterName, SavedFilterPayload body, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); Argument.AssertNotNull(body, nameof(body)); using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = CreateOrReplaceDiscoveryGroup(groupName, content, context); - return Response.FromValue(DiscoveryGroup.FromResponse(response), response); + Response response = CreateOrReplaceSavedFilter(filterName, content, context); + return Response.FromValue(SavedFilter.FromResponse(response), response); } /// - /// [Protocol Method] Create a discovery group with a given groupName. + /// [Protocol Method] Create or replace a saved filter with a given filterName. /// /// /// @@ -961,29 +2426,29 @@ public virtual Response CreateOrReplaceDiscoveryGroup(string gro /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The caller provided unique name for the resource. + /// The caller provided unique name for the resource. /// The content to send as the body of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task CreateOrReplaceDiscoveryGroupAsync(string groupName, RequestContent content, RequestContext context = null) + /// + public virtual async Task CreateOrReplaceSavedFilterAsync(string filterName, RequestContent content, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceDiscoveryGroup"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceSavedFilter"); scope.Start(); try { - using HttpMessage message = CreateCreateOrReplaceDiscoveryGroupRequest(groupName, content, context); + using HttpMessage message = CreateCreateOrReplaceSavedFilterRequest(filterName, content, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -994,7 +2459,7 @@ public virtual async Task CreateOrReplaceDiscoveryGroupAsync(string gr } /// - /// [Protocol Method] Create a discovery group with a given groupName. + /// [Protocol Method] Create or replace a saved filter with a given filterName. /// /// /// @@ -1003,29 +2468,29 @@ public virtual async Task CreateOrReplaceDiscoveryGroupAsync(string gr /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The caller provided unique name for the resource. + /// The caller provided unique name for the resource. /// The content to send as the body of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response CreateOrReplaceDiscoveryGroup(string groupName, RequestContent content, RequestContext context = null) + /// + public virtual Response CreateOrReplaceSavedFilter(string filterName, RequestContent content, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceDiscoveryGroup"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceSavedFilter"); scope.Start(); try { - using HttpMessage message = CreateCreateOrReplaceDiscoveryGroupRequest(groupName, content, context); + using HttpMessage message = CreateCreateOrReplaceSavedFilterRequest(filterName, content, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -1037,7 +2502,7 @@ public virtual Response CreateOrReplaceDiscoveryGroup(string groupName, RequestC // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method /// - /// [Protocol Method] Run a discovery group with a given groupName. + /// [Protocol Method] Delete a saved filter with a given filterName. /// /// /// @@ -1046,22 +2511,22 @@ public virtual Response CreateOrReplaceDiscoveryGroup(string groupName, RequestC /// /// /// - /// The caller provided unique name for the resource. + /// The caller provided unique name for the resource. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task RunDiscoveryGroupAsync(string groupName, RequestContext context = null) + /// + public virtual async Task DeleteSavedFilterAsync(string filterName, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.RunDiscoveryGroup"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.DeleteSavedFilter"); scope.Start(); try { - using HttpMessage message = CreateRunDiscoveryGroupRequest(groupName, context); + using HttpMessage message = CreateDeleteSavedFilterRequest(filterName, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -1073,7 +2538,7 @@ public virtual async Task RunDiscoveryGroupAsync(string groupName, Req // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method /// - /// [Protocol Method] Run a discovery group with a given groupName. + /// [Protocol Method] Delete a saved filter with a given filterName. /// /// /// @@ -1082,22 +2547,22 @@ public virtual async Task RunDiscoveryGroupAsync(string groupName, Req /// /// /// - /// The caller provided unique name for the resource. + /// The caller provided unique name for the resource. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response RunDiscoveryGroup(string groupName, RequestContext context = null) + /// + public virtual Response DeleteSavedFilter(string filterName, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.RunDiscoveryGroup"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.DeleteSavedFilter"); scope.Start(); try { - using HttpMessage message = CreateRunDiscoveryGroupRequest(groupName, context); + using HttpMessage message = CreateDeleteSavedFilterRequest(filterName, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -1107,38 +2572,38 @@ public virtual Response RunDiscoveryGroup(string groupName, RequestContext conte } } - /// Retrieve a disco template with a given templateId. - /// The system generated unique id for the resource. + /// Retrieve a task by taskId. + /// The unique identifier of the task. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetDiscoveryTemplateAsync(string templateId, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetTaskAsync(string taskId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(templateId, nameof(templateId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetDiscoveryTemplateAsync(templateId, context).ConfigureAwait(false); - return Response.FromValue(DiscoveryTemplate.FromResponse(response), response); + Response response = await GetTaskAsync(taskId, context).ConfigureAwait(false); + return Response.FromValue(TaskResource.FromResponse(response), response); } - /// Retrieve a disco template with a given templateId. - /// The system generated unique id for the resource. + /// Retrieve a task by taskId. + /// The unique identifier of the task. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response GetDiscoveryTemplate(string templateId, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetTask(string taskId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(templateId, nameof(templateId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetDiscoveryTemplate(templateId, context); - return Response.FromValue(DiscoveryTemplate.FromResponse(response), response); + Response response = GetTask(taskId, context); + return Response.FromValue(TaskResource.FromResponse(response), response); } /// - /// [Protocol Method] Retrieve a disco template with a given templateId. + /// [Protocol Method] Retrieve a task by taskId. /// /// /// @@ -1147,27 +2612,27 @@ public virtual Response GetDiscoveryTemplate(string templateI /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The system generated unique id for the resource. + /// The unique identifier of the task. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task GetDiscoveryTemplateAsync(string templateId, RequestContext context) + /// + public virtual async Task GetTaskAsync(string taskId, RequestContext context) { - Argument.AssertNotNullOrEmpty(templateId, nameof(templateId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDiscoveryTemplate"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetTask"); scope.Start(); try { - using HttpMessage message = CreateGetDiscoveryTemplateRequest(templateId, context); + using HttpMessage message = CreateGetTaskRequest(taskId, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -1178,7 +2643,7 @@ public virtual async Task GetDiscoveryTemplateAsync(string templateId, } /// - /// [Protocol Method] Retrieve a disco template with a given templateId. + /// [Protocol Method] Retrieve a task by taskId. /// /// /// @@ -1187,27 +2652,27 @@ public virtual async Task GetDiscoveryTemplateAsync(string templateId, /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The system generated unique id for the resource. + /// The unique identifier of the task. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response GetDiscoveryTemplate(string templateId, RequestContext context) + /// + public virtual Response GetTask(string taskId, RequestContext context) { - Argument.AssertNotNullOrEmpty(templateId, nameof(templateId)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDiscoveryTemplate"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetTask"); scope.Start(); try { - using HttpMessage message = CreateGetDiscoveryTemplateRequest(templateId, context); + using HttpMessage message = CreateGetTaskRequest(taskId, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -1217,28 +2682,38 @@ public virtual Response GetDiscoveryTemplate(string templateId, RequestContext c } } - /// Get billable assets summary for the workspace. + /// Cancel a task by taskId. + /// The unique identifier of the task. /// The cancellation token to use. - /// - public virtual async Task> GetBillableAsync(CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CancelTaskAsync(string taskId, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetBillableAsync(context).ConfigureAwait(false); - return Response.FromValue(ReportBillableAssetSummaryResult.FromResponse(response), response); + Response response = await CancelTaskAsync(taskId, context).ConfigureAwait(false); + return Response.FromValue(TaskResource.FromResponse(response), response); } - /// Get billable assets summary for the workspace. + /// Cancel a task by taskId. + /// The unique identifier of the task. /// The cancellation token to use. - /// - public virtual Response GetBillable(CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CancelTask(string taskId, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetBillable(context); - return Response.FromValue(ReportBillableAssetSummaryResult.FromResponse(response), response); + Response response = CancelTask(taskId, context); + return Response.FromValue(TaskResource.FromResponse(response), response); } /// - /// [Protocol Method] Get billable assets summary for the workspace. + /// [Protocol Method] Cancel a task by taskId. /// /// /// @@ -1247,22 +2722,27 @@ public virtual Response GetBillable(Cancellati /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// + /// The unique identifier of the task. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task GetBillableAsync(RequestContext context) + /// + public virtual async Task CancelTaskAsync(string taskId, RequestContext context) { - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetBillable"); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.CancelTask"); scope.Start(); try { - using HttpMessage message = CreateGetBillableRequest(context); + using HttpMessage message = CreateCancelTaskRequest(taskId, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -1273,7 +2753,7 @@ public virtual async Task GetBillableAsync(RequestContext context) } /// - /// [Protocol Method] Get billable assets summary for the workspace. + /// [Protocol Method] Cancel a task by taskId. /// /// /// @@ -1282,22 +2762,27 @@ public virtual async Task GetBillableAsync(RequestContext context) /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// + /// The unique identifier of the task. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response GetBillable(RequestContext context) + /// + public virtual Response CancelTask(string taskId, RequestContext context) { - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetBillable"); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.CancelTask"); scope.Start(); try { - using HttpMessage message = CreateGetBillableRequest(context); + using HttpMessage message = CreateCancelTaskRequest(taskId, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -1307,38 +2792,38 @@ public virtual Response GetBillable(RequestContext context) } } - /// Get the most recent snapshot of asset summary values for the snapshot request. - /// Body parameter. + /// Run a task by taskId. + /// The unique identifier of the task. /// The cancellation token to use. - /// is null. - /// - public virtual async Task> GetSnapshotAsync(ReportAssetSnapshotPayload body, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> RunTaskAsync(string taskId, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(body, nameof(body)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); - using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetSnapshotAsync(content, context).ConfigureAwait(false); - return Response.FromValue(ReportAssetSnapshotResult.FromResponse(response), response); + Response response = await RunTaskAsync(taskId, context).ConfigureAwait(false); + return Response.FromValue(TaskResource.FromResponse(response), response); } - /// Get the most recent snapshot of asset summary values for the snapshot request. - /// Body parameter. + /// Run a task by taskId. + /// The unique identifier of the task. /// The cancellation token to use. - /// is null. - /// - public virtual Response GetSnapshot(ReportAssetSnapshotPayload body, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response RunTask(string taskId, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(body, nameof(body)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); - using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetSnapshot(content, context); - return Response.FromValue(ReportAssetSnapshotResult.FromResponse(response), response); + Response response = RunTask(taskId, context); + return Response.FromValue(TaskResource.FromResponse(response), response); } /// - /// [Protocol Method] Get the most recent snapshot of asset summary values for the snapshot request. + /// [Protocol Method] Run a task by taskId. /// /// /// @@ -1347,26 +2832,27 @@ public virtual Response GetSnapshot(ReportAssetSnapsh /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The content to send as the body of the request. + /// The unique identifier of the task. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task GetSnapshotAsync(RequestContent content, RequestContext context = null) + /// + public virtual async Task RunTaskAsync(string taskId, RequestContext context) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSnapshot"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.RunTask"); scope.Start(); try { - using HttpMessage message = CreateGetSnapshotRequest(content, context); + using HttpMessage message = CreateRunTaskRequest(taskId, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -1377,7 +2863,7 @@ public virtual async Task GetSnapshotAsync(RequestContent content, Req } /// - /// [Protocol Method] Get the most recent snapshot of asset summary values for the snapshot request. + /// [Protocol Method] Run a task by taskId. /// /// /// @@ -1386,26 +2872,27 @@ public virtual async Task GetSnapshotAsync(RequestContent content, Req /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The content to send as the body of the request. + /// The unique identifier of the task. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response GetSnapshot(RequestContent content, RequestContext context = null) + /// + public virtual Response RunTask(string taskId, RequestContext context) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSnapshot"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.RunTask"); scope.Start(); try { - using HttpMessage message = CreateGetSnapshotRequest(content, context); + using HttpMessage message = CreateRunTaskRequest(taskId, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -1415,38 +2902,38 @@ public virtual Response GetSnapshot(RequestContent content, RequestContext conte } } - /// Get asset summary details for the summary request. - /// Body parameter. + /// Download a task. + /// The unique identifier of the task. /// The cancellation token to use. - /// is null. - /// - public virtual async Task> GetSummaryAsync(ReportAssetSummaryPayload body, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> DownloadTaskAsync(string taskId, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(body, nameof(body)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); - using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetSummaryAsync(content, context).ConfigureAwait(false); - return Response.FromValue(ReportAssetSummaryResult.FromResponse(response), response); + Response response = await DownloadTaskAsync(taskId, context).ConfigureAwait(false); + return Response.FromValue(TaskResource.FromResponse(response), response); } - /// Get asset summary details for the summary request. - /// Body parameter. - /// The cancellation token to use. - /// is null. - /// - public virtual Response GetSummary(ReportAssetSummaryPayload body, CancellationToken cancellationToken = default) + /// Download a task. + /// The unique identifier of the task. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response DownloadTask(string taskId, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(body, nameof(body)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); - using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetSummary(content, context); - return Response.FromValue(ReportAssetSummaryResult.FromResponse(response), response); + Response response = DownloadTask(taskId, context); + return Response.FromValue(TaskResource.FromResponse(response), response); } /// - /// [Protocol Method] Get asset summary details for the summary request. + /// [Protocol Method] Download a task. /// /// /// @@ -1455,26 +2942,27 @@ public virtual Response GetSummary(ReportAssetSummaryP /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The content to send as the body of the request. + /// The unique identifier of the task. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task GetSummaryAsync(RequestContent content, RequestContext context = null) + /// + public virtual async Task DownloadTaskAsync(string taskId, RequestContext context) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSummary"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.DownloadTask"); scope.Start(); try { - using HttpMessage message = CreateGetSummaryRequest(content, context); + using HttpMessage message = CreateDownloadTaskRequest(taskId, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -1485,7 +2973,7 @@ public virtual async Task GetSummaryAsync(RequestContent content, Requ } /// - /// [Protocol Method] Get asset summary details for the summary request. + /// [Protocol Method] Download a task. /// /// /// @@ -1494,26 +2982,27 @@ public virtual async Task GetSummaryAsync(RequestContent content, Requ /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The content to send as the body of the request. + /// The unique identifier of the task. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response GetSummary(RequestContent content, RequestContext context = null) + /// + public virtual Response DownloadTask(string taskId, RequestContext context) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSummary"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.DownloadTask"); scope.Start(); try { - using HttpMessage message = CreateGetSummaryRequest(content, context); + using HttpMessage message = CreateDownloadTaskRequest(taskId, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -1523,38 +3012,38 @@ public virtual Response GetSummary(RequestContent content, RequestContext contex } } - /// Retrieve a saved filter by filterName. - /// The caller provided unique name for the resource. + /// Retrieve details of CisaCve by cveId. + /// The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetSavedFilterAsync(string filterName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetCisaCveAsync(string cveId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + Argument.AssertNotNullOrEmpty(cveId, nameof(cveId)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetSavedFilterAsync(filterName, context).ConfigureAwait(false); - return Response.FromValue(SavedFilter.FromResponse(response), response); + Response response = await GetCisaCveAsync(cveId, context).ConfigureAwait(false); + return Response.FromValue(CisaCveResult.FromResponse(response), response); } - /// Retrieve a saved filter by filterName. - /// The caller provided unique name for the resource. + /// Retrieve details of CisaCve by cveId. + /// The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response GetSavedFilter(string filterName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetCisaCve(string cveId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + Argument.AssertNotNullOrEmpty(cveId, nameof(cveId)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetSavedFilter(filterName, context); - return Response.FromValue(SavedFilter.FromResponse(response), response); + Response response = GetCisaCve(cveId, context); + return Response.FromValue(CisaCveResult.FromResponse(response), response); } /// - /// [Protocol Method] Retrieve a saved filter by filterName. + /// [Protocol Method] Retrieve details of CisaCve by cveId /// /// /// @@ -1563,27 +3052,27 @@ public virtual Response GetSavedFilter(string filterName, Cancellat /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The caller provided unique name for the resource. + /// The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task GetSavedFilterAsync(string filterName, RequestContext context) + /// + public virtual async Task GetCisaCveAsync(string cveId, RequestContext context) { - Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + Argument.AssertNotNullOrEmpty(cveId, nameof(cveId)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSavedFilter"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetCisaCve"); scope.Start(); try { - using HttpMessage message = CreateGetSavedFilterRequest(filterName, context); + using HttpMessage message = CreateGetCisaCveRequest(cveId, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -1594,7 +3083,7 @@ public virtual async Task GetSavedFilterAsync(string filterName, Reque } /// - /// [Protocol Method] Retrieve a saved filter by filterName. + /// [Protocol Method] Retrieve details of CisaCve by cveId /// /// /// @@ -1603,27 +3092,27 @@ public virtual async Task GetSavedFilterAsync(string filterName, Reque /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The caller provided unique name for the resource. + /// The CVE ID of the vulnerability in the format CVE-YYYY-NNNN, note that the number portion can have more than 4 digits. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response GetSavedFilter(string filterName, RequestContext context) + /// + public virtual Response GetCisaCve(string cveId, RequestContext context) { - Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + Argument.AssertNotNullOrEmpty(cveId, nameof(cveId)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSavedFilter"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetCisaCve"); scope.Start(); try { - using HttpMessage message = CreateGetSavedFilterRequest(filterName, context); + using HttpMessage message = CreateGetCisaCveRequest(cveId, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -1633,44 +3122,38 @@ public virtual Response GetSavedFilter(string filterName, RequestContext context } } - /// Create or replace a saved filter with a given filterName. - /// The caller provided unique name for the resource. - /// Body parameter. + /// Retrieve a policy with a given policyName. + /// The caller provided unique name for the resource. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> CreateOrReplaceSavedFilterAsync(string filterName, SavedFilterPayload body, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetPolicyAsync(string policyName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); - Argument.AssertNotNull(body, nameof(body)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); - using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await CreateOrReplaceSavedFilterAsync(filterName, content, context).ConfigureAwait(false); - return Response.FromValue(SavedFilter.FromResponse(response), response); + Response response = await GetPolicyAsync(policyName, context).ConfigureAwait(false); + return Response.FromValue(Policy.FromResponse(response), response); } - /// Create or replace a saved filter with a given filterName. - /// The caller provided unique name for the resource. - /// Body parameter. + /// Retrieve a policy with a given policyName. + /// The caller provided unique name for the resource. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response CreateOrReplaceSavedFilter(string filterName, SavedFilterPayload body, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetPolicy(string policyName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); - Argument.AssertNotNull(body, nameof(body)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); - using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = CreateOrReplaceSavedFilter(filterName, content, context); - return Response.FromValue(SavedFilter.FromResponse(response), response); + Response response = GetPolicy(policyName, context); + return Response.FromValue(Policy.FromResponse(response), response); } /// - /// [Protocol Method] Create or replace a saved filter with a given filterName. + /// [Protocol Method] Retrieve a policy with a given policyName. /// /// /// @@ -1679,29 +3162,27 @@ public virtual Response CreateOrReplaceSavedFilter(string filterNam /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The caller provided unique name for the resource. - /// The content to send as the body of the request. + /// The caller provided unique name for the resource. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task CreateOrReplaceSavedFilterAsync(string filterName, RequestContent content, RequestContext context = null) + /// + public virtual async Task GetPolicyAsync(string policyName, RequestContext context) { - Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceSavedFilter"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetPolicy"); scope.Start(); try { - using HttpMessage message = CreateCreateOrReplaceSavedFilterRequest(filterName, content, context); + using HttpMessage message = CreateGetPolicyRequest(policyName, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -1712,7 +3193,7 @@ public virtual async Task CreateOrReplaceSavedFilterAsync(string filte } /// - /// [Protocol Method] Create or replace a saved filter with a given filterName. + /// [Protocol Method] Retrieve a policy with a given policyName. /// /// /// @@ -1721,29 +3202,27 @@ public virtual async Task CreateOrReplaceSavedFilterAsync(string filte /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The caller provided unique name for the resource. - /// The content to send as the body of the request. + /// The caller provided unique name for the resource. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response CreateOrReplaceSavedFilter(string filterName, RequestContent content, RequestContext context = null) + /// + public virtual Response GetPolicy(string policyName, RequestContext context) { - Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceSavedFilter"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetPolicy"); scope.Start(); try { - using HttpMessage message = CreateCreateOrReplaceSavedFilterRequest(filterName, content, context); + using HttpMessage message = CreateGetPolicyRequest(policyName, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -1755,7 +3234,7 @@ public virtual Response CreateOrReplaceSavedFilter(string filterName, RequestCon // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method /// - /// [Protocol Method] Delete a saved filter with a given filterName. + /// [Protocol Method] Delete a policy with a given policyName. /// /// /// @@ -1764,22 +3243,22 @@ public virtual Response CreateOrReplaceSavedFilter(string filterName, RequestCon /// /// /// - /// The caller provided unique name for the resource. + /// The caller provided unique name for the resource. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task DeleteSavedFilterAsync(string filterName, RequestContext context = null) + /// + public virtual async Task DeletePolicyAsync(string policyName, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.DeleteSavedFilter"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.DeletePolicy"); scope.Start(); try { - using HttpMessage message = CreateDeleteSavedFilterRequest(filterName, context); + using HttpMessage message = CreateDeletePolicyRequest(policyName, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -1791,7 +3270,7 @@ public virtual async Task DeleteSavedFilterAsync(string filterName, Re // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method /// - /// [Protocol Method] Delete a saved filter with a given filterName. + /// [Protocol Method] Delete a policy with a given policyName. /// /// /// @@ -1800,22 +3279,22 @@ public virtual async Task DeleteSavedFilterAsync(string filterName, Re /// /// /// - /// The caller provided unique name for the resource. + /// The caller provided unique name for the resource. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response DeleteSavedFilter(string filterName, RequestContext context = null) + /// + public virtual Response DeletePolicy(string policyName, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.DeleteSavedFilter"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.DeletePolicy"); scope.Start(); try { - using HttpMessage message = CreateDeleteSavedFilterRequest(filterName, context); + using HttpMessage message = CreateDeletePolicyRequest(policyName, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -1825,38 +3304,44 @@ public virtual Response DeleteSavedFilter(string filterName, RequestContext cont } } - /// Retrieve a task by taskId. - /// The unique identifier of the task. + /// Create a policy with a given policyName. + /// The caller provided unique name for the resource. + /// Body parameter. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> GetTaskAsync(string taskId, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CreateOrReplacePolicyAsync(string policyName, Policy body, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(body, nameof(body)); + using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetTaskAsync(taskId, context).ConfigureAwait(false); - return Response.FromValue(TaskResource.FromResponse(response), response); + Response response = await CreateOrReplacePolicyAsync(policyName, content, context).ConfigureAwait(false); + return Response.FromValue(Policy.FromResponse(response), response); } - /// Retrieve a task by taskId. - /// The unique identifier of the task. + /// Create a policy with a given policyName. + /// The caller provided unique name for the resource. + /// Body parameter. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response GetTask(string taskId, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CreateOrReplacePolicy(string policyName, Policy body, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(body, nameof(body)); + using RequestContent content = body.ToRequestContent(); RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetTask(taskId, context); - return Response.FromValue(TaskResource.FromResponse(response), response); + Response response = CreateOrReplacePolicy(policyName, content, context); + return Response.FromValue(Policy.FromResponse(response), response); } /// - /// [Protocol Method] Retrieve a task by taskId. + /// [Protocol Method] Create a policy with a given policyName. /// /// /// @@ -1865,27 +3350,29 @@ public virtual Response GetTask(string taskId, CancellationToken c /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The unique identifier of the task. + /// The caller provided unique name for the resource. + /// The content to send as the body of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual async Task GetTaskAsync(string taskId, RequestContext context) + /// + public virtual async Task CreateOrReplacePolicyAsync(string policyName, RequestContent content, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetTask"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplacePolicy"); scope.Start(); try { - using HttpMessage message = CreateGetTaskRequest(taskId, context); + using HttpMessage message = CreateCreateOrReplacePolicyRequest(policyName, content, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -1896,7 +3383,7 @@ public virtual async Task GetTaskAsync(string taskId, RequestContext c } /// - /// [Protocol Method] Retrieve a task by taskId. + /// [Protocol Method] Create a policy with a given policyName. /// /// /// @@ -1905,27 +3392,29 @@ public virtual async Task GetTaskAsync(string taskId, RequestContext c /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The unique identifier of the task. + /// The caller provided unique name for the resource. + /// The content to send as the body of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - /// - public virtual Response GetTask(string taskId, RequestContext context) + /// + public virtual Response CreateOrReplacePolicy(string policyName, RequestContent content, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(content, nameof(content)); - using var scope = ClientDiagnostics.CreateScope("EasmClient.GetTask"); + using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplacePolicy"); scope.Start(); try { - using HttpMessage message = CreateGetTaskRequest(taskId, context); + using HttpMessage message = CreateCreateOrReplacePolicyRequest(policyName, content, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -1935,38 +3424,46 @@ public virtual Response GetTask(string taskId, RequestContext context) } } - /// Cancel a task by taskId. - /// The unique identifier of the task. + /// Retrieve a list of assets for the provided search parameters. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response. + /// Specify the response type. The possible values are: ID, STANDARD, FULL, REDUCED. + /// The properties to include in the response. + /// If it's recent only. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual async Task> CancelTaskAsync(string taskId, CancellationToken cancellationToken = default) + /// + public virtual AsyncPageable GetAssetResourcesAsync(string filter = null, string orderby = null, int? skip = null, int? maxpagesize = null, string mark = null, AssetResponseType? responseType = null, IEnumerable responseIncludes = null, bool? recentOnly = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = await CancelTaskAsync(taskId, context).ConfigureAwait(false); - return Response.FromValue(TaskResource.FromResponse(response), response); + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssetResourcesRequest(filter, orderby, skip, pageSizeHint, mark, responseType?.ToString(), responseIncludes, recentOnly, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssetResourcesNextPageRequest(nextLink, filter, orderby, skip, pageSizeHint, mark, responseType?.ToString(), responseIncludes, recentOnly, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AssetResource.DeserializeAssetResource(e), ClientDiagnostics, _pipeline, "EasmClient.GetAssetResources", "value", "nextLink", maxpagesize, context); } - /// Cancel a task by taskId. - /// The unique identifier of the task. + /// Retrieve a list of assets for the provided search parameters. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response. + /// Specify the response type. The possible values are: ID, STANDARD, FULL, REDUCED. + /// The properties to include in the response. + /// If it's recent only. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// - public virtual Response CancelTask(string taskId, CancellationToken cancellationToken = default) + /// + public virtual Pageable GetAssetResources(string filter = null, string orderby = null, int? skip = null, int? maxpagesize = null, string mark = null, AssetResponseType? responseType = null, IEnumerable responseIncludes = null, bool? recentOnly = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); - - RequestContext context = FromCancellationToken(cancellationToken); - Response response = CancelTask(taskId, context); - return Response.FromValue(TaskResource.FromResponse(response), response); + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssetResourcesRequest(filter, orderby, skip, pageSizeHint, mark, responseType?.ToString(), responseIncludes, recentOnly, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssetResourcesNextPageRequest(nextLink, filter, orderby, skip, pageSizeHint, mark, responseType?.ToString(), responseIncludes, recentOnly, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AssetResource.DeserializeAssetResource(e), ClientDiagnostics, _pipeline, "EasmClient.GetAssetResources", "value", "nextLink", maxpagesize, context); } /// - /// [Protocol Method] Cancel a task by taskId. + /// [Protocol Method] Retrieve a list of assets for the provided search parameters. /// /// /// @@ -1975,38 +3472,32 @@ public virtual Response CancelTask(string taskId, CancellationToke /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The unique identifier of the task. - /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual async Task CancelTaskAsync(string taskId, RequestContext context) - { - Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); - - using var scope = ClientDiagnostics.CreateScope("EasmClient.CancelTask"); - scope.Start(); - try - { - using HttpMessage message = CreateCancelTaskRequest(taskId, context); - return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response. + /// Specify the response type. The possible values are: ID, STANDARD, FULL, REDUCED. Allowed values: "id" | "standard" | "full" | "reduced". + /// The properties to include in the response. + /// If it's recent only. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetAssetResourcesAsync(string filter, string orderby, int? skip, int? maxpagesize, string mark, string responseType, IEnumerable responseIncludes, bool? recentOnly, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssetResourcesRequest(filter, orderby, skip, pageSizeHint, mark, responseType, responseIncludes, recentOnly, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssetResourcesNextPageRequest(nextLink, filter, orderby, skip, pageSizeHint, mark, responseType, responseIncludes, recentOnly, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetAssetResources", "value", "nextLink", maxpagesize, context); } /// - /// [Protocol Method] Cancel a task by taskId. + /// [Protocol Method] Retrieve a list of assets for the provided search parameters. /// /// /// @@ -2015,70 +3506,68 @@ public virtual async Task CancelTaskAsync(string taskId, RequestContex /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// The unique identifier of the task. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response. + /// Specify the response type. The possible values are: ID, STANDARD, FULL, REDUCED. Allowed values: "id" | "standard" | "full" | "reduced". + /// The properties to include in the response. + /// If it's recent only. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. - /// The response returned from the service. - /// - public virtual Response CancelTask(string taskId, RequestContext context) + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetAssetResources(string filter, string orderby, int? skip, int? maxpagesize, string mark, string responseType, IEnumerable responseIncludes, bool? recentOnly, RequestContext context) { - Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); - - using var scope = ClientDiagnostics.CreateScope("EasmClient.CancelTask"); - scope.Start(); - try - { - using HttpMessage message = CreateCancelTaskRequest(taskId, context); - return _pipeline.ProcessMessage(message, context); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssetResourcesRequest(filter, orderby, skip, pageSizeHint, mark, responseType, responseIncludes, recentOnly, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssetResourcesNextPageRequest(nextLink, filter, orderby, skip, pageSizeHint, mark, responseType, responseIncludes, recentOnly, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetAssetResources", "value", "nextLink", maxpagesize, context); } - /// Retrieve a list of assets for the provided search parameters. - /// Filter the result list using the given expression. - /// A list of expressions that specify the order of the returned resources. + /// Retrieve a list of deltas for the provided time range. + /// Body parameter. /// The number of result items to skip. /// The maximum number of result items per page. - /// Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response. /// The cancellation token to use. - /// - public virtual AsyncPageable GetAssetResourcesAsync(string filter = null, string orderby = null, int? skip = null, int? maxpagesize = null, string mark = null, CancellationToken cancellationToken = default) + /// is null. + /// + public virtual AsyncPageable GetDeltaDetailsAsync(DeltaDetailsRequest body, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(body, nameof(body)); + + RequestContent content = body.ToRequestContent(); RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssetResourcesRequest(filter, orderby, skip, pageSizeHint, mark, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssetResourcesNextPageRequest(nextLink, filter, orderby, skip, pageSizeHint, mark, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AssetResource.DeserializeAssetResource(e), ClientDiagnostics, _pipeline, "EasmClient.GetAssetResources", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeltaDetailsRequest(content, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeltaDetailsNextPageRequest(nextLink, content, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DeltaResult.DeserializeDeltaResult(e), ClientDiagnostics, _pipeline, "EasmClient.GetDeltaDetails", "value", "nextLink", maxpagesize, context); } - /// Retrieve a list of assets for the provided search parameters. - /// Filter the result list using the given expression. - /// A list of expressions that specify the order of the returned resources. + /// Retrieve a list of deltas for the provided time range. + /// Body parameter. /// The number of result items to skip. /// The maximum number of result items per page. - /// Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response. /// The cancellation token to use. - /// - public virtual Pageable GetAssetResources(string filter = null, string orderby = null, int? skip = null, int? maxpagesize = null, string mark = null, CancellationToken cancellationToken = default) + /// is null. + /// + public virtual Pageable GetDeltaDetails(DeltaDetailsRequest body, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(body, nameof(body)); + + RequestContent content = body.ToRequestContent(); RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssetResourcesRequest(filter, orderby, skip, pageSizeHint, mark, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssetResourcesNextPageRequest(nextLink, filter, orderby, skip, pageSizeHint, mark, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AssetResource.DeserializeAssetResource(e), ClientDiagnostics, _pipeline, "EasmClient.GetAssetResources", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeltaDetailsRequest(content, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeltaDetailsNextPageRequest(nextLink, content, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DeltaResult.DeserializeDeltaResult(e), ClientDiagnostics, _pipeline, "EasmClient.GetDeltaDetails", "value", "nextLink", maxpagesize, context); } /// - /// [Protocol Method] Retrieve a list of assets for the provided search parameters. + /// [Protocol Method] Retrieve a list of deltas for the provided time range. /// /// /// @@ -2087,29 +3576,30 @@ public virtual Pageable GetAssetResources(string filter = null, s /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// Filter the result list using the given expression. - /// A list of expressions that specify the order of the returned resources. + /// The content to send as the body of the request. /// The number of result items to skip. /// The maximum number of result items per page. - /// Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. /// Service returned a non-success status code. /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetAssetResourcesAsync(string filter, string orderby, int? skip, int? maxpagesize, string mark, RequestContext context) + /// + public virtual AsyncPageable GetDeltaDetailsAsync(RequestContent content, int? skip = null, int? maxpagesize = null, RequestContext context = null) { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssetResourcesRequest(filter, orderby, skip, pageSizeHint, mark, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssetResourcesNextPageRequest(nextLink, filter, orderby, skip, pageSizeHint, mark, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetAssetResources", "value", "nextLink", maxpagesize, context); + Argument.AssertNotNull(content, nameof(content)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeltaDetailsRequest(content, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeltaDetailsNextPageRequest(nextLink, content, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDeltaDetails", "value", "nextLink", maxpagesize, context); } /// - /// [Protocol Method] Retrieve a list of assets for the provided search parameters. + /// [Protocol Method] Retrieve a list of deltas for the provided time range. /// /// /// @@ -2118,25 +3608,26 @@ public virtual AsyncPageable GetAssetResourcesAsync(string filter, s /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// /// - /// Filter the result list using the given expression. - /// A list of expressions that specify the order of the returned resources. + /// The content to send as the body of the request. /// The number of result items to skip. /// The maximum number of result items per page. - /// Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. /// Service returned a non-success status code. /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetAssetResources(string filter, string orderby, int? skip, int? maxpagesize, string mark, RequestContext context) + /// + public virtual Pageable GetDeltaDetails(RequestContent content, int? skip = null, int? maxpagesize = null, RequestContext context = null) { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssetResourcesRequest(filter, orderby, skip, pageSizeHint, mark, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssetResourcesNextPageRequest(nextLink, filter, orderby, skip, pageSizeHint, mark, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetAssetResources", "value", "nextLink", maxpagesize, context); + Argument.AssertNotNull(content, nameof(content)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeltaDetailsRequest(content, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeltaDetailsNextPageRequest(nextLink, content, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDeltaDetails", "value", "nextLink", maxpagesize, context); } /// Retrieve a list of data connections. @@ -2226,13 +3717,13 @@ public virtual Pageable GetDataConnections(int? skip, int? maxpagesi /// The number of result items to skip. /// The maximum number of result items per page. /// The cancellation token to use. - /// - public virtual AsyncPageable GetDiscoveryGroupsAsync(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + /// + public virtual AsyncPageable GetDiscoGroupsAsync(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) { RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoveryGroupsRequest(filter, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoveryGroupsNextPageRequest(nextLink, filter, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DiscoveryGroup.DeserializeDiscoveryGroup(e), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoveryGroups", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoGroupsRequest(filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoGroupsNextPageRequest(nextLink, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DiscoveryGroup.DeserializeDiscoveryGroup(e), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoGroups", "value", "nextLink", maxpagesize, context); } /// Retrieve a list of discovery group for the provided search parameters. @@ -2240,13 +3731,13 @@ public virtual AsyncPageable GetDiscoveryGroupsAsync(string filt /// The number of result items to skip. /// The maximum number of result items per page. /// The cancellation token to use. - /// - public virtual Pageable GetDiscoveryGroups(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + /// + public virtual Pageable GetDiscoGroups(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) { RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoveryGroupsRequest(filter, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoveryGroupsNextPageRequest(nextLink, filter, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DiscoveryGroup.DeserializeDiscoveryGroup(e), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoveryGroups", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoGroupsRequest(filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoGroupsNextPageRequest(nextLink, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DiscoveryGroup.DeserializeDiscoveryGroup(e), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoGroups", "value", "nextLink", maxpagesize, context); } /// @@ -2259,7 +3750,7 @@ public virtual Pageable GetDiscoveryGroups(string filter = null, /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -2270,12 +3761,12 @@ public virtual Pageable GetDiscoveryGroups(string filter = null, /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// Service returned a non-success status code. /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetDiscoveryGroupsAsync(string filter, int? skip, int? maxpagesize, RequestContext context) + /// + public virtual AsyncPageable GetDiscoGroupsAsync(string filter, int? skip, int? maxpagesize, RequestContext context) { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoveryGroupsRequest(filter, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoveryGroupsNextPageRequest(nextLink, filter, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoveryGroups", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoGroupsRequest(filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoGroupsNextPageRequest(nextLink, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoGroups", "value", "nextLink", maxpagesize, context); } /// @@ -2288,7 +3779,7 @@ public virtual AsyncPageable GetDiscoveryGroupsAsync(string filter, /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -2299,12 +3790,12 @@ public virtual AsyncPageable GetDiscoveryGroupsAsync(string filter, /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// Service returned a non-success status code. /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetDiscoveryGroups(string filter, int? skip, int? maxpagesize, RequestContext context) + /// + public virtual Pageable GetDiscoGroups(string filter, int? skip, int? maxpagesize, RequestContext context) { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoveryGroupsRequest(filter, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoveryGroupsNextPageRequest(nextLink, filter, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoveryGroups", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoGroupsRequest(filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoGroupsNextPageRequest(nextLink, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoGroups", "value", "nextLink", maxpagesize, context); } /// Retrieve a collection of discovery run results for a discovery group with a given groupName. @@ -2315,15 +3806,15 @@ public virtual Pageable GetDiscoveryGroups(string filter, int? skip, /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - /// - public virtual AsyncPageable GetDiscoveryGroupRunsAsync(string groupName, string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + /// + public virtual AsyncPageable GetRunsAsync(string groupName, string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoveryGroupRunsRequest(groupName, filter, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoveryGroupRunsNextPageRequest(nextLink, groupName, filter, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DiscoveryRunResult.DeserializeDiscoveryRunResult(e), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoveryGroupRuns", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRunsRequest(groupName, filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRunsNextPageRequest(nextLink, groupName, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DiscoveryRunResult.DeserializeDiscoveryRunResult(e), ClientDiagnostics, _pipeline, "EasmClient.GetRuns", "value", "nextLink", maxpagesize, context); } /// Retrieve a collection of discovery run results for a discovery group with a given groupName. @@ -2334,15 +3825,15 @@ public virtual AsyncPageable GetDiscoveryGroupRunsAsync(stri /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - /// - public virtual Pageable GetDiscoveryGroupRuns(string groupName, string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + /// + public virtual Pageable GetRuns(string groupName, string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoveryGroupRunsRequest(groupName, filter, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoveryGroupRunsNextPageRequest(nextLink, groupName, filter, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DiscoveryRunResult.DeserializeDiscoveryRunResult(e), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoveryGroupRuns", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRunsRequest(groupName, filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRunsNextPageRequest(nextLink, groupName, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DiscoveryRunResult.DeserializeDiscoveryRunResult(e), ClientDiagnostics, _pipeline, "EasmClient.GetRuns", "value", "nextLink", maxpagesize, context); } /// @@ -2355,7 +3846,7 @@ public virtual Pageable GetDiscoveryGroupRuns(string groupNa /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -2369,14 +3860,14 @@ public virtual Pageable GetDiscoveryGroupRuns(string groupNa /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetDiscoveryGroupRunsAsync(string groupName, string filter, int? skip, int? maxpagesize, RequestContext context) + /// + public virtual AsyncPageable GetRunsAsync(string groupName, string filter, int? skip, int? maxpagesize, RequestContext context) { Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoveryGroupRunsRequest(groupName, filter, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoveryGroupRunsNextPageRequest(nextLink, groupName, filter, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoveryGroupRuns", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRunsRequest(groupName, filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRunsNextPageRequest(nextLink, groupName, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetRuns", "value", "nextLink", maxpagesize, context); } /// @@ -2389,7 +3880,7 @@ public virtual AsyncPageable GetDiscoveryGroupRunsAsync(string group /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -2403,14 +3894,14 @@ public virtual AsyncPageable GetDiscoveryGroupRunsAsync(string group /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetDiscoveryGroupRuns(string groupName, string filter, int? skip, int? maxpagesize, RequestContext context) + /// + public virtual Pageable GetRuns(string groupName, string filter, int? skip, int? maxpagesize, RequestContext context) { Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoveryGroupRunsRequest(groupName, filter, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoveryGroupRunsNextPageRequest(nextLink, groupName, filter, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoveryGroupRuns", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRunsRequest(groupName, filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRunsNextPageRequest(nextLink, groupName, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetRuns", "value", "nextLink", maxpagesize, context); } /// Retrieve a list of disco templates for the provided search parameters. @@ -2418,13 +3909,13 @@ public virtual Pageable GetDiscoveryGroupRuns(string groupName, stri /// The number of result items to skip. /// The maximum number of result items per page. /// The cancellation token to use. - /// - public virtual AsyncPageable GetDiscoveryTemplatesAsync(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + /// + public virtual AsyncPageable GetDiscoTemplatesAsync(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) { RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoveryTemplatesRequest(filter, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoveryTemplatesNextPageRequest(nextLink, filter, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DiscoveryTemplate.DeserializeDiscoveryTemplate(e), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoveryTemplates", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoTemplatesRequest(filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoTemplatesNextPageRequest(nextLink, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DiscoveryTemplate.DeserializeDiscoveryTemplate(e), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoTemplates", "value", "nextLink", maxpagesize, context); } /// Retrieve a list of disco templates for the provided search parameters. @@ -2432,13 +3923,13 @@ public virtual AsyncPageable GetDiscoveryTemplatesAsync(strin /// The number of result items to skip. /// The maximum number of result items per page. /// The cancellation token to use. - /// - public virtual Pageable GetDiscoveryTemplates(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + /// + public virtual Pageable GetDiscoTemplates(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) { RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoveryTemplatesRequest(filter, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoveryTemplatesNextPageRequest(nextLink, filter, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DiscoveryTemplate.DeserializeDiscoveryTemplate(e), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoveryTemplates", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoTemplatesRequest(filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoTemplatesNextPageRequest(nextLink, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DiscoveryTemplate.DeserializeDiscoveryTemplate(e), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoTemplates", "value", "nextLink", maxpagesize, context); } /// @@ -2451,7 +3942,7 @@ public virtual Pageable GetDiscoveryTemplates(string filter = /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -2462,12 +3953,12 @@ public virtual Pageable GetDiscoveryTemplates(string filter = /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// Service returned a non-success status code. /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual AsyncPageable GetDiscoveryTemplatesAsync(string filter, int? skip, int? maxpagesize, RequestContext context) + /// + public virtual AsyncPageable GetDiscoTemplatesAsync(string filter, int? skip, int? maxpagesize, RequestContext context) { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoveryTemplatesRequest(filter, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoveryTemplatesNextPageRequest(nextLink, filter, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoveryTemplates", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoTemplatesRequest(filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoTemplatesNextPageRequest(nextLink, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoTemplates", "value", "nextLink", maxpagesize, context); } /// @@ -2480,7 +3971,7 @@ public virtual AsyncPageable GetDiscoveryTemplatesAsync(string filte /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -2491,12 +3982,12 @@ public virtual AsyncPageable GetDiscoveryTemplatesAsync(string filte /// The request context, which can override default behaviors of the client pipeline on a per-call basis. /// Service returned a non-success status code. /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. - /// - public virtual Pageable GetDiscoveryTemplates(string filter, int? skip, int? maxpagesize, RequestContext context) + /// + public virtual Pageable GetDiscoTemplates(string filter, int? skip, int? maxpagesize, RequestContext context) { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoveryTemplatesRequest(filter, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoveryTemplatesNextPageRequest(nextLink, filter, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoveryTemplates", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoTemplatesRequest(filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoTemplatesNextPageRequest(nextLink, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoTemplates", "value", "nextLink", maxpagesize, context); } /// Retrieve a list of saved filters for the provided search parameters. @@ -2670,19 +4161,283 @@ public virtual AsyncPageable GetTasksAsync(string filter, string ord /// public virtual Pageable GetTasks(string filter, string orderby, int? skip, int? maxpagesize, RequestContext context) { - HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTasksRequest(filter, orderby, skip, pageSizeHint, context); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTasksNextPageRequest(nextLink, filter, orderby, skip, pageSizeHint, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetTasks", "value", "nextLink", maxpagesize, context); + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTasksRequest(filter, orderby, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTasksNextPageRequest(nextLink, filter, orderby, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetTasks", "value", "nextLink", maxpagesize, context); + } + + /// Retrieve a list of CisaCves for the provided search parameters. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetCisaCvesAsync(CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetCisaCvesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetCisaCvesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => CisaCveResult.DeserializeCisaCveResult(e), ClientDiagnostics, _pipeline, "EasmClient.GetCisaCves", "value", "nextLink", context); + } + + /// Retrieve a list of CisaCves for the provided search parameters. + /// The cancellation token to use. + /// + public virtual Pageable GetCisaCves(CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetCisaCvesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetCisaCvesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => CisaCveResult.DeserializeCisaCveResult(e), ClientDiagnostics, _pipeline, "EasmClient.GetCisaCves", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a list of CisaCves for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetCisaCvesAsync(RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetCisaCvesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetCisaCvesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetCisaCves", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a list of CisaCves for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetCisaCves(RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetCisaCvesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetCisaCvesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetCisaCves", "value", "nextLink", context); + } + + /// Retrieve a list of policies for the provided search parameters. + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetPoliciesAsync(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetPoliciesRequest(filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetPoliciesNextPageRequest(nextLink, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => Policy.DeserializePolicy(e), ClientDiagnostics, _pipeline, "EasmClient.GetPolicies", "value", "nextLink", maxpagesize, context); + } + + /// Retrieve a list of policies for the provided search parameters. + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetPolicies(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetPoliciesRequest(filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetPoliciesNextPageRequest(nextLink, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => Policy.DeserializePolicy(e), ClientDiagnostics, _pipeline, "EasmClient.GetPolicies", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Retrieve a list of policies for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetPoliciesAsync(string filter, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetPoliciesRequest(filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetPoliciesNextPageRequest(nextLink, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetPolicies", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] Retrieve a list of policies for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetPolicies(string filter, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetPoliciesRequest(filter, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetPoliciesNextPageRequest(nextLink, filter, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetPolicies", "value", "nextLink", maxpagesize, context); + } + + internal HttpMessage CreateGetAssetResourcesRequest(string filter, string orderby, int? skip, int? maxpagesize, string mark, string responseType, IEnumerable responseIncludes, bool? recentOnly, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/assets", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (orderby != null) + { + uri.AppendQuery("orderby", orderby, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (mark != null) + { + uri.AppendQuery("mark", mark, true); + } + if (responseType != null) + { + uri.AppendQuery("responseType", responseType, true); + } + if (responseIncludes != null && !(responseIncludes is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined)) + { + uri.AppendQueryDelimited("responseIncludes", responseIncludes, ",", true); + } + if (recentOnly != null) + { + uri.AppendQuery("recentOnly", recentOnly.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateUpdateAssetsRequest(string filter, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/assets", false); + uri.AppendQuery("filter", filter, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetAssetResourceRequest(string assetId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/assets/", false); + uri.AppendPath(assetId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAssetsExportRequest(RequestContent content, string filter, string orderby, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/assets:export", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (orderby != null) + { + uri.AppendQuery("orderby", orderby, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; } - internal HttpMessage CreateGetAssetResourcesRequest(string filter, string orderby, int? skip, int? maxpagesize, string mark, RequestContext context) + internal HttpMessage CreateGetObservationsRequest(string assetId, string filter, string orderby, int? skip, int? maxpagesize, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/assets", false); + uri.AppendPath("/assets/", false); + uri.AppendPath(assetId, true); + uri.AppendPath(":getObservations", false); uri.AppendQuery("api-version", _apiVersion, true); if (filter != null) { @@ -2700,25 +4455,28 @@ internal HttpMessage CreateGetAssetResourcesRequest(string filter, string orderb { uri.AppendQuery("maxpagesize", maxpagesize.Value, true); } - if (mark != null) - { - uri.AppendQuery("mark", mark, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } - internal HttpMessage CreateUpdateAssetsRequest(string filter, RequestContent content, RequestContext context) + internal HttpMessage CreateGetDeltaDetailsRequest(RequestContent content, int? skip, int? maxpagesize, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/assets", false); - uri.AppendQuery("filter", filter, true); + uri.AppendPath("/assets:getDeltaDetails", false); uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -2726,18 +4484,19 @@ internal HttpMessage CreateUpdateAssetsRequest(string filter, RequestContent con return message; } - internal HttpMessage CreateGetAssetResourceRequest(string assetId, RequestContext context) + internal HttpMessage CreateGetDeltaSummaryRequest(RequestContent content, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/assets/", false); - uri.AppendPath(assetId, true); + uri.AppendPath("/assets:getDeltaSummary", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; return message; } @@ -2826,7 +4585,7 @@ internal HttpMessage CreateDeleteDataConnectionRequest(string dataConnectionName return message; } - internal HttpMessage CreateGetDiscoveryGroupsRequest(string filter, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetDiscoGroupsRequest(string filter, int? skip, int? maxpagesize, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -2852,7 +4611,7 @@ internal HttpMessage CreateGetDiscoveryGroupsRequest(string filter, int? skip, i return message; } - internal HttpMessage CreateValidateDiscoveryGroupRequest(RequestContent content, RequestContext context) + internal HttpMessage CreateValidateDiscoGroupRequest(RequestContent content, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -2868,7 +4627,7 @@ internal HttpMessage CreateValidateDiscoveryGroupRequest(RequestContent content, return message; } - internal HttpMessage CreateGetDiscoveryGroupRequest(string groupName, RequestContext context) + internal HttpMessage CreateGetDiscoGroupRequest(string groupName, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -2883,7 +4642,22 @@ internal HttpMessage CreateGetDiscoveryGroupRequest(string groupName, RequestCon return message; } - internal HttpMessage CreateCreateOrReplaceDiscoveryGroupRequest(string groupName, RequestContent content, RequestContext context) + internal HttpMessage CreateDeleteDiscoGroupRequest(string groupName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/discoGroups/", false); + uri.AppendPath(groupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrReplaceDiscoGroupRequest(string groupName, RequestContent content, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -2900,7 +4674,7 @@ internal HttpMessage CreateCreateOrReplaceDiscoveryGroupRequest(string groupName return message; } - internal HttpMessage CreateRunDiscoveryGroupRequest(string groupName, RequestContext context) + internal HttpMessage CreateRunDiscoGroupRequest(string groupName, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier204); var request = message.Request; @@ -2916,7 +4690,7 @@ internal HttpMessage CreateRunDiscoveryGroupRequest(string groupName, RequestCon return message; } - internal HttpMessage CreateGetDiscoveryGroupRunsRequest(string groupName, string filter, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetRunsRequest(string groupName, string filter, int? skip, int? maxpagesize, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -2944,7 +4718,39 @@ internal HttpMessage CreateGetDiscoveryGroupRunsRequest(string groupName, string return message; } - internal HttpMessage CreateGetDiscoveryTemplatesRequest(string filter, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetAssetChainSummaryRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/discoGroups:getAssetChainSummary", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDismissAssetChainRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/discoGroups:dismissAssetChain", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetDiscoTemplatesRequest(string filter, int? skip, int? maxpagesize, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -2970,7 +4776,7 @@ internal HttpMessage CreateGetDiscoveryTemplatesRequest(string filter, int? skip return message; } - internal HttpMessage CreateGetDiscoveryTemplateRequest(string templateId, RequestContext context) + internal HttpMessage CreateGetDiscoTemplateRequest(string templateId, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -3031,6 +4837,22 @@ internal HttpMessage CreateGetSummaryRequest(RequestContent content, RequestCont return message; } + internal HttpMessage CreateGetSnapshotExportRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/reports/assets:getSnapshotExport", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + internal HttpMessage CreateGetSavedFiltersRequest(string filter, int? skip, int? maxpagesize, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); @@ -3165,7 +4987,154 @@ internal HttpMessage CreateCancelTaskRequest(string taskId, RequestContext conte return message; } - internal HttpMessage CreateGetAssetResourcesNextPageRequest(string nextLink, string filter, string orderby, int? skip, int? maxpagesize, string mark, RequestContext context) + internal HttpMessage CreateRunTaskRequest(string taskId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/tasks/", false); + uri.AppendPath(taskId, true); + uri.AppendPath(":run", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDownloadTaskRequest(string taskId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/tasks/", false); + uri.AppendPath(taskId, true); + uri.AppendPath(":download", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetCisaCvesRequest(RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/cisaCves", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetCisaCveRequest(string cveId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/cisaCves/", false); + uri.AppendPath(cveId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetPoliciesRequest(string filter, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/policies", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetPolicyRequest(string policyName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/policies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeletePolicyRequest(string policyName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/policies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrReplacePolicyRequest(string policyName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/policies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetAssetResourcesNextPageRequest(string nextLink, string filter, string orderby, int? skip, int? maxpagesize, string mark, string responseType, IEnumerable responseIncludes, bool? recentOnly, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + 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"); + return message; + } + + internal HttpMessage CreateGetDeltaDetailsNextPageRequest(string nextLink, RequestContent content, int? skip, int? maxpagesize, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -3191,7 +5160,7 @@ internal HttpMessage CreateGetDataConnectionsNextPageRequest(string nextLink, in return message; } - internal HttpMessage CreateGetDiscoveryGroupsNextPageRequest(string nextLink, string filter, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetDiscoGroupsNextPageRequest(string nextLink, string filter, int? skip, int? maxpagesize, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -3204,7 +5173,7 @@ internal HttpMessage CreateGetDiscoveryGroupsNextPageRequest(string nextLink, st return message; } - internal HttpMessage CreateGetDiscoveryGroupRunsNextPageRequest(string nextLink, string groupName, string filter, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetRunsNextPageRequest(string nextLink, string groupName, string filter, int? skip, int? maxpagesize, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -3217,7 +5186,7 @@ internal HttpMessage CreateGetDiscoveryGroupRunsNextPageRequest(string nextLink, return message; } - internal HttpMessage CreateGetDiscoveryTemplatesNextPageRequest(string nextLink, string filter, int? skip, int? maxpagesize, RequestContext context) + internal HttpMessage CreateGetDiscoTemplatesNextPageRequest(string nextLink, string filter, int? skip, int? maxpagesize, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -3256,6 +5225,32 @@ internal HttpMessage CreateGetTasksNextPageRequest(string nextLink, string filte return message; } + internal HttpMessage CreateGetCisaCvesNextPageRequest(string nextLink, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + 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"); + return message; + } + + internal HttpMessage CreateGetPoliciesNextPageRequest(string nextLink, string filter, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + 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"); + return message; + } + private static RequestContext DefaultRequestContext = new RequestContext(); internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) { diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClientOptions.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClientOptions.cs index e5ea46ee7b0b..fcd44b47a299 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClientOptions.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClientOptions.cs @@ -13,13 +13,17 @@ namespace Azure.Analytics.Defender.Easm /// Client options for EasmClient. public partial class EasmClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2023_03_01_Preview; + private const ServiceVersion LatestVersion = ServiceVersion.V2024_10_01_Preview; /// The version of the service to use. public enum ServiceVersion { /// Service version "2023-03-01-preview". V2023_03_01_Preview = 1, + /// Service version "2024-03-01-preview". + V2024_03_01_Preview = 2, + /// Service version "2024-10-01-preview". + V2024_10_01_Preview = 3, } internal string Version { get; } @@ -30,6 +34,8 @@ public EasmClientOptions(ServiceVersion version = LatestVersion) Version = version switch { ServiceVersion.V2023_03_01_Preview => "2023-03-01-preview", + ServiceVersion.V2024_03_01_Preview => "2024-03-01-preview", + ServiceVersion.V2024_10_01_Preview => "2024-10-01-preview", _ => throw new NotSupportedException() }; } diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorResponse.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorResponse.Serialization.cs new file mode 100644 index 000000000000..8d89f2cb0524 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorResponse.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.Analytics.Defender.Easm +{ + public partial class ErrorResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ErrorResponse)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ErrorResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ErrorResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeErrorResponse(document.RootElement, options); + } + + internal static ErrorResponse DeserializeErrorResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("error"u8)) + { + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ErrorResponse(error, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ErrorResponse)} does not support writing '{options.Format}' format."); + } + } + + ErrorResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeErrorResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ErrorResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ErrorResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeErrorResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorResponse.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorResponse.cs new file mode 100644 index 000000000000..0c6fbbace0f6 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorResponse.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Analytics.Defender.Easm +{ + /// A response containing error details. + public partial class ErrorResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 error object. + /// is null. + internal ErrorResponse(ResponseError error) + { + Argument.AssertNotNull(error, nameof(error)); + + Error = error; + } + + /// Initializes a new instance of . + /// The error object. + /// Keeps track of any properties unknown to the library. + internal ErrorResponse(ResponseError error, IDictionary serializedAdditionalRawData) + { + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ErrorResponse() + { + } + + /// The error object. + public ResponseError Error { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GlobalAssetType.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GlobalAssetType.cs new file mode 100644 index 000000000000..abbea0eb2c06 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GlobalAssetType.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.Analytics.Defender.Easm +{ + /// A list of global asset type. + public readonly partial struct GlobalAssetType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public GlobalAssetType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PageValue = "page"; + private const string ResourceValue = "resource"; + private const string MailServerValue = "mailServer"; + private const string NameServerValue = "nameServer"; + private const string HostValue = "host"; + private const string DomainValue = "domain"; + private const string IpAddressValue = "ipAddress"; + private const string IpBlockValue = "ipBlock"; + private const string AsValue = "as"; + private const string ContactValue = "contact"; + private const string SslCertValue = "sslCert"; + + /// page. + public static GlobalAssetType Page { get; } = new GlobalAssetType(PageValue); + /// resource. + public static GlobalAssetType Resource { get; } = new GlobalAssetType(ResourceValue); + /// mail server. + public static GlobalAssetType MailServer { get; } = new GlobalAssetType(MailServerValue); + /// name server. + public static GlobalAssetType NameServer { get; } = new GlobalAssetType(NameServerValue); + /// host. + public static GlobalAssetType Host { get; } = new GlobalAssetType(HostValue); + /// domain. + public static GlobalAssetType Domain { get; } = new GlobalAssetType(DomainValue); + /// ip address. + public static GlobalAssetType IpAddress { get; } = new GlobalAssetType(IpAddressValue); + /// ip block. + public static GlobalAssetType IpBlock { get; } = new GlobalAssetType(IpBlockValue); + /// autonomous system number. + public static GlobalAssetType As { get; } = new GlobalAssetType(AsValue); + /// contact. + public static GlobalAssetType Contact { get; } = new GlobalAssetType(ContactValue); + /// ssl certificate. + public static GlobalAssetType SslCert { get; } = new GlobalAssetType(SslCertValue); + /// Determines if two values are the same. + public static bool operator ==(GlobalAssetType left, GlobalAssetType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(GlobalAssetType left, GlobalAssetType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator GlobalAssetType(string value) => new GlobalAssetType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is GlobalAssetType other && Equals(other); + /// + public bool Equals(GlobalAssetType 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/easm/Azure.Analytics.Defender.Easm/src/Generated/GlobalInventoryState.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GlobalInventoryState.cs new file mode 100644 index 000000000000..04687d59ea84 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GlobalInventoryState.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + /// A list of global inventory states. + public readonly partial struct GlobalInventoryState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public GlobalInventoryState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CandidateValue = "candidate"; + private const string CandidateInvestigateValue = "candidateInvestigate"; + private const string ConfirmedValue = "confirmed"; + private const string AssociatedValue = "associated"; + private const string AssociatedPartnerValue = "associatedPartner"; + private const string AssociatedThirdPartyValue = "associatedThirdParty"; + private const string ArchivedValue = "archived"; + private const string DismissedValue = "dismissed"; + private const string AutoconfirmedValue = "autoconfirmed"; + + /// candidate. + public static GlobalInventoryState Candidate { get; } = new GlobalInventoryState(CandidateValue); + /// candidate investigate. + public static GlobalInventoryState CandidateInvestigate { get; } = new GlobalInventoryState(CandidateInvestigateValue); + /// confirmed. + public static GlobalInventoryState Confirmed { get; } = new GlobalInventoryState(ConfirmedValue); + /// associated. + public static GlobalInventoryState Associated { get; } = new GlobalInventoryState(AssociatedValue); + /// associated partner. + public static GlobalInventoryState AssociatedPartner { get; } = new GlobalInventoryState(AssociatedPartnerValue); + /// associated third party. + public static GlobalInventoryState AssociatedThirdParty { get; } = new GlobalInventoryState(AssociatedThirdPartyValue); + /// archived. + public static GlobalInventoryState Archived { get; } = new GlobalInventoryState(ArchivedValue); + /// dismissed. + public static GlobalInventoryState Dismissed { get; } = new GlobalInventoryState(DismissedValue); + /// auto confirmed. + public static GlobalInventoryState Autoconfirmed { get; } = new GlobalInventoryState(AutoconfirmedValue); + /// Determines if two values are the same. + public static bool operator ==(GlobalInventoryState left, GlobalInventoryState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(GlobalInventoryState left, GlobalInventoryState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator GlobalInventoryState(string value) => new GlobalInventoryState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is GlobalInventoryState other && Equals(other); + /// + public bool Equals(GlobalInventoryState 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/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnection.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnection.cs index 02d610eaa298..16cf7f223be9 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnection.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnection.cs @@ -26,13 +26,13 @@ internal LogAnalyticsDataConnection(LogAnalyticsDataConnectionProperties propert /// Initializes a new instance of . /// Discriminator property for DataConnection. - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. /// The caller provided unique name for the resource. /// The name that can be used for display purposes. /// The type of data the data connection will transfer. /// The date the data connection was created. /// The rate at which the data connection will receive updates. - /// The day to update the data connection on. + /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly). /// The date the data connection was last updated. /// The date the data connection was last updated by user. /// An indicator of whether the data connection is active. diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionPayload.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionPayload.cs index 8548b2b8e98f..e1613dab0c06 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionPayload.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionPayload.cs @@ -25,7 +25,7 @@ public LogAnalyticsDataConnectionPayload(LogAnalyticsDataConnectionProperties pr } /// Initializes a new instance of . - /// Discriminator property for DataConnectionPayload. + /// Discriminator property for DataConnectionData. /// The name of data connection. /// The type of data the data connection will transfer. /// The rate at which the data connection will receive updates. diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationPageResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationPageResult.Serialization.cs new file mode 100644 index 000000000000..532686c899d5 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationPageResult.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ObservationPageResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ObservationPageResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("totalElements"u8); + writer.WriteNumberValue(TotalElements); + writer.WritePropertyName("prioritySummary"u8); + writer.WriteStartObject(); + foreach (var item in PrioritySummary) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + 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 + } + } + } + + ObservationPageResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ObservationPageResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeObservationPageResult(document.RootElement, options); + } + + internal static ObservationPageResult DeserializeObservationPageResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long totalElements = default; + IReadOnlyDictionary prioritySummary = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("totalElements"u8)) + { + totalElements = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("prioritySummary"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetInt32()); + } + prioritySummary = dictionary; + continue; + } + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservationResult.DeserializeObservationResult(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ObservationPageResult(totalElements, prioritySummary, value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ObservationPageResult)} does not support writing '{options.Format}' format."); + } + } + + ObservationPageResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeObservationPageResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ObservationPageResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ObservationPageResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeObservationPageResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationPageResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationPageResult.cs new file mode 100644 index 000000000000..78d316e3b890 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationPageResult.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; +using System.Linq; + +namespace Azure.Analytics.Defender.Easm +{ + /// The page result response for the observation. + public partial class ObservationPageResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 total number of elements. + /// The summary of observation counts by priority. + /// The list of observation results. + /// or is null. + internal ObservationPageResult(long totalElements, IReadOnlyDictionary prioritySummary, IEnumerable value) + { + Argument.AssertNotNull(prioritySummary, nameof(prioritySummary)); + Argument.AssertNotNull(value, nameof(value)); + + TotalElements = totalElements; + PrioritySummary = prioritySummary; + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The total number of elements. + /// The summary of observation counts by priority. + /// The list of observation results. + /// Keeps track of any properties unknown to the library. + internal ObservationPageResult(long totalElements, IReadOnlyDictionary prioritySummary, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + TotalElements = totalElements; + PrioritySummary = prioritySummary; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ObservationPageResult() + { + } + + /// The total number of elements. + public long TotalElements { get; } + /// The summary of observation counts by priority. + public IReadOnlyDictionary PrioritySummary { get; } + /// The list of observation results. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationPriority.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationPriority.cs new file mode 100644 index 000000000000..340da33eedf4 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationPriority.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.Analytics.Defender.Easm +{ + /// A list of observation priorities. + public readonly partial struct ObservationPriority : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ObservationPriority(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HighValue = "high"; + private const string MediumValue = "medium"; + private const string LowValue = "low"; + private const string NoneValue = "none"; + + /// high. + public static ObservationPriority High { get; } = new ObservationPriority(HighValue); + /// medium. + public static ObservationPriority Medium { get; } = new ObservationPriority(MediumValue); + /// low. + public static ObservationPriority Low { get; } = new ObservationPriority(LowValue); + /// none. + public static ObservationPriority None { get; } = new ObservationPriority(NoneValue); + /// Determines if two values are the same. + public static bool operator ==(ObservationPriority left, ObservationPriority right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ObservationPriority left, ObservationPriority right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ObservationPriority(string value) => new ObservationPriority(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ObservationPriority other && Equals(other); + /// + public bool Equals(ObservationPriority 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/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationItem.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationItem.Serialization.cs new file mode 100644 index 000000000000..9736e04ea287 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationItem.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.Analytics.Defender.Easm +{ + public partial class ObservationRemediationItem : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ObservationRemediationItem)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.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 + } + } + } + + ObservationRemediationItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ObservationRemediationItem)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeObservationRemediationItem(document.RootElement, options); + } + + internal static ObservationRemediationItem DeserializeObservationRemediationItem(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ObservationType kind = default; + string name = default; + ObservationRemediationState state = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = new ObservationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + state = new ObservationRemediationState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ObservationRemediationItem(kind, name, state, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ObservationRemediationItem)} does not support writing '{options.Format}' format."); + } + } + + ObservationRemediationItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeObservationRemediationItem(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ObservationRemediationItem)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ObservationRemediationItem FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeObservationRemediationItem(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationItem.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationItem.cs new file mode 100644 index 000000000000..12dc86c1aac5 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationItem.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.Analytics.Defender.Easm +{ + /// This is an object that contains the observation remediation information that is used as part of the asset update. + public partial class ObservationRemediationItem + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 kind of the observation to remediate. + /// The name of the observation to remediate. + /// The state to which to update the observation. + /// is null. + public ObservationRemediationItem(ObservationType kind, string name, ObservationRemediationState state) + { + Argument.AssertNotNull(name, nameof(name)); + + Kind = kind; + Name = name; + State = state; + } + + /// Initializes a new instance of . + /// The kind of the observation to remediate. + /// The name of the observation to remediate. + /// The state to which to update the observation. + /// Keeps track of any properties unknown to the library. + internal ObservationRemediationItem(ObservationType kind, string name, ObservationRemediationState state, IDictionary serializedAdditionalRawData) + { + Kind = kind; + Name = name; + State = state; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ObservationRemediationItem() + { + } + + /// The kind of the observation to remediate. + public ObservationType Kind { get; } + /// The name of the observation to remediate. + public string Name { get; } + /// The state to which to update the observation. + public ObservationRemediationState State { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationSource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationSource.cs new file mode 100644 index 000000000000..0753e543249f --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationSource.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.Analytics.Defender.Easm +{ + /// A list of observation remediation sources. + public readonly partial struct ObservationRemediationSource : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ObservationRemediationSource(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UserValue = "user"; + private const string SystemValue = "system"; + + /// The source of the observation state is a user. + public static ObservationRemediationSource User { get; } = new ObservationRemediationSource(UserValue); + /// The source of the observation state is the system. + public static ObservationRemediationSource System { get; } = new ObservationRemediationSource(SystemValue); + /// Determines if two values are the same. + public static bool operator ==(ObservationRemediationSource left, ObservationRemediationSource right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ObservationRemediationSource left, ObservationRemediationSource right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ObservationRemediationSource(string value) => new ObservationRemediationSource(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ObservationRemediationSource other && Equals(other); + /// + public bool Equals(ObservationRemediationSource 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/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationState.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationState.cs new file mode 100644 index 000000000000..d945499b1aef --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationRemediationState.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.Analytics.Defender.Easm +{ + /// A list of observation states. + public readonly partial struct ObservationRemediationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ObservationRemediationState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "active"; + private const string NonApplicableValue = "nonApplicable"; + + /// active. + public static ObservationRemediationState Active { get; } = new ObservationRemediationState(ActiveValue); + /// nonApplicable. + public static ObservationRemediationState NonApplicable { get; } = new ObservationRemediationState(NonApplicableValue); + /// Determines if two values are the same. + public static bool operator ==(ObservationRemediationState left, ObservationRemediationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ObservationRemediationState left, ObservationRemediationState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ObservationRemediationState(string value) => new ObservationRemediationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ObservationRemediationState other && Equals(other); + /// + public bool Equals(ObservationRemediationState 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/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationResult.Serialization.cs new file mode 100644 index 000000000000..8a8cfa8c8ed2 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationResult.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ObservationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ObservationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("types"u8); + writer.WriteStartArray(); + foreach (var item in Types) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + writer.WritePropertyName("priority"u8); + writer.WriteStringValue(Priority.ToString()); + writer.WritePropertyName("cvssScoreV2"u8); + writer.WriteNumberValue(CvssScoreV2); + writer.WritePropertyName("cvssScoreV3"u8); + writer.WriteNumberValue(CvssScoreV3); + writer.WritePropertyName("remediationState"u8); + writer.WriteStringValue(RemediationState.ToString()); + writer.WritePropertyName("remediationSource"u8); + writer.WriteStringValue(RemediationSource.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 + } + } + } + + ObservationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ObservationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeObservationResult(document.RootElement, options); + } + + internal static ObservationResult DeserializeObservationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IReadOnlyList types = default; + ObservationPriority priority = default; + double cvssScoreV2 = default; + double cvssScoreV3 = default; + ObservationRemediationState remediationState = default; + ObservationRemediationSource remediationSource = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("types"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new ObservationType(item.GetString())); + } + types = array; + continue; + } + if (property.NameEquals("priority"u8)) + { + priority = new ObservationPriority(property.Value.GetString()); + continue; + } + if (property.NameEquals("cvssScoreV2"u8)) + { + cvssScoreV2 = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("cvssScoreV3"u8)) + { + cvssScoreV3 = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("remediationState"u8)) + { + remediationState = new ObservationRemediationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("remediationSource"u8)) + { + remediationSource = new ObservationRemediationSource(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ObservationResult( + name, + types, + priority, + cvssScoreV2, + cvssScoreV3, + remediationState, + remediationSource, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ObservationResult)} does not support writing '{options.Format}' format."); + } + } + + ObservationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeObservationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ObservationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ObservationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeObservationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationResult.cs new file mode 100644 index 000000000000..bd0fe6f7bba0 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationResult.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.Analytics.Defender.Easm +{ + /// The result response for the observation. + public partial class ObservationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 observation. + /// The list of applicable types. + /// The priority of the observation. + /// The CVSS v2 score. + /// The CVSS v3 score. + /// The remediation state of the observation. + /// The source of the remediation state of the observation. + /// or is null. + internal ObservationResult(string name, IEnumerable types, ObservationPriority priority, double cvssScoreV2, double cvssScoreV3, ObservationRemediationState remediationState, ObservationRemediationSource remediationSource) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(types, nameof(types)); + + Name = name; + Types = types.ToList(); + Priority = priority; + CvssScoreV2 = cvssScoreV2; + CvssScoreV3 = cvssScoreV3; + RemediationState = remediationState; + RemediationSource = remediationSource; + } + + /// Initializes a new instance of . + /// The name of the observation. + /// The list of applicable types. + /// The priority of the observation. + /// The CVSS v2 score. + /// The CVSS v3 score. + /// The remediation state of the observation. + /// The source of the remediation state of the observation. + /// Keeps track of any properties unknown to the library. + internal ObservationResult(string name, IReadOnlyList types, ObservationPriority priority, double cvssScoreV2, double cvssScoreV3, ObservationRemediationState remediationState, ObservationRemediationSource remediationSource, IDictionary serializedAdditionalRawData) + { + Name = name; + Types = types; + Priority = priority; + CvssScoreV2 = cvssScoreV2; + CvssScoreV3 = cvssScoreV3; + RemediationState = remediationState; + RemediationSource = remediationSource; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ObservationResult() + { + } + + /// The name of the observation. + public string Name { get; } + /// The list of applicable types. + public IReadOnlyList Types { get; } + /// The priority of the observation. + public ObservationPriority Priority { get; } + /// The CVSS v2 score. + public double CvssScoreV2 { get; } + /// The CVSS v3 score. + public double CvssScoreV3 { get; } + /// The remediation state of the observation. + public ObservationRemediationState RemediationState { get; } + /// The source of the remediation state of the observation. + public ObservationRemediationSource RemediationSource { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationType.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationType.cs new file mode 100644 index 000000000000..fce69cb9055e --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservationType.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.Analytics.Defender.Easm +{ + /// A list of observation types. + public readonly partial struct ObservationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ObservationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CveValue = "cve"; + private const string InsightValue = "insight"; + + /// common vulnerabilities and exposures. + public static ObservationType Cve { get; } = new ObservationType(CveValue); + /// insight. + public static ObservationType Insight { get; } = new ObservationType(InsightValue); + /// Determines if two values are the same. + public static bool operator ==(ObservationType left, ObservationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ObservationType left, ObservationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ObservationType(string value) => new ObservationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ObservationType other && Equals(other); + /// + public bool Equals(ObservationType 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/easm/Azure.Analytics.Defender.Easm/src/Generated/Policy.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Policy.Serialization.cs new file mode 100644 index 000000000000..e1fc55a5ef87 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Policy.Serialization.cs @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class Policy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Policy)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("filterName"u8); + writer.WriteStringValue(FilterName); + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.ToString()); + if (options.Format != "W" && Optional.IsDefined(UpdatedAssetsCount)) + { + writer.WritePropertyName("updatedAssetsCount"u8); + writer.WriteNumberValue(UpdatedAssetsCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(User)) + { + writer.WritePropertyName("user"u8); + writer.WriteStringValue(User); + } + if (options.Format != "W" && Optional.IsDefined(CreatedDate)) + { + writer.WritePropertyName("createdDate"u8); + writer.WriteStringValue(CreatedDate.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedDate)) + { + writer.WritePropertyName("updatedDate"u8); + writer.WriteStringValue(UpdatedDate.Value, "O"); + } + writer.WritePropertyName("actionParameters"u8); + writer.WriteObjectValue(ActionParameters, 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 + } + } + } + + Policy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Policy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePolicy(document.RootElement, options); + } + + internal static Policy DeserializePolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string name = default; + string displayName = default; + string description = default; + string filterName = default; + PolicyAction action = default; + long? updatedAssetsCount = default; + string user = default; + DateTimeOffset? createdDate = default; + DateTimeOffset? updatedDate = default; + ActionParameters actionParameters = 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("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("filterName"u8)) + { + filterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("action"u8)) + { + action = new PolicyAction(property.Value.GetString()); + continue; + } + if (property.NameEquals("updatedAssetsCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedAssetsCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("user"u8)) + { + user = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("actionParameters"u8)) + { + actionParameters = ActionParameters.DeserializeActionParameters(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Policy( + id, + name, + displayName, + description, + filterName, + action, + updatedAssetsCount, + user, + createdDate, + updatedDate, + actionParameters, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Policy)} does not support writing '{options.Format}' format."); + } + } + + Policy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Policy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Policy FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePolicy(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Policy.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Policy.cs new file mode 100644 index 000000000000..a33bce6beb0d --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Policy.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Analytics.Defender.Easm +{ + /// This is an object that exists to provide a common schema definition for the policy response. + public partial class Policy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Name of the saved filter query to be used to select assets that are to be updated by a given policy. + /// Action specifying what the policy should do. + /// Additional parameters needed to perform the policy action. + /// or is null. + public Policy(string filterName, PolicyAction action, ActionParameters actionParameters) + { + Argument.AssertNotNull(filterName, nameof(filterName)); + Argument.AssertNotNull(actionParameters, nameof(actionParameters)); + + FilterName = filterName; + Action = action; + ActionParameters = actionParameters; + } + + /// Initializes a new instance of . + /// This is typically the same as the name but might be different for different models. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// A human readable description of what the policy should do. + /// Name of the saved filter query to be used to select assets that are to be updated by a given policy. + /// Action specifying what the policy should do. + /// Number of assets in inventory that have been updated by this policy. + /// The unique name of the user that created the policy user@gmail.com. + /// The date this policy was created, in RFC3339 format. + /// The date this policy was last updated, in RFC3339 format. + /// Additional parameters needed to perform the policy action. + /// Keeps track of any properties unknown to the library. + internal Policy(string id, string name, string displayName, string description, string filterName, PolicyAction action, long? updatedAssetsCount, string user, DateTimeOffset? createdDate, DateTimeOffset? updatedDate, ActionParameters actionParameters, IDictionary serializedAdditionalRawData) + { + Id = id; + Name = name; + DisplayName = displayName; + Description = description; + FilterName = filterName; + Action = action; + UpdatedAssetsCount = updatedAssetsCount; + User = user; + CreatedDate = createdDate; + UpdatedDate = updatedDate; + ActionParameters = actionParameters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Policy() + { + } + + /// This is typically the same as the name but might be different for different models. + public string Id { get; } + /// The caller provided unique name for the resource. + public string Name { get; } + /// The name that can be used for display purposes. + public string DisplayName { get; } + /// A human readable description of what the policy should do. + public string Description { get; set; } + /// Name of the saved filter query to be used to select assets that are to be updated by a given policy. + public string FilterName { get; set; } + /// Action specifying what the policy should do. + public PolicyAction Action { get; set; } + /// Number of assets in inventory that have been updated by this policy. + public long? UpdatedAssetsCount { get; } + /// The unique name of the user that created the policy user@gmail.com. + public string User { get; } + /// The date this policy was created, in RFC3339 format. + public DateTimeOffset? CreatedDate { get; } + /// The date this policy was last updated, in RFC3339 format. + public DateTimeOffset? UpdatedDate { get; } + /// Additional parameters needed to perform the policy action. + public ActionParameters ActionParameters { get; set; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PolicyAction.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PolicyAction.cs new file mode 100644 index 000000000000..cbb4dbb1d203 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PolicyAction.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.Analytics.Defender.Easm +{ + /// A list of policy actions. + public readonly partial struct PolicyAction : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PolicyAction(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AddResourceValue = "addResource"; + private const string RemoveResourceValue = "removeResource"; + private const string SetStateValue = "setState"; + private const string SetExternalIDValue = "setExternalID"; + private const string RemoveFromInventoryValue = "removeFromInventory"; + + /// Add a resource label with a given name. + public static PolicyAction AddResource { get; } = new PolicyAction(AddResourceValue); + /// Remove a resource label with a given name. + public static PolicyAction RemoveResource { get; } = new PolicyAction(RemoveResourceValue); + /// Set inventory state to a given supported state value. + public static PolicyAction SetState { get; } = new PolicyAction(SetStateValue); + /// Set an external id. + public static PolicyAction SetExternalID { get; } = new PolicyAction(SetExternalIDValue); + /// Remove from inventory. + public static PolicyAction RemoveFromInventory { get; } = new PolicyAction(RemoveFromInventoryValue); + /// Determines if two values are the same. + public static bool operator ==(PolicyAction left, PolicyAction right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PolicyAction left, PolicyAction right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PolicyAction(string value) => new PolicyAction(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PolicyAction other && Equals(other); + /// + public bool Equals(PolicyAction 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/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotExportPayload.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotExportPayload.Serialization.cs new file mode 100644 index 000000000000..0e5f7fb40f4c --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotExportPayload.Serialization.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ReportAssetSnapshotExportPayload : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReportAssetSnapshotExportPayload)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Metric)) + { + writer.WritePropertyName("metric"u8); + writer.WriteStringValue(Metric); + } + if (Optional.IsDefined(FileName)) + { + writer.WritePropertyName("fileName"u8); + writer.WriteStringValue(FileName); + } + if (Optional.IsCollectionDefined(Columns)) + { + writer.WritePropertyName("columns"u8); + writer.WriteStartArray(); + foreach (var item in Columns) + { + 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 + } + } + } + + ReportAssetSnapshotExportPayload IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReportAssetSnapshotExportPayload)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReportAssetSnapshotExportPayload(document.RootElement, options); + } + + internal static ReportAssetSnapshotExportPayload DeserializeReportAssetSnapshotExportPayload(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string metric = default; + string fileName = default; + IList columns = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("metric"u8)) + { + metric = property.Value.GetString(); + continue; + } + if (property.NameEquals("fileName"u8)) + { + fileName = property.Value.GetString(); + continue; + } + if (property.NameEquals("columns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + columns = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReportAssetSnapshotExportPayload(metric, fileName, columns ?? 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(ReportAssetSnapshotExportPayload)} does not support writing '{options.Format}' format."); + } + } + + ReportAssetSnapshotExportPayload IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReportAssetSnapshotExportPayload(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReportAssetSnapshotExportPayload)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ReportAssetSnapshotExportPayload FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReportAssetSnapshotExportPayload(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotExportPayload.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotExportPayload.cs new file mode 100644 index 000000000000..afe9bdf23965 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotExportPayload.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.Analytics.Defender.Easm +{ + /// A request body used for an asset report snapshot export. + public partial class ReportAssetSnapshotExportPayload + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ReportAssetSnapshotExportPayload() + { + Columns = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The metric to retrieve a snapshot for. + /// The filename of the exported file. + /// The columns to include in the export. + /// Keeps track of any properties unknown to the library. + internal ReportAssetSnapshotExportPayload(string metric, string fileName, IList columns, IDictionary serializedAdditionalRawData) + { + Metric = metric; + FileName = fileName; + Columns = columns; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The metric to retrieve a snapshot for. + public string Metric { get; set; } + /// The filename of the exported file. + public string FileName { get; set; } + /// The columns to include in the export. + public IList Columns { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilter.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilter.cs index a5cbd4cc4be7..a40d1041a929 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilter.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilter.cs @@ -51,7 +51,7 @@ internal SavedFilter() } /// Initializes a new instance of . - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. /// The caller provided unique name for the resource. /// The name that can be used for display purposes. /// @@ -67,7 +67,7 @@ internal SavedFilter(string id, string name, string displayName, string filter, _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. public string Id { get; } /// The caller provided unique name for the resource. public string Name { get; } diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnection.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnection.cs index 58f0f96e44a4..ba74d6e2b559 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnection.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnection.cs @@ -15,13 +15,13 @@ internal partial class UnknownDataConnection : DataConnection { /// Initializes a new instance of . /// Discriminator property for DataConnection. - /// The system generated unique id for the resource. + /// This is typically the same as the name but might be different for different models. /// The caller provided unique name for the resource. /// The name that can be used for display purposes. /// The type of data the data connection will transfer. /// The date the data connection was created. /// The rate at which the data connection will receive updates. - /// The day to update the data connection on. + /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly). /// The date the data connection was last updated. /// The date the data connection was last updated by user. /// An indicator of whether the data connection is active. diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnectionPayload.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnectionPayload.cs index e675efb20269..a0229b61062a 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnectionPayload.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnectionPayload.cs @@ -14,7 +14,7 @@ namespace Azure.Analytics.Defender.Easm internal partial class UnknownDataConnectionPayload : DataConnectionPayload { /// Initializes a new instance of . - /// Discriminator property for DataConnectionPayload. + /// Discriminator property for DataConnectionData. /// The name of data connection. /// The type of data the data connection will transfer. /// The rate at which the data connection will receive updates. diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/tests/Generated/Samples/Samples_EasmClient.cs b/sdk/easm/Azure.Analytics.Defender.Easm/tests/Generated/Samples/Samples_EasmClient.cs index 437666172da9..60569ec52214 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/tests/Generated/Samples/Samples_EasmClient.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/tests/Generated/Samples/Samples_EasmClient.cs @@ -6,6 +6,7 @@ #nullable disable using System; +using System.Collections.Generic; using System.Text.Json; using System.Threading.Tasks; using Azure.Core; @@ -32,6 +33,21 @@ public void Example_AssetResource_UpdateAssets_AssetsUpdateAssets() { contosoLabel = true, }, + remediations = new object[] + { +new +{ +name = "CVE-0000-00000", +kind = "cve", +state = "active", +}, +new +{ +name = "This is an insight", +kind = "insight", +state = "nonApplicable", +} + }, }); Response response = client.UpdateAssets("state%20%3D%20%22confirmed%22%20AND%20name%20%5E%3D%20%22contoso.com%22", content); @@ -55,6 +71,21 @@ public async Task Example_AssetResource_UpdateAssets_AssetsUpdateAssets_Async() { contosoLabel = true, }, + remediations = new object[] + { +new +{ +name = "CVE-0000-00000", +kind = "cve", +state = "active", +}, +new +{ +name = "This is an insight", +kind = "insight", +state = "nonApplicable", +} + }, }); Response response = await client.UpdateAssetsAsync("state%20%3D%20%22confirmed%22%20AND%20name%20%5E%3D%20%22contoso.com%22", content); @@ -78,6 +109,7 @@ public void Example_AssetResource_UpdateAssets_AssetsUpdateAssets_Convenience() { ["contosoLabel"] = true }, + Remediations = { new ObservationRemediationItem(ObservationType.Cve, "CVE-0000-00000", ObservationRemediationState.Active), new ObservationRemediationItem(ObservationType.Insight, "This is an insight", ObservationRemediationState.NonApplicable) }, }; Response response = client.UpdateAssets("state%20%3D%20%22confirmed%22%20AND%20name%20%5E%3D%20%22contoso.com%22", body); } @@ -98,6 +130,7 @@ public async Task Example_AssetResource_UpdateAssets_AssetsUpdateAssets_Convenie { ["contosoLabel"] = true }, + Remediations = { new ObservationRemediationItem(ObservationType.Cve, "CVE-0000-00000", ObservationRemediationState.Active), new ObservationRemediationItem(ObservationType.Insight, "This is an insight", ObservationRemediationState.NonApplicable) }, }; Response response = await client.UpdateAssetsAsync("state%20%3D%20%22confirmed%22%20AND%20name%20%5E%3D%20%22contoso.com%22", body); } @@ -154,6 +187,238 @@ public async Task Example_AssetResource_GetAssetResource_AssetsGetAssetResource_ Response response = await client.GetAssetResourceAsync("aG9zdCQkY29udG9zby5jb20"); } + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_GetAssetsExport_AssetsGetAssetsExport() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + fileName = "ThisisaFileName", + columns = new object[] + { +"asset", +"name" + }, + }); + Response response = client.GetAssetsExport(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_GetAssetsExport_AssetsGetAssetsExport_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + fileName = "ThisisaFileName", + columns = new object[] + { +"asset", +"name" + }, + }); + Response response = await client.GetAssetsExportAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_GetAssetsExport_AssetsGetAssetsExport_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + AssetsExportRequest body = new AssetsExportRequest("ThisisaFileName", new string[] { "asset", "name" }); + Response response = client.GetAssetsExport(body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_GetAssetsExport_AssetsGetAssetsExport_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + AssetsExportRequest body = new AssetsExportRequest("ThisisaFileName", new string[] { "asset", "name" }); + Response response = await client.GetAssetsExportAsync(body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_GetObservations_AssetsGetObservations() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = client.GetObservations("aG9zdCQkY29udG9zby5jb20", null, null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("totalElements").ToString()); + Console.WriteLine(result.GetProperty("prioritySummary").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("types")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("cvssScoreV2").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("cvssScoreV3").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("remediationState").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("remediationSource").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_GetObservations_AssetsGetObservations_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = await client.GetObservationsAsync("aG9zdCQkY29udG9zby5jb20", null, null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("totalElements").ToString()); + Console.WriteLine(result.GetProperty("prioritySummary").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("types")[0].ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("priority").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("cvssScoreV2").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("cvssScoreV3").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("remediationState").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("remediationSource").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_GetObservations_AssetsGetObservations_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = client.GetObservations("aG9zdCQkY29udG9zby5jb20"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_GetObservations_AssetsGetObservations_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = await client.GetObservationsAsync("aG9zdCQkY29udG9zby5jb20"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_GetDeltaSummary_AssetsGetDeltaSummary() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + priorDays = 30, + date = "2024-03-17", + }); + Response response = client.GetDeltaSummary(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("summary").GetProperty("range").ToString()); + Console.WriteLine(result.GetProperty("summary").GetProperty("removed").ToString()); + Console.WriteLine(result.GetProperty("summary").GetProperty("added").ToString()); + Console.WriteLine(result.GetProperty("summary").GetProperty("difference").ToString()); + Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("removed").ToString()); + Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("added").ToString()); + Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("difference").ToString()); + Console.WriteLine(result.GetProperty("daily")[0].GetProperty("date").ToString()); + Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("count").ToString()); + Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("removed").ToString()); + Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("added").ToString()); + Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("difference").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_GetDeltaSummary_AssetsGetDeltaSummary_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + priorDays = 30, + date = "2024-03-17", + }); + Response response = await client.GetDeltaSummaryAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("summary").GetProperty("range").ToString()); + Console.WriteLine(result.GetProperty("summary").GetProperty("removed").ToString()); + Console.WriteLine(result.GetProperty("summary").GetProperty("added").ToString()); + Console.WriteLine(result.GetProperty("summary").GetProperty("difference").ToString()); + Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("removed").ToString()); + Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("added").ToString()); + Console.WriteLine(result.GetProperty("summary").GetProperty("kindSummaries")[0].GetProperty("difference").ToString()); + Console.WriteLine(result.GetProperty("daily")[0].GetProperty("date").ToString()); + Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("count").ToString()); + Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("removed").ToString()); + Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("added").ToString()); + Console.WriteLine(result.GetProperty("daily")[0].GetProperty("deltas")[0].GetProperty("difference").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_GetDeltaSummary_AssetsGetDeltaSummary_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + DeltaSummaryRequest body = new DeltaSummaryRequest + { + PriorDays = 30, + Date = "2024-03-17", + }; + Response response = client.GetDeltaSummary(body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_GetDeltaSummary_AssetsGetDeltaSummary_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + DeltaSummaryRequest body = new DeltaSummaryRequest + { + PriorDays = 30, + Date = "2024-03-17", + }; + Response response = await client.GetDeltaSummaryAsync(body); + } + [Test] [Ignore("Only validating compilation of examples")] public void Example_EasmClient_ValidateDataConnection_DataConnectionsValidateDataConnection() @@ -420,7 +685,7 @@ public async Task Example_DataConnection_DeleteDataConnection_DataConnectionsDel [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValidateDiscoGroup() + public void Example_EasmClient_ValidateDiscoGroup_DiscoveryGroupsValidateDiscoGroup() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -428,6 +693,7 @@ public void Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValidateDis using RequestContent content = RequestContent.Create(new { + name = "ThisisaDiscoGroup", description = "This is a disco group", frequencyMilliseconds = 604800000L, tier = "advanced", @@ -440,7 +706,7 @@ public void Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValidateDis } }, }); - Response response = client.ValidateDiscoveryGroup(content); + Response response = client.ValidateDiscoGroup(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.ToString()); @@ -448,7 +714,7 @@ public void Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValidateDis [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValidateDiscoGroup_Async() + public async Task Example_EasmClient_ValidateDiscoGroup_DiscoveryGroupsValidateDiscoGroup_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -456,6 +722,7 @@ public async Task Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValid using RequestContent content = RequestContent.Create(new { + name = "ThisisaDiscoGroup", description = "This is a disco group", frequencyMilliseconds = 604800000L, tier = "advanced", @@ -468,7 +735,7 @@ public async Task Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValid } }, }); - Response response = await client.ValidateDiscoveryGroupAsync(content); + Response response = await client.ValidateDiscoGroupAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.ToString()); @@ -476,7 +743,7 @@ public async Task Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValid [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValidateDiscoGroup_Convenience() + public void Example_EasmClient_ValidateDiscoGroup_DiscoveryGroupsValidateDiscoGroup_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -484,6 +751,7 @@ public void Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValidateDis DiscoveryGroupPayload body = new DiscoveryGroupPayload { + Name = "ThisisaDiscoGroup", Description = "This is a disco group", Tier = "advanced", FrequencyMilliseconds = 604800000L, @@ -493,12 +761,12 @@ public void Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValidateDis Name = "thisisatest.microsoft.com", }}, }; - Response response = client.ValidateDiscoveryGroup(body); + Response response = client.ValidateDiscoGroup(body); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValidateDiscoGroup_Convenience_Async() + public async Task Example_EasmClient_ValidateDiscoGroup_DiscoveryGroupsValidateDiscoGroup_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -506,6 +774,7 @@ public async Task Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValid DiscoveryGroupPayload body = new DiscoveryGroupPayload { + Name = "ThisisaDiscoGroup", Description = "This is a disco group", Tier = "advanced", FrequencyMilliseconds = 604800000L, @@ -515,18 +784,18 @@ public async Task Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValid Name = "thisisatest.microsoft.com", }}, }; - Response response = await client.ValidateDiscoveryGroupAsync(body); + Response response = await client.ValidateDiscoGroupAsync(body); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_GetDiscoveryGroup_DiscoveryGroupsGetDiscoGroup() + public void Example_DiscoGroup_GetDiscoGroup_DiscoveryGroupsGetDiscoGroup() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.GetDiscoveryGroup("ThisisaDiscoGroup", null); + Response response = client.GetDiscoGroup("ThisisaDiscoGroup", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -534,13 +803,13 @@ public void Example_DiscoGroup_GetDiscoveryGroup_DiscoveryGroupsGetDiscoGroup() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_GetDiscoveryGroup_DiscoveryGroupsGetDiscoGroup_Async() + public async Task Example_DiscoGroup_GetDiscoGroup_DiscoveryGroupsGetDiscoGroup_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.GetDiscoveryGroupAsync("ThisisaDiscoGroup", null); + Response response = await client.GetDiscoGroupAsync("ThisisaDiscoGroup", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -548,29 +817,55 @@ public async Task Example_DiscoGroup_GetDiscoveryGroup_DiscoveryGroupsGetDiscoGr [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_GetDiscoveryGroup_DiscoveryGroupsGetDiscoGroup_Convenience() + public void Example_DiscoGroup_GetDiscoGroup_DiscoveryGroupsGetDiscoGroup_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = client.GetDiscoGroup("ThisisaDiscoGroup"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DiscoGroup_GetDiscoGroup_DiscoveryGroupsGetDiscoGroup_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = await client.GetDiscoGroupAsync("ThisisaDiscoGroup"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DiscoGroup_DeleteDiscoGroup_DiscoveryGroupsDeleteDiscoGroup() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.GetDiscoveryGroup("ThisisaDiscoGroup"); + Response response = client.DeleteDiscoGroup("ThisisaDiscoGroup"); + + Console.WriteLine(response.Status); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_GetDiscoveryGroup_DiscoveryGroupsGetDiscoGroup_Convenience_Async() + public async Task Example_DiscoGroup_DeleteDiscoGroup_DiscoveryGroupsDeleteDiscoGroup_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.GetDiscoveryGroupAsync("ThisisaDiscoGroup"); + Response response = await client.DeleteDiscoGroupAsync("ThisisaDiscoGroup"); + + Console.WriteLine(response.Status); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_DiscoveryGroupsCreateOrReplaceDiscoGroup() + public void Example_DiscoGroup_CreateOrReplaceDiscoGroup_DiscoveryGroupsCreateOrReplaceDiscoGroup() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -590,7 +885,7 @@ public void Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_DiscoveryGroupsCrea } }, }); - Response response = client.CreateOrReplaceDiscoveryGroup("ThisisaDiscoGroup", content); + Response response = client.CreateOrReplaceDiscoGroup("ThisisaDiscoGroup", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -598,7 +893,7 @@ public void Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_DiscoveryGroupsCrea [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_DiscoveryGroupsCreateOrReplaceDiscoGroup_Async() + public async Task Example_DiscoGroup_CreateOrReplaceDiscoGroup_DiscoveryGroupsCreateOrReplaceDiscoGroup_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -618,7 +913,7 @@ public async Task Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_DiscoveryGrou } }, }); - Response response = await client.CreateOrReplaceDiscoveryGroupAsync("ThisisaDiscoGroup", content); + Response response = await client.CreateOrReplaceDiscoGroupAsync("ThisisaDiscoGroup", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -626,7 +921,7 @@ public async Task Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_DiscoveryGrou [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_DiscoveryGroupsCreateOrReplaceDiscoGroup_Convenience() + public void Example_DiscoGroup_CreateOrReplaceDiscoGroup_DiscoveryGroupsCreateOrReplaceDiscoGroup_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -643,12 +938,12 @@ public void Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_DiscoveryGroupsCrea Name = "thisisatest.microsoft.com", }}, }; - Response response = client.CreateOrReplaceDiscoveryGroup("ThisisaDiscoGroup", body); + Response response = client.CreateOrReplaceDiscoGroup("ThisisaDiscoGroup", body); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_DiscoveryGroupsCreateOrReplaceDiscoGroup_Convenience_Async() + public async Task Example_DiscoGroup_CreateOrReplaceDiscoGroup_DiscoveryGroupsCreateOrReplaceDiscoGroup_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); @@ -665,221 +960,365 @@ public async Task Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_DiscoveryGrou Name = "thisisatest.microsoft.com", }}, }; - Response response = await client.CreateOrReplaceDiscoveryGroupAsync("ThisisaDiscoGroup", body); + Response response = await client.CreateOrReplaceDiscoGroupAsync("ThisisaDiscoGroup", body); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_RunDiscoveryGroup_DiscoveryGroupsRunDiscoGroup() + public void Example_EasmClient_RunDiscoGroup_DiscoveryGroupsRunDiscoGroup() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.RunDiscoveryGroup("ThisisaDiscoGroup"); + Response response = client.RunDiscoGroup("ThisisaDiscoGroup"); Console.WriteLine(response.Status); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_RunDiscoveryGroup_DiscoveryGroupsRunDiscoGroup_Async() + public async Task Example_EasmClient_RunDiscoGroup_DiscoveryGroupsRunDiscoGroup_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.RunDiscoveryGroupAsync("ThisisaDiscoGroup"); + Response response = await client.RunDiscoGroupAsync("ThisisaDiscoGroup"); Console.WriteLine(response.Status); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoTemplate_GetDiscoveryTemplate_DiscoveryTemplatesGetDiscoTemplate() + public void Example_EasmClient_GetAssetChainSummary_DiscoveryGroupsGetAssetChainSummary() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.GetDiscoveryTemplate("12345", null); + using RequestContent content = RequestContent.Create(new + { + assetChainSource = "ASSET", + sourceIds = new object[] + { +"DOMAIN$$contoso.com" + }, + }); + Response response = client.GetAssetChainSummary(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("affectedAssetsSummary")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("affectedAssetsSummary")[0].GetProperty("affectedCount").ToString()); + Console.WriteLine(result.GetProperty("affectedGroupsSummary")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("affectedGroupsSummary")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("affectedGroupsSummary")[0].GetProperty("displayName").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoTemplate_GetDiscoveryTemplate_DiscoveryTemplatesGetDiscoTemplate_Async() + public async Task Example_EasmClient_GetAssetChainSummary_DiscoveryGroupsGetAssetChainSummary_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.GetDiscoveryTemplateAsync("12345", null); + using RequestContent content = RequestContent.Create(new + { + assetChainSource = "ASSET", + sourceIds = new object[] + { +"DOMAIN$$contoso.com" + }, + }); + Response response = await client.GetAssetChainSummaryAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("affectedAssetsSummary")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("affectedAssetsSummary")[0].GetProperty("affectedCount").ToString()); + Console.WriteLine(result.GetProperty("affectedGroupsSummary")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("affectedGroupsSummary")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("affectedGroupsSummary")[0].GetProperty("displayName").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoTemplate_GetDiscoveryTemplate_DiscoveryTemplatesGetDiscoTemplate_Convenience() + public void Example_EasmClient_GetAssetChainSummary_DiscoveryGroupsGetAssetChainSummary_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.GetDiscoveryTemplate("12345"); + AssetChainRequest body = new AssetChainRequest(AssetChainSource.ASSET, new string[] { "DOMAIN$$contoso.com" }); + Response response = client.GetAssetChainSummary(body); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoTemplate_GetDiscoveryTemplate_DiscoveryTemplatesGetDiscoTemplate_Convenience_Async() + public async Task Example_EasmClient_GetAssetChainSummary_DiscoveryGroupsGetAssetChainSummary_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.GetDiscoveryTemplateAsync("12345"); + AssetChainRequest body = new AssetChainRequest(AssetChainSource.ASSET, new string[] { "DOMAIN$$contoso.com" }); + Response response = await client.GetAssetChainSummaryAsync(body); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_GetBillable_ReportsGetBillable() + public void Example_EasmClient_DismissAssetChain_DiscoveryGroupsDismissAssetChain() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.GetBillable(null); + using RequestContent content = RequestContent.Create(new + { + assetChainSource = "ASSET", + sourceIds = new object[] + { +"DOMAIN$$contoso.com" + }, + }); + Response response = client.DismissAssetChain(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_GetBillable_ReportsGetBillable_Async() + public async Task Example_EasmClient_DismissAssetChain_DiscoveryGroupsDismissAssetChain_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.GetBillableAsync(null); + using RequestContent content = RequestContent.Create(new + { + assetChainSource = "ASSET", + sourceIds = new object[] + { +"DOMAIN$$contoso.com" + }, + }); + Response response = await client.DismissAssetChainAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_GetBillable_ReportsGetBillable_Convenience() + public void Example_EasmClient_DismissAssetChain_DiscoveryGroupsDismissAssetChain_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.GetBillable(); + AssetChainRequest body = new AssetChainRequest(AssetChainSource.ASSET, new string[] { "DOMAIN$$contoso.com" }); + Response response = client.DismissAssetChain(body); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_GetBillable_ReportsGetBillable_Convenience_Async() + public async Task Example_EasmClient_DismissAssetChain_DiscoveryGroupsDismissAssetChain_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.GetBillableAsync(); + AssetChainRequest body = new AssetChainRequest(AssetChainSource.ASSET, new string[] { "DOMAIN$$contoso.com" }); + Response response = await client.DismissAssetChainAsync(body); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_GetSnapshot_ReportsGetSnapshot() + public void Example_DiscoTemplate_GetDiscoTemplate_DiscoveryTemplatesGetDiscoTemplate() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - metric = "site_status_active", - page = 0, - size = 5, - }); - Response response = client.GetSnapshot(content); + Response response = client.GetDiscoTemplate("12345", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_GetSnapshot_ReportsGetSnapshot_Async() + public async Task Example_DiscoTemplate_GetDiscoTemplate_DiscoveryTemplatesGetDiscoTemplate_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - metric = "site_status_active", - page = 0, - size = 5, - }); - Response response = await client.GetSnapshotAsync(content); + Response response = await client.GetDiscoTemplateAsync("12345", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_GetSnapshot_ReportsGetSnapshot_Convenience() + public void Example_DiscoTemplate_GetDiscoTemplate_DiscoveryTemplatesGetDiscoTemplate_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - ReportAssetSnapshotPayload body = new ReportAssetSnapshotPayload - { - Metric = "site_status_active", - Size = 5, - Page = 0, - }; - Response response = client.GetSnapshot(body); + Response response = client.GetDiscoTemplate("12345"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_GetSnapshot_ReportsGetSnapshot_Convenience_Async() + public async Task Example_DiscoTemplate_GetDiscoTemplate_DiscoveryTemplatesGetDiscoTemplate_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - ReportAssetSnapshotPayload body = new ReportAssetSnapshotPayload - { - Metric = "site_status_active", - Size = 5, - Page = 0, - }; - Response response = await client.GetSnapshotAsync(body); + Response response = await client.GetDiscoTemplateAsync("12345"); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_GetSummary_ReportsGetSummary() + public void Example_EasmClient_GetBillable_ReportsGetBillable() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - filters = new object[] - { + Response response = client.GetBillable(null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_GetBillable_ReportsGetBillable_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = await client.GetBillableAsync(null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_GetBillable_ReportsGetBillable_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = client.GetBillable(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_GetBillable_ReportsGetBillable_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = await client.GetBillableAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_GetSnapshot_ReportsGetSnapshot() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + metric = "site_status_active", + page = 0, + size = 5, + }); + Response response = client.GetSnapshot(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_GetSnapshot_ReportsGetSnapshot_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + metric = "site_status_active", + page = 0, + size = 5, + }); + Response response = await client.GetSnapshotAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_GetSnapshot_ReportsGetSnapshot_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + ReportAssetSnapshotPayload body = new ReportAssetSnapshotPayload + { + Metric = "site_status_active", + Size = 5, + Page = 0, + }; + Response response = client.GetSnapshot(body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_GetSnapshot_ReportsGetSnapshot_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + ReportAssetSnapshotPayload body = new ReportAssetSnapshotPayload + { + Metric = "site_status_active", + Size = 5, + Page = 0, + }; + Response response = await client.GetSnapshotAsync(body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_GetSummary_ReportsGetSummary() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + filters = new object[] + { "state = \"confirmed\" AND kind = \"domain\"", "state = \"confirmed\" AND kind = \"host\"", "state = \"confirmed\" AND kind = \"page\"" @@ -888,354 +1327,868 @@ public void Example_EasmClient_GetSummary_ReportsGetSummary() Response response = client.GetSummary(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_GetSummary_ReportsGetSummary_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + filters = new object[] + { +"state = \"confirmed\" AND kind = \"domain\"", +"state = \"confirmed\" AND kind = \"host\"", +"state = \"confirmed\" AND kind = \"page\"" + }, + }); + Response response = await client.GetSummaryAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_GetSummary_ReportsGetSummary_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + ReportAssetSummaryPayload body = new ReportAssetSummaryPayload + { + Filters = { "state = \"confirmed\" AND kind = \"domain\"", "state = \"confirmed\" AND kind = \"host\"", "state = \"confirmed\" AND kind = \"page\"" }, + }; + Response response = client.GetSummary(body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_GetSummary_ReportsGetSummary_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + ReportAssetSummaryPayload body = new ReportAssetSummaryPayload + { + Filters = { "state = \"confirmed\" AND kind = \"domain\"", "state = \"confirmed\" AND kind = \"host\"", "state = \"confirmed\" AND kind = \"page\"" }, + }; + Response response = await client.GetSummaryAsync(body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_GetSnapshotExport_ReportsGetSnapshotExport() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + metric = "ThisisaMetricName", + fileName = "exportedFileName", + columns = new object[] + { +"Column1", +"Column2", +"Column3" + }, + }); + Response response = client.GetSnapshotExport(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_GetSnapshotExport_ReportsGetSnapshotExport_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + metric = "ThisisaMetricName", + fileName = "exportedFileName", + columns = new object[] + { +"Column1", +"Column2", +"Column3" + }, + }); + Response response = await client.GetSnapshotExportAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_GetSnapshotExport_ReportsGetSnapshotExport_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + ReportAssetSnapshotExportPayload body = new ReportAssetSnapshotExportPayload + { + Metric = "ThisisaMetricName", + FileName = "exportedFileName", + Columns = { "Column1", "Column2", "Column3" }, + }; + Response response = client.GetSnapshotExport(body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_GetSnapshotExport_ReportsGetSnapshotExport_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + ReportAssetSnapshotExportPayload body = new ReportAssetSnapshotExportPayload + { + Metric = "ThisisaMetricName", + FileName = "exportedFileName", + Columns = { "Column1", "Column2", "Column3" }, + }; + Response response = await client.GetSnapshotExportAsync(body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SavedFilter_GetSavedFilter_SavedFiltersGetSavedFilter() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = client.GetSavedFilter("ThisisaSavedFilter", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SavedFilter_GetSavedFilter_SavedFiltersGetSavedFilter_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = await client.GetSavedFilterAsync("ThisisaSavedFilter", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SavedFilter_GetSavedFilter_SavedFiltersGetSavedFilter_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = client.GetSavedFilter("ThisisaSavedFilter"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SavedFilter_GetSavedFilter_SavedFiltersGetSavedFilter_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = await client.GetSavedFilterAsync("ThisisaSavedFilter"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SavedFilter_CreateOrReplaceSavedFilter_SavedFiltersCreateOrReplaceSavedFilter() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + filter = "state IN (\"confirmed\")", + description = "This is a saved filter", + }); + Response response = client.CreateOrReplaceSavedFilter("ThisisaSavedFilter", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SavedFilter_CreateOrReplaceSavedFilter_SavedFiltersCreateOrReplaceSavedFilter_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + filter = "state IN (\"confirmed\")", + description = "This is a saved filter", + }); + Response response = await client.CreateOrReplaceSavedFilterAsync("ThisisaSavedFilter", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SavedFilter_CreateOrReplaceSavedFilter_SavedFiltersCreateOrReplaceSavedFilter_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + SavedFilterPayload body = new SavedFilterPayload("state IN (\"confirmed\")", "This is a saved filter"); + Response response = client.CreateOrReplaceSavedFilter("ThisisaSavedFilter", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SavedFilter_CreateOrReplaceSavedFilter_SavedFiltersCreateOrReplaceSavedFilter_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + SavedFilterPayload body = new SavedFilterPayload("state IN (\"confirmed\")", "This is a saved filter"); + Response response = await client.CreateOrReplaceSavedFilterAsync("ThisisaSavedFilter", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SavedFilter_DeleteSavedFilter_SavedFiltersDeleteSavedFilter() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = client.DeleteSavedFilter("ThisisaSavedFilter"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SavedFilter_DeleteSavedFilter_SavedFiltersDeleteSavedFilter_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = await client.DeleteSavedFilterAsync("ThisisaSavedFilter"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Task_GetTask_TasksGetTask() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = client.GetTask("ThisisaTaskId", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Task_GetTask_TasksGetTask_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = await client.GetTaskAsync("ThisisaTaskId", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Task_GetTask_TasksGetTask_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = client.GetTask("ThisisaTaskId"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Task_GetTask_TasksGetTask_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = await client.GetTaskAsync("ThisisaTaskId"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_CancelTask_TasksCancelTask() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = client.CancelTask("ThisisaTaskId", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_CancelTask_TasksCancelTask_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = await client.CancelTaskAsync("ThisisaTaskId", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_CancelTask_TasksCancelTask_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = client.CancelTask("ThisisaTaskId"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_CancelTask_TasksCancelTask_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = await client.CancelTaskAsync("ThisisaTaskId"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_RunTask_TasksRunTask() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = client.RunTask("ThisisaTaskId", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_RunTask_TasksRunTask_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = await client.RunTaskAsync("ThisisaTaskId", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_RunTask_TasksRunTask_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = client.RunTask("ThisisaTaskId"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EasmClient_RunTask_TasksRunTask_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = await client.RunTaskAsync("ThisisaTaskId"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EasmClient_DownloadTask_TasksDownloadTask() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + Response response = client.DownloadTask("ThisisaTaskId", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_GetSummary_ReportsGetSummary_Async() + public async Task Example_EasmClient_DownloadTask_TasksDownloadTask_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - filters = new object[] - { -"state = \"confirmed\" AND kind = \"domain\"", -"state = \"confirmed\" AND kind = \"host\"", -"state = \"confirmed\" AND kind = \"page\"" - }, - }); - Response response = await client.GetSummaryAsync(content); + Response response = await client.DownloadTaskAsync("ThisisaTaskId", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_GetSummary_ReportsGetSummary_Convenience() + public void Example_EasmClient_DownloadTask_TasksDownloadTask_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - ReportAssetSummaryPayload body = new ReportAssetSummaryPayload - { - Filters = { "state = \"confirmed\" AND kind = \"domain\"", "state = \"confirmed\" AND kind = \"host\"", "state = \"confirmed\" AND kind = \"page\"" }, - }; - Response response = client.GetSummary(body); + Response response = client.DownloadTask("ThisisaTaskId"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_GetSummary_ReportsGetSummary_Convenience_Async() + public async Task Example_EasmClient_DownloadTask_TasksDownloadTask_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - ReportAssetSummaryPayload body = new ReportAssetSummaryPayload - { - Filters = { "state = \"confirmed\" AND kind = \"domain\"", "state = \"confirmed\" AND kind = \"host\"", "state = \"confirmed\" AND kind = \"page\"" }, - }; - Response response = await client.GetSummaryAsync(body); + Response response = await client.DownloadTaskAsync("ThisisaTaskId"); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_SavedFilter_GetSavedFilter_SavedFiltersGetSavedFilter() + public void Example_CisaCveResult_GetCisaCve_CisaCvesGetCisaCve() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.GetSavedFilter("ThisisaSavedFilter", null); + Response response = client.GetCisaCve("CVE-2021-40438", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("cveId").ToString()); + Console.WriteLine(result.GetProperty("vendorProject").ToString()); + Console.WriteLine(result.GetProperty("product").ToString()); + Console.WriteLine(result.GetProperty("vulnerabilityName").ToString()); + Console.WriteLine(result.GetProperty("shortDescription").ToString()); + Console.WriteLine(result.GetProperty("requiredAction").ToString()); + Console.WriteLine(result.GetProperty("notes").ToString()); + Console.WriteLine(result.GetProperty("dateAdded").ToString()); + Console.WriteLine(result.GetProperty("dueDate").ToString()); + Console.WriteLine(result.GetProperty("updatedAt").ToString()); + Console.WriteLine(result.GetProperty("count").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_SavedFilter_GetSavedFilter_SavedFiltersGetSavedFilter_Async() + public async Task Example_CisaCveResult_GetCisaCve_CisaCvesGetCisaCve_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.GetSavedFilterAsync("ThisisaSavedFilter", null); + Response response = await client.GetCisaCveAsync("CVE-2021-40438", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("cveId").ToString()); + Console.WriteLine(result.GetProperty("vendorProject").ToString()); + Console.WriteLine(result.GetProperty("product").ToString()); + Console.WriteLine(result.GetProperty("vulnerabilityName").ToString()); + Console.WriteLine(result.GetProperty("shortDescription").ToString()); + Console.WriteLine(result.GetProperty("requiredAction").ToString()); + Console.WriteLine(result.GetProperty("notes").ToString()); + Console.WriteLine(result.GetProperty("dateAdded").ToString()); + Console.WriteLine(result.GetProperty("dueDate").ToString()); + Console.WriteLine(result.GetProperty("updatedAt").ToString()); + Console.WriteLine(result.GetProperty("count").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_SavedFilter_GetSavedFilter_SavedFiltersGetSavedFilter_Convenience() + public void Example_CisaCveResult_GetCisaCve_CisaCvesGetCisaCve_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.GetSavedFilter("ThisisaSavedFilter"); + Response response = client.GetCisaCve("CVE-2021-40438"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_SavedFilter_GetSavedFilter_SavedFiltersGetSavedFilter_Convenience_Async() + public async Task Example_CisaCveResult_GetCisaCve_CisaCvesGetCisaCve_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.GetSavedFilterAsync("ThisisaSavedFilter"); + Response response = await client.GetCisaCveAsync("CVE-2021-40438"); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_SavedFilter_CreateOrReplaceSavedFilter_SavedFiltersCreateOrReplaceSavedFilter() + public void Example_Policy_GetPolicy_PoliciesGetPolicy() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - filter = "state IN (\"confirmed\")", - description = "This is a saved filter", - }); - Response response = client.CreateOrReplaceSavedFilter("ThisisaSavedFilter", content); + Response response = client.GetPolicy("ThisisaPolicy", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("filterName").ToString()); + Console.WriteLine(result.GetProperty("action").ToString()); + Console.WriteLine(result.GetProperty("actionParameters").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_SavedFilter_CreateOrReplaceSavedFilter_SavedFiltersCreateOrReplaceSavedFilter_Async() + public async Task Example_Policy_GetPolicy_PoliciesGetPolicy_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new - { - filter = "state IN (\"confirmed\")", - description = "This is a saved filter", - }); - Response response = await client.CreateOrReplaceSavedFilterAsync("ThisisaSavedFilter", content); + Response response = await client.GetPolicyAsync("ThisisaPolicy", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("filterName").ToString()); + Console.WriteLine(result.GetProperty("action").ToString()); + Console.WriteLine(result.GetProperty("actionParameters").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_SavedFilter_CreateOrReplaceSavedFilter_SavedFiltersCreateOrReplaceSavedFilter_Convenience() + public void Example_Policy_GetPolicy_PoliciesGetPolicy_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - SavedFilterPayload body = new SavedFilterPayload("state IN (\"confirmed\")", "This is a saved filter"); - Response response = client.CreateOrReplaceSavedFilter("ThisisaSavedFilter", body); + Response response = client.GetPolicy("ThisisaPolicy"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_SavedFilter_CreateOrReplaceSavedFilter_SavedFiltersCreateOrReplaceSavedFilter_Convenience_Async() + public async Task Example_Policy_GetPolicy_PoliciesGetPolicy_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - SavedFilterPayload body = new SavedFilterPayload("state IN (\"confirmed\")", "This is a saved filter"); - Response response = await client.CreateOrReplaceSavedFilterAsync("ThisisaSavedFilter", body); + Response response = await client.GetPolicyAsync("ThisisaPolicy"); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_SavedFilter_DeleteSavedFilter_SavedFiltersDeleteSavedFilter() + public void Example_Policy_DeletePolicy_PoliciesDeletePolicy() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.DeleteSavedFilter("ThisisaSavedFilter"); + Response response = client.DeletePolicy("ThisisaPolicy"); Console.WriteLine(response.Status); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_SavedFilter_DeleteSavedFilter_SavedFiltersDeleteSavedFilter_Async() + public async Task Example_Policy_DeletePolicy_PoliciesDeletePolicy_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.DeleteSavedFilterAsync("ThisisaSavedFilter"); + Response response = await client.DeletePolicyAsync("ThisisaPolicy"); Console.WriteLine(response.Status); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_Task_GetTask_TasksGetTask() + public void Example_Policy_CreateOrReplacePolicy_PoliciesCreateOrReplacePolicy() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.GetTask("ThisisaTaskId", null); + using RequestContent content = RequestContent.Create(new + { + filterName = "ThisisaFilter", + description = "This is a policy", + action = "setState", + actionParameters = new + { + value = "confirmed", + }, + }); + Response response = client.CreateOrReplacePolicy("ThisisaPolicy", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("filterName").ToString()); + Console.WriteLine(result.GetProperty("action").ToString()); + Console.WriteLine(result.GetProperty("actionParameters").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Task_GetTask_TasksGetTask_Async() + public async Task Example_Policy_CreateOrReplacePolicy_PoliciesCreateOrReplacePolicy_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.GetTaskAsync("ThisisaTaskId", null); + using RequestContent content = RequestContent.Create(new + { + filterName = "ThisisaFilter", + description = "This is a policy", + action = "setState", + actionParameters = new + { + value = "confirmed", + }, + }); + Response response = await client.CreateOrReplacePolicyAsync("ThisisaPolicy", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("filterName").ToString()); + Console.WriteLine(result.GetProperty("action").ToString()); + Console.WriteLine(result.GetProperty("actionParameters").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_Task_GetTask_TasksGetTask_Convenience() + public void Example_Policy_CreateOrReplacePolicy_PoliciesCreateOrReplacePolicy_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.GetTask("ThisisaTaskId"); + Policy body = new Policy("ThisisaFilter", PolicyAction.SetState, new ActionParameters + { + Value = "confirmed", + }) + { + Description = "This is a policy", + }; + Response response = client.CreateOrReplacePolicy("ThisisaPolicy", body); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Task_GetTask_TasksGetTask_Convenience_Async() + public async Task Example_Policy_CreateOrReplacePolicy_PoliciesCreateOrReplacePolicy_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.GetTaskAsync("ThisisaTaskId"); + Policy body = new Policy("ThisisaFilter", PolicyAction.SetState, new ActionParameters + { + Value = "confirmed", + }) + { + Description = "This is a policy", + }; + Response response = await client.CreateOrReplacePolicyAsync("ThisisaPolicy", body); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_CancelTask_TasksCancelTask() + public void Example_AssetResource_GetAssetResources_AssetsListAssetResource() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.CancelTask("ThisisaTaskId", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); + foreach (BinaryData item in client.GetAssetResources("state%20%3D%20%22confirmed%22", null, 0, 5, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + } } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_CancelTask_TasksCancelTask_Async() + public async Task Example_AssetResource_GetAssetResources_AssetsListAssetResource_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.CancelTaskAsync("ThisisaTaskId", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); + await foreach (BinaryData item in client.GetAssetResourcesAsync("state%20%3D%20%22confirmed%22", null, 0, 5, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + } } [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_CancelTask_TasksCancelTask_Convenience() + public void Example_AssetResource_GetAssetResources_AssetsListAssetResource_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.CancelTask("ThisisaTaskId"); + foreach (AssetResource item in client.GetAssetResources()) + { + } } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_CancelTask_TasksCancelTask_Convenience_Async() + public async Task Example_AssetResource_GetAssetResources_AssetsListAssetResource_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.CancelTaskAsync("ThisisaTaskId"); + await foreach (AssetResource item in client.GetAssetResourcesAsync()) + { + } } [Test] [Ignore("Only validating compilation of examples")] - public void Example_AssetResource_GetAssetResources_AssetsListAssetResource() + public void Example_EasmClient_GetDeltaDetails_AssetsGetDeltaDetails() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - foreach (BinaryData item in client.GetAssetResources("state%20%3D%20%22confirmed%22", null, 0, 5, null, null)) + using RequestContent content = RequestContent.Create(new + { + deltaDetailType = "added", + priorDays = 30, + kind = "domain", + date = "2024-03-17", + }); + foreach (BinaryData item in client.GetDeltaDetails(content)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("updatedAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); } } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_AssetResource_GetAssetResources_AssetsListAssetResource_Async() + public async Task Example_EasmClient_GetDeltaDetails_AssetsGetDeltaDetails_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - await foreach (BinaryData item in client.GetAssetResourcesAsync("state%20%3D%20%22confirmed%22", null, 0, 5, null, null)) + using RequestContent content = RequestContent.Create(new + { + deltaDetailType = "added", + priorDays = 30, + kind = "domain", + date = "2024-03-17", + }); + await foreach (BinaryData item in client.GetDeltaDetailsAsync(content)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("updatedAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); } } [Test] [Ignore("Only validating compilation of examples")] - public void Example_AssetResource_GetAssetResources_AssetsListAssetResource_Convenience() + public void Example_EasmClient_GetDeltaDetails_AssetsGetDeltaDetails_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - foreach (AssetResource item in client.GetAssetResources()) + DeltaDetailsRequest body = new DeltaDetailsRequest(DeltaDetailType.Added, GlobalAssetType.Domain) + { + PriorDays = 30, + Date = "2024-03-17", + }; + foreach (DeltaResult item in client.GetDeltaDetails(body)) { } } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_AssetResource_GetAssetResources_AssetsListAssetResource_Convenience_Async() + public async Task Example_EasmClient_GetDeltaDetails_AssetsGetDeltaDetails_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - await foreach (AssetResource item in client.GetAssetResourcesAsync()) + DeltaDetailsRequest body = new DeltaDetailsRequest(DeltaDetailType.Added, GlobalAssetType.Domain) + { + PriorDays = 30, + Date = "2024-03-17", + }; + await foreach (DeltaResult item in client.GetDeltaDetailsAsync(body)) { } } @@ -1300,13 +2253,13 @@ public async Task Example_DataConnection_GetDataConnections_DataConnectionsListD [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_GetDiscoveryGroups_DiscoveryGroupsListDiscoGroup() + public void Example_DiscoGroup_GetDiscoGroups_DiscoveryGroupsListDiscoGroup() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - foreach (BinaryData item in client.GetDiscoveryGroups(null, null, null, null)) + foreach (BinaryData item in client.GetDiscoGroups(null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -1315,13 +2268,13 @@ public void Example_DiscoGroup_GetDiscoveryGroups_DiscoveryGroupsListDiscoGroup( [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_GetDiscoveryGroups_DiscoveryGroupsListDiscoGroup_Async() + public async Task Example_DiscoGroup_GetDiscoGroups_DiscoveryGroupsListDiscoGroup_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - await foreach (BinaryData item in client.GetDiscoveryGroupsAsync(null, null, null, null)) + await foreach (BinaryData item in client.GetDiscoGroupsAsync(null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -1330,39 +2283,39 @@ public async Task Example_DiscoGroup_GetDiscoveryGroups_DiscoveryGroupsListDisco [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_GetDiscoveryGroups_DiscoveryGroupsListDiscoGroup_Convenience() + public void Example_DiscoGroup_GetDiscoGroups_DiscoveryGroupsListDiscoGroup_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - foreach (DiscoveryGroup item in client.GetDiscoveryGroups()) + foreach (DiscoveryGroup item in client.GetDiscoGroups()) { } } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_GetDiscoveryGroups_DiscoveryGroupsListDiscoGroup_Convenience_Async() + public async Task Example_DiscoGroup_GetDiscoGroups_DiscoveryGroupsListDiscoGroup_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - await foreach (DiscoveryGroup item in client.GetDiscoveryGroupsAsync()) + await foreach (DiscoveryGroup item in client.GetDiscoGroupsAsync()) { } } [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_GetDiscoveryGroupRuns_DiscoveryGroupsListRuns() + public void Example_EasmClient_GetRuns_DiscoveryGroupsListRuns() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - foreach (BinaryData item in client.GetDiscoveryGroupRuns("ThisisaDiscoGroup", null, null, null, null)) + foreach (BinaryData item in client.GetRuns("ThisisaDiscoGroup", null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.ToString()); @@ -1371,13 +2324,13 @@ public void Example_EasmClient_GetDiscoveryGroupRuns_DiscoveryGroupsListRuns() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_GetDiscoveryGroupRuns_DiscoveryGroupsListRuns_Async() + public async Task Example_EasmClient_GetRuns_DiscoveryGroupsListRuns_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - await foreach (BinaryData item in client.GetDiscoveryGroupRunsAsync("ThisisaDiscoGroup", null, null, null, null)) + await foreach (BinaryData item in client.GetRunsAsync("ThisisaDiscoGroup", null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.ToString()); @@ -1386,39 +2339,39 @@ public async Task Example_EasmClient_GetDiscoveryGroupRuns_DiscoveryGroupsListRu [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_GetDiscoveryGroupRuns_DiscoveryGroupsListRuns_Convenience() + public void Example_EasmClient_GetRuns_DiscoveryGroupsListRuns_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRuns("ThisisaDiscoGroup")) + foreach (DiscoveryRunResult item in client.GetRuns("ThisisaDiscoGroup")) { } } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_GetDiscoveryGroupRuns_DiscoveryGroupsListRuns_Convenience_Async() + public async Task Example_EasmClient_GetRuns_DiscoveryGroupsListRuns_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - await foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRunsAsync("ThisisaDiscoGroup")) + await foreach (DiscoveryRunResult item in client.GetRunsAsync("ThisisaDiscoGroup")) { } } [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoTemplate_GetDiscoveryTemplates_DiscoveryTemplatesListDiscoTemplate() + public void Example_DiscoTemplate_GetDiscoTemplates_DiscoveryTemplatesListDiscoTemplate() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - foreach (BinaryData item in client.GetDiscoveryTemplates(null, null, null, null)) + foreach (BinaryData item in client.GetDiscoTemplates(null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("id").ToString()); @@ -1427,13 +2380,13 @@ public void Example_DiscoTemplate_GetDiscoveryTemplates_DiscoveryTemplatesListDi [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoTemplate_GetDiscoveryTemplates_DiscoveryTemplatesListDiscoTemplate_Async() + public async Task Example_DiscoTemplate_GetDiscoTemplates_DiscoveryTemplatesListDiscoTemplate_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - await foreach (BinaryData item in client.GetDiscoveryTemplatesAsync(null, null, null, null)) + await foreach (BinaryData item in client.GetDiscoTemplatesAsync(null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("id").ToString()); @@ -1442,26 +2395,26 @@ public async Task Example_DiscoTemplate_GetDiscoveryTemplates_DiscoveryTemplates [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoTemplate_GetDiscoveryTemplates_DiscoveryTemplatesListDiscoTemplate_Convenience() + public void Example_DiscoTemplate_GetDiscoTemplates_DiscoveryTemplatesListDiscoTemplate_Convenience() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - foreach (DiscoveryTemplate item in client.GetDiscoveryTemplates()) + foreach (DiscoveryTemplate item in client.GetDiscoTemplates()) { } } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoTemplate_GetDiscoveryTemplates_DiscoveryTemplatesListDiscoTemplate_Convenience_Async() + public async Task Example_DiscoTemplate_GetDiscoTemplates_DiscoveryTemplatesListDiscoTemplate_Convenience_Async() { Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - await foreach (DiscoveryTemplate item in client.GetDiscoveryTemplatesAsync()) + await foreach (DiscoveryTemplate item in client.GetDiscoTemplatesAsync()) { } } @@ -1577,5 +2530,143 @@ public async Task Example_Task_GetTasks_TasksListTask_Convenience_Async() { } } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CisaCveResult_GetCisaCves_CisaCvesGetCisaCves() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + foreach (BinaryData item in client.GetCisaCves(null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("cveId").ToString()); + Console.WriteLine(result.GetProperty("vendorProject").ToString()); + Console.WriteLine(result.GetProperty("product").ToString()); + Console.WriteLine(result.GetProperty("vulnerabilityName").ToString()); + Console.WriteLine(result.GetProperty("shortDescription").ToString()); + Console.WriteLine(result.GetProperty("requiredAction").ToString()); + Console.WriteLine(result.GetProperty("notes").ToString()); + Console.WriteLine(result.GetProperty("dateAdded").ToString()); + Console.WriteLine(result.GetProperty("dueDate").ToString()); + Console.WriteLine(result.GetProperty("updatedAt").ToString()); + Console.WriteLine(result.GetProperty("count").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_CisaCveResult_GetCisaCves_CisaCvesGetCisaCves_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + await foreach (BinaryData item in client.GetCisaCvesAsync(null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("cveId").ToString()); + Console.WriteLine(result.GetProperty("vendorProject").ToString()); + Console.WriteLine(result.GetProperty("product").ToString()); + Console.WriteLine(result.GetProperty("vulnerabilityName").ToString()); + Console.WriteLine(result.GetProperty("shortDescription").ToString()); + Console.WriteLine(result.GetProperty("requiredAction").ToString()); + Console.WriteLine(result.GetProperty("notes").ToString()); + Console.WriteLine(result.GetProperty("dateAdded").ToString()); + Console.WriteLine(result.GetProperty("dueDate").ToString()); + Console.WriteLine(result.GetProperty("updatedAt").ToString()); + Console.WriteLine(result.GetProperty("count").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CisaCveResult_GetCisaCves_CisaCvesGetCisaCves_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + foreach (CisaCveResult item in client.GetCisaCves()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_CisaCveResult_GetCisaCves_CisaCvesGetCisaCves_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + await foreach (CisaCveResult item in client.GetCisaCvesAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Policy_GetPolicies_PoliciesListPolicy() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + foreach (BinaryData item in client.GetPolicies(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("filterName").ToString()); + Console.WriteLine(result.GetProperty("action").ToString()); + Console.WriteLine(result.GetProperty("actionParameters").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Policy_GetPolicies_PoliciesListPolicy_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + await foreach (BinaryData item in client.GetPoliciesAsync(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("filterName").ToString()); + Console.WriteLine(result.GetProperty("action").ToString()); + Console.WriteLine(result.GetProperty("actionParameters").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Policy_GetPolicies_PoliciesListPolicy_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + foreach (Policy item in client.GetPolicies()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Policy_GetPolicies_PoliciesListPolicy_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, credential); + + await foreach (Policy item in client.GetPoliciesAsync()) + { + } + } } } diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/tsp-location.yaml b/sdk/easm/Azure.Analytics.Defender.Easm/tsp-location.yaml index 06e21ee89169..db37a0a2b6e0 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/tsp-location.yaml +++ b/sdk/easm/Azure.Analytics.Defender.Easm/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/riskiq/Easm -commit: add7ec7b745155bff97490bae9749e6a1263c566 +commit: 216cc05a932c0770a40b19ebafd0c76a5c17809b repo: Azure/azure-rest-api-specs - +additionalDirectories: diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/Configuration.json b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/Configuration.json new file mode 100644 index 000000000000..dc18213719b4 --- /dev/null +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/Configuration.json @@ -0,0 +1,12 @@ +{ + "output-folder": ".", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "library-name": "Azure.ResourceManager.HealthDataAIServices", + "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/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/tsp-location.yaml b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/tsp-location.yaml index 7251d1d9572a..ddd6062f2b41 100644 --- a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/tsp-location.yaml +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/healthdataaiservices/HealthDataAIServices.Management -commit: 462574dbd02088c209bb1da3eef0d93f699e8de2 +commit: 216cc05a932c0770a40b19ebafd0c76a5c17809b repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/tspCodeModel.json b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/tspCodeModel.json new file mode 100644 index 000000000000..6e7400b9f67c --- /dev/null +++ b/sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/tspCodeModel.json @@ -0,0 +1,10355 @@ +{ + "$id": "1", + "name": "Microsoft.HealthDataAIServices", + "apiVersions": [ + "2024-09-20" + ], + "enums": [ + { + "$id": "2", + "kind": "enum", + "name": "createdByType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.createdByType", + "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": "The entity was created by a user.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "Application", + "value": "Application", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The entity was created by an application.", + "decorators": [] + }, + { + "$id": "8", + "kind": "enumvalue", + "name": "ManagedIdentity", + "value": "ManagedIdentity", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The entity was created by a managed identity.", + "decorators": [] + }, + { + "$id": "10", + "kind": "enumvalue", + "name": "Key", + "value": "Key", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The entity was created by a key.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "doc": "The kind of entity that created the resource.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "12", + "kind": "enum", + "name": "PrivateEndpointServiceConnectionStatus", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "14", + "kind": "enumvalue", + "name": "Pending", + "value": "Pending", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "Connectionaiting for approval or rejection", + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "Approved", + "value": "Approved", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "Connection approved", + "decorators": [] + }, + { + "$id": "18", + "kind": "enumvalue", + "name": "Rejected", + "value": "Rejected", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "doc": "Connection Rejected", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "doc": "The private endpoint connection status.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "20", + "kind": "enum", + "name": "PrivateEndpointConnectionProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "22", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "20" + }, + "doc": "Connection has been provisioned", + "decorators": [] + }, + { + "$id": "24", + "kind": "enumvalue", + "name": "Creating", + "value": "Creating", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "20" + }, + "doc": "Connection is being created", + "decorators": [] + }, + { + "$id": "26", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "20" + }, + "doc": "Connection is being deleted", + "decorators": [] + }, + { + "$id": "28", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "20" + }, + "doc": "Connection provisioning has failed", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "doc": "The current provisioning state.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "30", + "kind": "enum", + "name": "ResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceProvisioningState", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "32", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "30" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "34", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "30" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "36", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "30" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "doc": "The provisioning state of a resource type.", + "isFixed": false, + "isFlags": false, + "usage": "LroPolling", + "decorators": [] + }, + { + "$id": "38", + "kind": "enum", + "name": "HealthDataAIServicesProvisioningState", + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.ProvisioningState", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "40", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "42", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "44", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + }, + { + "$id": "46", + "kind": "enumvalue", + "name": "Provisioning", + "value": "Provisioning", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "doc": "The resource is being provisioned.", + "decorators": [] + }, + { + "$id": "48", + "kind": "enumvalue", + "name": "Updating", + "value": "Updating", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "doc": "The resource is being updated.", + "decorators": [] + }, + { + "$id": "50", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "doc": "The resource is being deleted.", + "decorators": [] + }, + { + "$id": "52", + "kind": "enumvalue", + "name": "Accepted", + "value": "Accepted", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "doc": "The resource provisioning request has been accepted.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "doc": "The status of the current operation.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "54", + "kind": "enum", + "name": "HealthDataAIServicesPublicNetworkAccess", + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.PublicNetworkAccess", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "56", + "kind": "enumvalue", + "name": "Enabled", + "value": "Enabled", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "54" + }, + "doc": "The public network access is enabled", + "decorators": [] + }, + { + "$id": "58", + "kind": "enumvalue", + "name": "Disabled", + "value": "Disabled", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "54" + }, + "doc": "The public network access is disabled", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "doc": "State of the public network access.", + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "60", + "kind": "enum", + "name": "ManagedServiceIdentityType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "62", + "kind": "enumvalue", + "name": "None", + "value": "None", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "60" + }, + "doc": "No managed identity.", + "decorators": [] + }, + { + "$id": "64", + "kind": "enumvalue", + "name": "SystemAssigned", + "value": "SystemAssigned", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "60" + }, + "doc": "System assigned managed identity.", + "decorators": [] + }, + { + "$id": "66", + "kind": "enumvalue", + "name": "UserAssigned", + "value": "UserAssigned", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "60" + }, + "doc": "User assigned managed identity.", + "decorators": [] + }, + { + "$id": "68", + "kind": "enumvalue", + "name": "SystemAssigned,UserAssigned", + "value": "SystemAssigned,UserAssigned", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "60" + }, + "doc": "System and user assigned managed identity.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "doc": "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "70", + "kind": "enum", + "name": "Origin", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Origin", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "72", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "70" + }, + "doc": "Indicates the operation is initiated by a user.", + "decorators": [] + }, + { + "$id": "74", + "kind": "enumvalue", + "name": "system", + "value": "system", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "70" + }, + "doc": "Indicates the operation is initiated by a system.", + "decorators": [] + }, + { + "$id": "76", + "kind": "enumvalue", + "name": "user,system", + "value": "user,system", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "70" + }, + "doc": "Indicates the operation is initiated by a user or system.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "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": "78", + "kind": "enum", + "name": "ActionType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ActionType", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "80", + "kind": "enumvalue", + "name": "Internal", + "value": "Internal", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "78" + }, + "doc": "Actions are for internal-only APIs.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "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": "82", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.Versions", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "84", + "kind": "enumvalue", + "name": "v2024_09_20", + "value": "2024-09-20", + "valueType": { + "$id": "85", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "82" + }, + "doc": "The 2024-09-20 version.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "doc": "Supported API versions for the Microsoft.HealthDataAIServices resource provider.", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "models": [ + { + "$id": "86", + "kind": "model", + "name": "PrivateLinkResourceListResult", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a PrivateLinkResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "87", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The PrivateLinkResource items on this page", + "type": { + "$id": "88", + "kind": "array", + "name": "ArrayPrivateLinkResource", + "valueType": { + "$id": "89", + "kind": "model", + "name": "PrivateLinkResource", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.PrivateLinkResource", + "usage": "Output,Json", + "doc": "Private Links for DeidService resource", + "decorators": [], + "baseModel": { + "$id": "90", + "kind": "model", + "name": "ProxyResource", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ProxyResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", + "decorators": [], + "baseModel": { + "$id": "91", + "kind": "model", + "name": "Resource", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Common fields that are returned in the response for all Azure Resource Manager resources", + "decorators": [], + "properties": [ + { + "$id": "92", + "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": "93", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "94", + "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": "95", + "json": { + "$id": "96", + "name": "id" + } + } + }, + { + "$id": "97", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the resource", + "type": { + "$id": "98", + "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": "99", + "json": { + "$id": "100", + "name": "name" + } + } + }, + { + "$id": "101", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"", + "type": { + "$id": "102", + "kind": "string", + "name": "armResourceType", + "crossLanguageDefinitionId": "Azure.Core.armResourceType", + "baseType": { + "$id": "103", + "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": "104", + "json": { + "$id": "105", + "name": "type" + } + } + }, + { + "$id": "106", + "kind": "property", + "name": "systemData", + "serializedName": "systemData", + "doc": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "type": { + "$id": "107", + "kind": "model", + "name": "SystemData", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Metadata pertaining to creation and last modification of the resource.", + "decorators": [], + "properties": [ + { + "$id": "108", + "kind": "property", + "name": "createdBy", + "serializedName": "createdBy", + "doc": "The identity that created the resource.", + "type": { + "$id": "109", + "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": "110", + "json": { + "$id": "111", + "name": "createdBy" + } + } + }, + { + "$id": "112", + "kind": "property", + "name": "createdByType", + "serializedName": "createdByType", + "doc": "The type of identity that created the resource.", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdByType", + "serializationOptions": { + "$id": "113", + "json": { + "$id": "114", + "name": "createdByType" + } + } + }, + { + "$id": "115", + "kind": "property", + "name": "createdAt", + "serializedName": "createdAt", + "doc": "The timestamp of resource creation (UTC).", + "type": { + "$id": "116", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "117", + "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": "118", + "json": { + "$id": "119", + "name": "createdAt" + } + } + }, + { + "$id": "120", + "kind": "property", + "name": "lastModifiedBy", + "serializedName": "lastModifiedBy", + "doc": "The identity that last modified the resource.", + "type": { + "$id": "121", + "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": "122", + "json": { + "$id": "123", + "name": "lastModifiedBy" + } + } + }, + { + "$id": "124", + "kind": "property", + "name": "lastModifiedByType", + "serializedName": "lastModifiedByType", + "doc": "The type of identity that last modified the resource.", + "type": { + "$ref": "2" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedByType", + "serializationOptions": { + "$id": "125", + "json": { + "$id": "126", + "name": "lastModifiedByType" + } + } + }, + { + "$id": "127", + "kind": "property", + "name": "lastModifiedAt", + "serializedName": "lastModifiedAt", + "doc": "The timestamp of resource last modification (UTC)", + "type": { + "$id": "128", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "129", + "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": "130", + "json": { + "$id": "131", + "name": "lastModifiedAt" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.systemData", + "serializationOptions": { + "$id": "132", + "json": { + "$id": "133", + "name": "systemData" + } + } + } + ] + }, + "properties": [] + }, + "properties": [ + { + "$id": "134", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "135", + "kind": "model", + "name": "PrivateLinkResourceProperties", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties", + "usage": "Output,Json", + "doc": "Properties of a private link resource.", + "decorators": [], + "properties": [ + { + "$id": "136", + "kind": "property", + "name": "groupId", + "serializedName": "groupId", + "doc": "The private link resource group id.", + "type": { + "$id": "137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties.groupId", + "serializationOptions": { + "$id": "138", + "json": { + "$id": "139", + "name": "groupId" + } + } + }, + { + "$id": "140", + "kind": "property", + "name": "requiredMembers", + "serializedName": "requiredMembers", + "doc": "The private link resource required member names.", + "type": { + "$id": "141", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "142", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties.requiredMembers", + "serializationOptions": { + "$id": "143", + "json": { + "$id": "144", + "name": "requiredMembers" + } + } + }, + { + "$id": "145", + "kind": "property", + "name": "requiredZoneNames", + "serializedName": "requiredZoneNames", + "doc": "The private link resource private link DNS zone name.", + "type": { + "$id": "146", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties.requiredZoneNames", + "serializationOptions": { + "$id": "148", + "json": { + "$id": "149", + "name": "requiredZoneNames" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.PrivateLinkResource.properties", + "serializationOptions": { + "$id": "150", + "json": { + "$id": "151", + "name": "properties" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "152", + "json": { + "$id": "153", + "name": "value" + } + } + }, + { + "$id": "154", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "155", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "156", + "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": "157", + "json": { + "$id": "158", + "name": "nextLink" + } + } + } + ] + }, + { + "$ref": "89" + }, + { + "$ref": "135" + }, + { + "$ref": "90" + }, + { + "$ref": "91" + }, + { + "$ref": "107" + }, + { + "$id": "159", + "kind": "model", + "name": "ErrorResponse", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "usage": "Error,Json,Exception", + "doc": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", + "decorators": [], + "properties": [ + { + "$id": "160", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error object.", + "type": { + "$id": "161", + "kind": "model", + "name": "ErrorDetail", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "usage": "Json,Exception,LroPolling", + "doc": "The error detail.", + "decorators": [], + "properties": [ + { + "$id": "162", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "163", + "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": "164", + "json": { + "$id": "165", + "name": "code" + } + } + }, + { + "$id": "166", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "167", + "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": "168", + "json": { + "$id": "169", + "name": "message" + } + } + }, + { + "$id": "170", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The error target.", + "type": { + "$id": "171", + "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": "172", + "json": { + "$id": "173", + "name": "target" + } + } + }, + { + "$id": "174", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The error details.", + "type": { + "$id": "175", + "kind": "array", + "name": "ArrayErrorDetail", + "valueType": { + "$ref": "161" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details", + "serializationOptions": { + "$id": "176", + "json": { + "$id": "177", + "name": "details" + } + } + }, + { + "$id": "178", + "kind": "property", + "name": "additionalInfo", + "serializedName": "additionalInfo", + "doc": "The error additional info.", + "type": { + "$id": "179", + "kind": "array", + "name": "ArrayErrorAdditionalInfo", + "valueType": { + "$id": "180", + "kind": "model", + "name": "ErrorAdditionalInfo", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "usage": "Json,Exception,LroPolling", + "doc": "The resource management error additional info.", + "decorators": [], + "properties": [ + { + "$id": "181", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The additional info type.", + "type": { + "$id": "182", + "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": "183", + "json": { + "$id": "184", + "name": "type" + } + } + }, + { + "$id": "185", + "kind": "property", + "name": "info", + "serializedName": "info", + "doc": "The additional info.", + "type": { + "$id": "186", + "kind": "model", + "name": "ErrorAdditionalInfoInfo", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "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": "187", + "json": { + "$id": "188", + "name": "info" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo", + "serializationOptions": { + "$id": "189", + "json": { + "$id": "190", + "name": "additionalInfo" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error", + "serializationOptions": { + "$id": "191", + "json": { + "$id": "192", + "name": "error" + } + } + } + ] + }, + { + "$ref": "161" + }, + { + "$ref": "180" + }, + { + "$ref": "186" + }, + { + "$id": "193", + "kind": "model", + "name": "HealthDataAIServicesPrivateEndpointConnectionResource", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.PrivateEndpointConnectionResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Holder for private endpoint connections", + "decorators": [], + "baseModel": { + "$ref": "90" + }, + "properties": [ + { + "$id": "194", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "195", + "kind": "model", + "name": "PrivateEndpointConnectionProperties", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Properties of the private endpoint connection.", + "decorators": [], + "properties": [ + { + "$id": "196", + "kind": "property", + "name": "groupIds", + "serializedName": "groupIds", + "doc": "The group ids for the private endpoint resource.", + "type": { + "$id": "197", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "198", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties.groupIds", + "serializationOptions": { + "$id": "199", + "json": { + "$id": "200", + "name": "groupIds" + } + } + }, + { + "$id": "201", + "kind": "property", + "name": "privateEndpoint", + "serializedName": "privateEndpoint", + "doc": "The private endpoint resource.", + "type": { + "$id": "202", + "kind": "model", + "name": "PrivateEndpoint", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateEndpoint", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The Private Endpoint resource.", + "decorators": [], + "properties": [ + { + "$id": "203", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "The resource identifier for private endpoint", + "type": { + "$id": "204", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "205", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateEndpoint.id", + "serializationOptions": { + "$id": "206", + "json": { + "$id": "207", + "name": "id" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties.privateEndpoint", + "serializationOptions": { + "$id": "208", + "json": { + "$id": "209", + "name": "privateEndpoint" + } + } + }, + { + "$id": "210", + "kind": "property", + "name": "privateLinkServiceConnectionState", + "serializedName": "privateLinkServiceConnectionState", + "doc": "A collection of information about the state of the connection between service consumer and provider.", + "type": { + "$id": "211", + "kind": "model", + "name": "PrivateLinkServiceConnectionState", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "A collection of information about the state of the connection between service consumer and provider.", + "decorators": [], + "properties": [ + { + "$id": "212", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + "type": { + "$ref": "12" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState.status", + "serializationOptions": { + "$id": "213", + "json": { + "$id": "214", + "name": "status" + } + } + }, + { + "$id": "215", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The reason for approval/rejection of the connection.", + "type": { + "$id": "216", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState.description", + "serializationOptions": { + "$id": "217", + "json": { + "$id": "218", + "name": "description" + } + } + }, + { + "$id": "219", + "kind": "property", + "name": "actionsRequired", + "serializedName": "actionsRequired", + "doc": "A message indicating if changes on the service provider require any updates on the consumer.", + "type": { + "$id": "220", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState.actionsRequired", + "serializationOptions": { + "$id": "221", + "json": { + "$id": "222", + "name": "actionsRequired" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties.privateLinkServiceConnectionState", + "serializationOptions": { + "$id": "223", + "json": { + "$id": "224", + "name": "privateLinkServiceConnectionState" + } + } + }, + { + "$id": "225", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The provisioning state of the private endpoint connection resource.", + "type": { + "$ref": "20" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties.provisioningState", + "serializationOptions": { + "$id": "226", + "json": { + "$id": "227", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.PrivateEndpointConnectionResource.properties", + "serializationOptions": { + "$id": "228", + "json": { + "$id": "229", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "195" + }, + { + "$ref": "202" + }, + { + "$ref": "211" + }, + { + "$id": "230", + "kind": "model", + "name": "ArmOperationStatusResourceProvisioningState", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus", + "usage": "LroPolling", + "doc": "Standard Azure Resource Manager operation status response", + "decorators": [], + "properties": [ + { + "$id": "231", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The operation status", + "type": { + "$ref": "30" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.status", + "serializationOptions": { + "$id": "232", + "json": { + "$id": "233", + "name": "status" + } + } + }, + { + "$id": "234", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operationStatus resource", + "type": { + "$id": "235", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.name", + "serializationOptions": { + "$id": "236", + "json": { + "$id": "237", + "name": "name" + } + } + }, + { + "$id": "238", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "Operation start time", + "type": { + "$id": "239", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "240", + "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": "241", + "json": { + "$id": "242", + "name": "startTime" + } + } + }, + { + "$id": "243", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "Operation complete time", + "type": { + "$id": "244", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "245", + "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": "246", + "json": { + "$id": "247", + "name": "endTime" + } + } + }, + { + "$id": "248", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "doc": "The progress made toward completing the operation", + "type": { + "$id": "249", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.percentComplete", + "serializationOptions": { + "$id": "250", + "json": { + "$id": "251", + "name": "percentComplete" + } + } + }, + { + "$id": "252", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Errors that occurred if the operation ended with Canceled or Failed status", + "type": { + "$ref": "161" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.error", + "serializationOptions": { + "$id": "253", + "json": { + "$id": "254", + "name": "error" + } + } + } + ] + }, + { + "$id": "255", + "kind": "model", + "name": "PrivateEndpointConnectionResourceListResult", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a PrivateEndpointConnectionResource list operation.", + "decorators": [], + "properties": [ + { + "$id": "256", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The PrivateEndpointConnectionResource items on this page", + "type": { + "$id": "257", + "kind": "array", + "name": "ArrayPrivateEndpointConnectionResource", + "valueType": { + "$ref": "193" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "258", + "json": { + "$id": "259", + "name": "value" + } + } + }, + { + "$id": "260", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "261", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "262", + "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": "263", + "json": { + "$id": "264", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "265", + "kind": "model", + "name": "DeidService", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidService", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "A HealthDataAIServicesProviderHub resource", + "decorators": [], + "baseModel": { + "$id": "266", + "kind": "model", + "name": "TrackedResource", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", + "decorators": [], + "baseModel": { + "$ref": "91" + }, + "properties": [ + { + "$id": "267", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "268", + "kind": "dict", + "keyType": { + "$id": "269", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "270", + "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": "271", + "json": { + "$id": "272", + "name": "tags" + } + } + }, + { + "$id": "273", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The geo-location where the resource lives", + "type": { + "$id": "274", + "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": "275", + "json": { + "$id": "276", + "name": "location" + } + } + } + ] + }, + "properties": [ + { + "$id": "277", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "278", + "kind": "model", + "name": "DeidServiceProperties", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidServiceProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Details of the HealthDataAIServices DeidService.", + "decorators": [], + "properties": [ + { + "$id": "279", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "38" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidServiceProperties.provisioningState", + "serializationOptions": { + "$id": "280", + "json": { + "$id": "281", + "name": "provisioningState" + } + } + }, + { + "$id": "282", + "kind": "property", + "name": "serviceUrl", + "serializedName": "serviceUrl", + "doc": "Deid service url.", + "type": { + "$id": "283", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidServiceProperties.serviceUrl", + "serializationOptions": { + "$id": "284", + "json": { + "$id": "285", + "name": "serviceUrl" + } + } + }, + { + "$id": "286", + "kind": "property", + "name": "privateEndpointConnections", + "serializedName": "privateEndpointConnections", + "doc": "List of private endpoint connections.", + "type": { + "$id": "287", + "kind": "array", + "name": "ArrayPrivateEndpointConnection", + "valueType": { + "$id": "288", + "kind": "model", + "name": "PrivateEndpointConnection", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnection", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The private endpoint connection resource", + "decorators": [], + "baseModel": { + "$ref": "91" + }, + "properties": [ + { + "$id": "289", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The private endpoint connection properties", + "type": { + "$ref": "195" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnection.properties", + "serializationOptions": { + "$id": "290", + "json": { + "$id": "291", + "name": "properties" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidServiceProperties.privateEndpointConnections", + "serializationOptions": { + "$id": "292", + "json": { + "$id": "293", + "name": "privateEndpointConnections" + } + } + }, + { + "$id": "294", + "kind": "property", + "name": "publicNetworkAccess", + "serializedName": "publicNetworkAccess", + "doc": "Gets or sets allow or disallow public network access to resource", + "type": { + "$ref": "54" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidServiceProperties.publicNetworkAccess", + "serializationOptions": { + "$id": "295", + "json": { + "$id": "296", + "name": "publicNetworkAccess" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidService.properties", + "serializationOptions": { + "$id": "297", + "json": { + "$id": "298", + "name": "properties" + } + } + }, + { + "$id": "299", + "kind": "property", + "name": "identity", + "serializedName": "identity", + "doc": "The managed service identities assigned to this resource.", + "type": { + "$id": "300", + "kind": "model", + "name": "ManagedServiceIdentity", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Managed service identity (system assigned and/or user assigned identities)", + "decorators": [], + "properties": [ + { + "$id": "301", + "kind": "property", + "name": "principalId", + "serializedName": "principalId", + "doc": "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "type": { + "$id": "302", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.principalId", + "serializationOptions": { + "$id": "304", + "json": { + "$id": "305", + "name": "principalId" + } + } + }, + { + "$id": "306", + "kind": "property", + "name": "tenantId", + "serializedName": "tenantId", + "doc": "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "type": { + "$id": "307", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "308", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.tenantId", + "serializationOptions": { + "$id": "309", + "json": { + "$id": "310", + "name": "tenantId" + } + } + }, + { + "$id": "311", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of managed identity assigned to this resource.", + "type": { + "$ref": "60" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.type", + "serializationOptions": { + "$id": "312", + "json": { + "$id": "313", + "name": "type" + } + } + }, + { + "$id": "314", + "kind": "property", + "name": "userAssignedIdentities", + "serializedName": "userAssignedIdentities", + "doc": "The identities assigned to this resource by the user.", + "type": { + "$id": "315", + "kind": "dict", + "keyType": { + "$id": "316", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "317", + "kind": "nullable", + "type": { + "$id": "318", + "kind": "model", + "name": "UserAssignedIdentity", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "User assigned identity properties", + "decorators": [], + "properties": [ + { + "$id": "319", + "kind": "property", + "name": "clientId", + "serializedName": "clientId", + "doc": "The client ID of the assigned identity.", + "type": { + "$id": "320", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "321", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.clientId", + "serializationOptions": { + "$id": "322", + "json": { + "$id": "323", + "name": "clientId" + } + } + }, + { + "$id": "324", + "kind": "property", + "name": "principalId", + "serializedName": "principalId", + "doc": "The principal ID of the assigned identity.", + "type": { + "$id": "325", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "326", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.principalId", + "serializationOptions": { + "$id": "327", + "json": { + "$id": "328", + "name": "principalId" + } + } + } + ] + }, + "namespace": "Azure.ResourceManager.HealthDataAIServices" + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.userAssignedIdentities", + "serializationOptions": { + "$id": "329", + "json": { + "$id": "330", + "name": "userAssignedIdentities" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidService.identity", + "serializationOptions": { + "$id": "331", + "json": { + "$id": "332", + "name": "identity" + } + } + } + ] + }, + { + "$ref": "278" + }, + { + "$ref": "288" + }, + { + "$ref": "300" + }, + { + "$ref": "318" + }, + { + "$ref": "266" + }, + { + "$id": "333", + "kind": "model", + "name": "DeidServiceListResult", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a DeidService list operation.", + "decorators": [], + "properties": [ + { + "$id": "334", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The DeidService items on this page", + "type": { + "$id": "335", + "kind": "array", + "name": "ArrayDeidService", + "valueType": { + "$ref": "265" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "336", + "json": { + "$id": "337", + "name": "value" + } + } + }, + { + "$id": "338", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "339", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "340", + "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": "341", + "json": { + "$id": "342", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "343", + "kind": "model", + "name": "DeidUpdate", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidUpdate", + "usage": "Input,Json", + "doc": "Patch request body for DeidService", + "decorators": [], + "properties": [ + { + "$id": "344", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "345", + "kind": "dict", + "keyType": { + "$id": "346", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "347", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidUpdate.tags", + "serializationOptions": { + "$id": "348", + "json": { + "$id": "349", + "name": "tags" + } + } + }, + { + "$id": "350", + "kind": "property", + "name": "identity", + "serializedName": "identity", + "doc": "Updatable managed service identity", + "type": { + "$id": "351", + "kind": "model", + "name": "ManagedServiceIdentityUpdate", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.ManagedServiceIdentityUpdate", + "usage": "Input,Json", + "doc": "The template for adding optional properties.", + "decorators": [], + "properties": [ + { + "$id": "352", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of managed identity assigned to this resource.", + "type": { + "$ref": "60" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.ManagedServiceIdentityUpdate.type", + "serializationOptions": { + "$id": "353", + "json": { + "$id": "354", + "name": "type" + } + } + }, + { + "$id": "355", + "kind": "property", + "name": "userAssignedIdentities", + "serializedName": "userAssignedIdentities", + "doc": "The identities assigned to this resource by the user.", + "type": { + "$id": "356", + "kind": "dict", + "keyType": { + "$id": "357", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$ref": "317" + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.ManagedServiceIdentityUpdate.userAssignedIdentities", + "serializationOptions": { + "$id": "358", + "json": { + "$id": "359", + "name": "userAssignedIdentities" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidUpdate.identity", + "serializationOptions": { + "$id": "360", + "json": { + "$id": "361", + "name": "identity" + } + } + }, + { + "$id": "362", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "RP-specific properties", + "type": { + "$id": "363", + "kind": "model", + "name": "DeidPropertiesUpdate", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidPropertiesUpdate", + "usage": "Input,Json", + "doc": "The template for adding optional properties.", + "decorators": [], + "properties": [ + { + "$id": "364", + "kind": "property", + "name": "publicNetworkAccess", + "serializedName": "publicNetworkAccess", + "doc": "Gets or sets allow or disallow public network access to resource", + "type": { + "$ref": "54" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidPropertiesUpdate.publicNetworkAccess", + "serializationOptions": { + "$id": "365", + "json": { + "$id": "366", + "name": "publicNetworkAccess" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidUpdate.properties", + "serializationOptions": { + "$id": "367", + "json": { + "$id": "368", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "351" + }, + { + "$ref": "363" + }, + { + "$id": "369", + "kind": "model", + "name": "OperationListResult", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "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": "370", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Operation items on this page", + "type": { + "$id": "371", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$id": "372", + "kind": "model", + "name": "Operation", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "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": "373", + "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": "374", + "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": "375", + "json": { + "$id": "376", + "name": "name" + } + } + }, + { + "$id": "377", + "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": "378", + "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": "379", + "json": { + "$id": "380", + "name": "isDataAction" + } + } + }, + { + "$id": "381", + "kind": "property", + "name": "display", + "serializedName": "display", + "doc": "Localized display information for this particular operation.", + "type": { + "$id": "382", + "kind": "model", + "name": "OperationDisplay", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "usage": "Output,Json", + "doc": "Localized display information for and operation.", + "decorators": [], + "properties": [ + { + "$id": "383", + "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": "384", + "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": "385", + "json": { + "$id": "386", + "name": "provider" + } + } + }, + { + "$id": "387", + "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": "388", + "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": "389", + "json": { + "$id": "390", + "name": "resource" + } + } + }, + { + "$id": "391", + "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": "392", + "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": "393", + "json": { + "$id": "394", + "name": "operation" + } + } + }, + { + "$id": "395", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + "type": { + "$id": "396", + "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": "397", + "json": { + "$id": "398", + "name": "description" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display", + "serializationOptions": { + "$id": "399", + "json": { + "$id": "400", + "name": "display" + } + } + }, + { + "$id": "401", + "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": "70" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin", + "serializationOptions": { + "$id": "402", + "json": { + "$id": "403", + "name": "origin" + } + } + }, + { + "$id": "404", + "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": "78" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType", + "serializationOptions": { + "$id": "405", + "json": { + "$id": "406", + "name": "actionType" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.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.CommonTypes.OperationListResult.nextLink", + "serializationOptions": { + "$id": "412", + "json": { + "$id": "413", + "name": "nextLink" + } + } + } + ] + }, + { + "$ref": "372" + }, + { + "$ref": "382" + } + ], + "clients": [ + { + "$id": "414", + "name": "HealthDataAIServicesClient", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "operations": [], + "parameters": [ + { + "$id": "415", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "416", + "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": "417", + "type": { + "$id": "418", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices" + }, + { + "$id": "419", + "name": "Operations", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "operations": [ + { + "$id": "420", + "name": "list", + "resourceName": "Operations", + "doc": "List the operations for the provider", + "accessibility": "internal", + "parameters": [ + { + "$id": "421", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "422", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "423", + "type": { + "$id": "424", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-20" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "425", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "426", + "kind": "constant", + "valueType": { + "$id": "427", + "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": "428", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "369" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/providers/Microsoft.HealthDataAIServices/operations", + "bufferResponse": true, + "paging": { + "$id": "429", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "430", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "decorators": [], + "examples": [ + { + "$id": "431", + "kind": "http", + "name": "Operations_List_MaximumSet - generated by [MaximumSet] rule. [stable]", + "description": "Operations_List_MaximumSet - generated by [MaximumSet] rule. [stable]", + "filePath": "2024-09-20/Operations_List_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "432", + "parameter": { + "$ref": "421" + }, + "value": { + "$id": "433", + "kind": "string", + "type": { + "$ref": "422" + }, + "value": "2024-09-20" + } + } + ], + "responses": [ + { + "$id": "434", + "response": { + "$ref": "428" + }, + "statusCode": 200, + "bodyValue": { + "$id": "435", + "kind": "model", + "type": { + "$ref": "369" + }, + "value": { + "$id": "436", + "value": { + "$id": "437", + "kind": "array", + "type": { + "$ref": "371" + }, + "value": [ + { + "$id": "438", + "kind": "model", + "type": { + "$ref": "372" + }, + "value": { + "$id": "439", + "name": { + "$id": "440", + "kind": "string", + "type": { + "$ref": "374" + }, + "value": "vlozcqymdxttexvmhouwzob" + }, + "isDataAction": { + "$id": "441", + "kind": "boolean", + "type": { + "$ref": "378" + }, + "value": true + }, + "display": { + "$id": "442", + "kind": "model", + "type": { + "$ref": "382" + }, + "value": { + "$id": "443", + "provider": { + "$id": "444", + "kind": "string", + "type": { + "$ref": "384" + }, + "value": "hwy" + }, + "resource": { + "$id": "445", + "kind": "string", + "type": { + "$ref": "388" + }, + "value": "yxabgnzjshmqldqthxonpam" + }, + "operation": { + "$id": "446", + "kind": "string", + "type": { + "$ref": "392" + }, + "value": "quwaawjasjgpqhskxoxzx" + }, + "description": { + "$id": "447", + "kind": "string", + "type": { + "$ref": "396" + }, + "value": "ayqiodducsbwvzcgno" + } + } + }, + "origin": { + "$id": "448", + "kind": "string", + "type": { + "$ref": "70" + }, + "value": "user" + }, + "actionType": { + "$id": "449", + "kind": "string", + "type": { + "$ref": "78" + }, + "value": "Internal" + } + } + } + ] + }, + "nextLink": { + "$id": "450", + "kind": "string", + "type": { + "$ref": "410" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + }, + { + "$id": "451", + "kind": "http", + "name": "Operations_List_MinimumSet - generated by [MinimumSet] rule. [stable]", + "description": "Operations_List_MinimumSet - generated by [MinimumSet] rule. [stable]", + "filePath": "2024-09-20/Operations_List_MinimumSet_Gen.json", + "parameters": [ + { + "$id": "452", + "parameter": { + "$ref": "421" + }, + "value": { + "$id": "453", + "kind": "string", + "type": { + "$ref": "422" + }, + "value": "2024-09-20" + } + } + ], + "responses": [ + { + "$id": "454", + "response": { + "$ref": "428" + }, + "statusCode": 200, + "bodyValue": { + "$id": "455", + "kind": "model", + "type": { + "$ref": "369" + }, + "value": { + "$id": "456" + } + } + } + ] + } + ] + } + ], + "parent": "HealthDataAIServicesClient", + "parameters": [ + { + "$id": "457", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "458", + "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": "459", + "type": { + "$id": "460", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.Operations" + }, + { + "$id": "461", + "name": "DeidServices", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "operations": [ + { + "$id": "462", + "name": "get", + "resourceName": "DeidService", + "doc": "Get a DeidService", + "accessibility": "public", + "parameters": [ + { + "$id": "463", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "464", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "465", + "type": { + "$id": "466", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-20" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "467", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "468", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "469", + "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": "470", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "471", + "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": "472", + "name": "deidServiceName", + "nameInRequest": "deidServiceName", + "doc": "The name of the deid service", + "type": { + "$id": "473", + "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": "474", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "475", + "kind": "constant", + "valueType": { + "$id": "476", + "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": "477", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "265" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidServices.get", + "decorators": [], + "examples": [ + { + "$id": "478", + "kind": "http", + "name": "DeidServices_Get - generated by [MaximumSet] rule. [stable]", + "description": "DeidServices_Get - generated by [MaximumSet] rule. [stable]", + "filePath": "2024-09-20/DeidServices_Get_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "479", + "parameter": { + "$ref": "463" + }, + "value": { + "$id": "480", + "kind": "string", + "type": { + "$ref": "464" + }, + "value": "2024-09-20" + } + }, + { + "$id": "481", + "parameter": { + "$ref": "467" + }, + "value": { + "$id": "482", + "kind": "string", + "type": { + "$ref": "468" + }, + "value": "F21BB31B-C214-42C0-ACF0-DACCA05D3011" + } + }, + { + "$id": "483", + "parameter": { + "$ref": "470" + }, + "value": { + "$id": "484", + "kind": "string", + "type": { + "$ref": "471" + }, + "value": "rgopenapi" + } + }, + { + "$id": "485", + "parameter": { + "$ref": "472" + }, + "value": { + "$id": "486", + "kind": "string", + "type": { + "$ref": "473" + }, + "value": "deidTest" + } + } + ], + "responses": [ + { + "$id": "487", + "response": { + "$ref": "477" + }, + "statusCode": 200, + "bodyValue": { + "$id": "488", + "kind": "model", + "type": { + "$ref": "265" + }, + "value": { + "$id": "489", + "properties": { + "$id": "490", + "kind": "model", + "type": { + "$ref": "278" + }, + "value": { + "$id": "491", + "provisioningState": { + "$id": "492", + "kind": "string", + "type": { + "$ref": "38" + }, + "value": "Succeeded" + }, + "publicNetworkAccess": { + "$id": "493", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Enabled" + }, + "privateEndpointConnections": { + "$id": "494", + "kind": "array", + "type": { + "$ref": "287" + }, + "value": [ + { + "$id": "495", + "kind": "model", + "type": { + "$ref": "288" + }, + "value": { + "$id": "496", + "properties": { + "$id": "497", + "kind": "model", + "type": { + "$ref": "195" + }, + "value": { + "$id": "498", + "privateEndpoint": { + "$id": "499", + "kind": "model", + "type": { + "$ref": "202" + }, + "value": { + "$id": "500", + "id": { + "$id": "501", + "kind": "string", + "type": { + "$ref": "204" + }, + "value": "gpnxxbbtsysdhhclm" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "502", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "503", + "status": { + "$id": "504", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Pending" + }, + "actionsRequired": { + "$id": "505", + "kind": "string", + "type": { + "$ref": "220" + }, + "value": "ulb" + }, + "description": { + "$id": "506", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "ddxuoved" + } + } + }, + "groupIds": { + "$id": "507", + "kind": "array", + "type": { + "$ref": "197" + }, + "value": [ + { + "$id": "508", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "xbdyjqg" + } + ] + }, + "provisioningState": { + "$id": "509", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "510", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/nlrthrxaukih/privateEndpointConnections/mdwvqjtwcjcvrh" + }, + "name": { + "$id": "511", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "mdwvqjtwcjcvrh" + }, + "type": { + "$id": "512", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "bzxabjlpbwreez" + }, + "systemData": { + "$id": "513", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "514", + "createdBy": { + "$id": "515", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "516", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "517", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "518", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "519", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "520", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + ] + }, + "serviceUrl": { + "$id": "521", + "kind": "string", + "type": { + "$ref": "283" + }, + "value": "woponotsxaippkvhwmibffywnqcfru" + } + } + }, + "identity": { + "$id": "522", + "kind": "model", + "type": { + "$ref": "300" + }, + "value": { + "$id": "523", + "type": { + "$id": "524", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "525", + "kind": "dict", + "type": { + "$ref": "315" + }, + "value": { + "$id": "526" + } + }, + "principalId": { + "$id": "527", + "kind": "string", + "type": { + "$ref": "302" + }, + "value": "a82361f4-5320-4a26-8d1b-45832d2164dd" + }, + "tenantId": { + "$id": "528", + "kind": "string", + "type": { + "$ref": "307" + }, + "value": "53a6a686-ae15-4a1d-badf-3e7947918893" + } + } + }, + "tags": { + "$id": "529", + "kind": "dict", + "type": { + "$ref": "268" + }, + "value": { + "$id": "530" + } + }, + "location": { + "$id": "531", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "qwyhvdwcsjulggagdqxlmazcl" + }, + "id": { + "$id": "532", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/nlrthrxaukih" + }, + "name": { + "$id": "533", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "nlrthrxaukih" + }, + "type": { + "$id": "534", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "slyfiibvwlhfdpzjynsywhbfauexk" + }, + "systemData": { + "$id": "535", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "536", + "createdBy": { + "$id": "537", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "538", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "539", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "540", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "541", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "542", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "543", + "name": "listByResourceGroup", + "resourceName": "DeidService", + "doc": "List DeidService resources by resource group", + "accessibility": "public", + "parameters": [ + { + "$id": "544", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "545", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "546", + "type": { + "$id": "547", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-20" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "548", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "549", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "550", + "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": "551", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "552", + "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": "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 + } + ], + "responses": [ + { + "$id": "556", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "333" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices", + "bufferResponse": true, + "paging": { + "$id": "557", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "558", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidServices.listByResourceGroup", + "decorators": [], + "examples": [ + { + "$id": "559", + "kind": "http", + "name": "DeidServices_ListByResourceGroup - generated by [MaximumSet] rule. [stable]", + "description": "DeidServices_ListByResourceGroup - generated by [MaximumSet] rule. [stable]", + "filePath": "2024-09-20/DeidServices_ListByResourceGroup_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "560", + "parameter": { + "$ref": "544" + }, + "value": { + "$id": "561", + "kind": "string", + "type": { + "$ref": "545" + }, + "value": "2024-09-20" + } + }, + { + "$id": "562", + "parameter": { + "$ref": "548" + }, + "value": { + "$id": "563", + "kind": "string", + "type": { + "$ref": "549" + }, + "value": "F21BB31B-C214-42C0-ACF0-DACCA05D3011" + } + }, + { + "$id": "564", + "parameter": { + "$ref": "551" + }, + "value": { + "$id": "565", + "kind": "string", + "type": { + "$ref": "552" + }, + "value": "rgopenapi" + } + } + ], + "responses": [ + { + "$id": "566", + "response": { + "$ref": "556" + }, + "statusCode": 200, + "bodyValue": { + "$id": "567", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "$id": "568", + "value": { + "$id": "569", + "kind": "array", + "type": { + "$ref": "335" + }, + "value": [ + { + "$id": "570", + "kind": "model", + "type": { + "$ref": "265" + }, + "value": { + "$id": "571", + "properties": { + "$id": "572", + "kind": "model", + "type": { + "$ref": "278" + }, + "value": { + "$id": "573", + "provisioningState": { + "$id": "574", + "kind": "string", + "type": { + "$ref": "38" + }, + "value": "Succeeded" + }, + "serviceUrl": { + "$id": "575", + "kind": "string", + "type": { + "$ref": "283" + }, + "value": "woponotsxaippkvhwmibffywnqcfru" + }, + "privateEndpointConnections": { + "$id": "576", + "kind": "array", + "type": { + "$ref": "287" + }, + "value": [ + { + "$id": "577", + "kind": "model", + "type": { + "$ref": "288" + }, + "value": { + "$id": "578", + "properties": { + "$id": "579", + "kind": "model", + "type": { + "$ref": "195" + }, + "value": { + "$id": "580", + "groupIds": { + "$id": "581", + "kind": "array", + "type": { + "$ref": "197" + }, + "value": [ + { + "$id": "582", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "xbdyjqg" + } + ] + }, + "privateEndpoint": { + "$id": "583", + "kind": "model", + "type": { + "$ref": "202" + }, + "value": { + "$id": "584", + "id": { + "$id": "585", + "kind": "string", + "type": { + "$ref": "204" + }, + "value": "gpnxxbbtsysdhhclm" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "586", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "587", + "status": { + "$id": "588", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Pending" + }, + "actionsRequired": { + "$id": "589", + "kind": "string", + "type": { + "$ref": "220" + }, + "value": "ulb" + }, + "description": { + "$id": "590", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "ro" + } + } + }, + "provisioningState": { + "$id": "591", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "592", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/nlrthrxaukih/privateEndpointConnections/mdwvqjtwcjcvrh" + }, + "name": { + "$id": "593", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "mdwvqjtwcjcvrh" + }, + "type": { + "$id": "594", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "bzxabjlpbwreez" + }, + "systemData": { + "$id": "595", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "596", + "createdBy": { + "$id": "597", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "598", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "599", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "600", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "601", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "602", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + ] + }, + "publicNetworkAccess": { + "$id": "603", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Enabled" + } + } + }, + "identity": { + "$id": "604", + "kind": "model", + "type": { + "$ref": "300" + }, + "value": { + "$id": "605", + "principalId": { + "$id": "606", + "kind": "string", + "type": { + "$ref": "302" + }, + "value": "a82361f4-5320-4a26-8d1b-45832d2164dd" + }, + "tenantId": { + "$id": "607", + "kind": "string", + "type": { + "$ref": "307" + }, + "value": "53a6a686-ae15-4a1d-badf-3e7947918893" + }, + "type": { + "$id": "608", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "609", + "kind": "dict", + "type": { + "$ref": "315" + }, + "value": { + "$id": "610" + } + } + } + }, + "tags": { + "$id": "611", + "kind": "dict", + "type": { + "$ref": "268" + }, + "value": { + "$id": "612" + } + }, + "location": { + "$id": "613", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "qwyhvdwcsjulggagdqxlmazcl" + }, + "id": { + "$id": "614", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/nlrthrxaukih" + }, + "name": { + "$id": "615", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "nlrthrxaukih" + }, + "type": { + "$id": "616", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "slyfiibvwlhfdpzjynsywhbfauexk" + }, + "systemData": { + "$id": "617", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "618", + "createdBy": { + "$id": "619", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "620", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "621", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "622", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "623", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "624", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "625", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + }, + { + "$id": "626", + "name": "listBySubscription", + "resourceName": "DeidService", + "doc": "List DeidService resources by subscription ID", + "accessibility": "public", + "parameters": [ + { + "$id": "627", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "628", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "629", + "type": { + "$id": "630", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-20" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "631", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "632", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "633", + "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": "634", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "635", + "kind": "constant", + "valueType": { + "$id": "636", + "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": "637", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "333" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/providers/Microsoft.HealthDataAIServices/deidServices", + "bufferResponse": true, + "paging": { + "$id": "638", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "639", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidServices.listBySubscription", + "decorators": [], + "examples": [ + { + "$id": "640", + "kind": "http", + "name": "DeidServices_ListBySubscription - generated by [MaximumSet] rule. [stable]", + "description": "DeidServices_ListBySubscription - generated by [MaximumSet] rule. [stable]", + "filePath": "2024-09-20/DeidServices_ListBySubscription_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "641", + "parameter": { + "$ref": "627" + }, + "value": { + "$id": "642", + "kind": "string", + "type": { + "$ref": "628" + }, + "value": "2024-09-20" + } + }, + { + "$id": "643", + "parameter": { + "$ref": "631" + }, + "value": { + "$id": "644", + "kind": "string", + "type": { + "$ref": "632" + }, + "value": "F21BB31B-C214-42C0-ACF0-DACCA05D3011" + } + } + ], + "responses": [ + { + "$id": "645", + "response": { + "$ref": "637" + }, + "statusCode": 200, + "bodyValue": { + "$id": "646", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "$id": "647", + "value": { + "$id": "648", + "kind": "array", + "type": { + "$ref": "335" + }, + "value": [ + { + "$id": "649", + "kind": "model", + "type": { + "$ref": "265" + }, + "value": { + "$id": "650", + "properties": { + "$id": "651", + "kind": "model", + "type": { + "$ref": "278" + }, + "value": { + "$id": "652", + "provisioningState": { + "$id": "653", + "kind": "string", + "type": { + "$ref": "38" + }, + "value": "Succeeded" + }, + "serviceUrl": { + "$id": "654", + "kind": "string", + "type": { + "$ref": "283" + }, + "value": "woponotsxaippkvhwmibffywnqcfru" + }, + "privateEndpointConnections": { + "$id": "655", + "kind": "array", + "type": { + "$ref": "287" + }, + "value": [ + { + "$id": "656", + "kind": "model", + "type": { + "$ref": "288" + }, + "value": { + "$id": "657", + "properties": { + "$id": "658", + "kind": "model", + "type": { + "$ref": "195" + }, + "value": { + "$id": "659", + "groupIds": { + "$id": "660", + "kind": "array", + "type": { + "$ref": "197" + }, + "value": [ + { + "$id": "661", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "xbdyjqg" + } + ] + }, + "privateEndpoint": { + "$id": "662", + "kind": "model", + "type": { + "$ref": "202" + }, + "value": { + "$id": "663", + "id": { + "$id": "664", + "kind": "string", + "type": { + "$ref": "204" + }, + "value": "gpnxxbbtsysdhhclm" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "665", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "666", + "status": { + "$id": "667", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Pending" + }, + "actionsRequired": { + "$id": "668", + "kind": "string", + "type": { + "$ref": "220" + }, + "value": "ulb" + }, + "description": { + "$id": "669", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "ro" + } + } + }, + "provisioningState": { + "$id": "670", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "671", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/nlrthrxaukih/privateEndpointConnections/mdwvqjtwcjcvrh" + }, + "name": { + "$id": "672", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "mdwvqjtwcjcvrh" + }, + "type": { + "$id": "673", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "bzxabjlpbwreez" + }, + "systemData": { + "$id": "674", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "675", + "createdBy": { + "$id": "676", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "677", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "678", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "679", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "680", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "681", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + ] + }, + "publicNetworkAccess": { + "$id": "682", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Enabled" + } + } + }, + "identity": { + "$id": "683", + "kind": "model", + "type": { + "$ref": "300" + }, + "value": { + "$id": "684", + "principalId": { + "$id": "685", + "kind": "string", + "type": { + "$ref": "302" + }, + "value": "a82361f4-5320-4a26-8d1b-45832d2164dd" + }, + "tenantId": { + "$id": "686", + "kind": "string", + "type": { + "$ref": "307" + }, + "value": "53a6a686-ae15-4a1d-badf-3e7947918893" + }, + "type": { + "$id": "687", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "688", + "kind": "dict", + "type": { + "$ref": "315" + }, + "value": { + "$id": "689" + } + } + } + }, + "tags": { + "$id": "690", + "kind": "dict", + "type": { + "$ref": "268" + }, + "value": { + "$id": "691" + } + }, + "location": { + "$id": "692", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "qwyhvdwcsjulggagdqxlmazcl" + }, + "id": { + "$id": "693", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/nlrthrxaukih" + }, + "name": { + "$id": "694", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "nlrthrxaukih" + }, + "type": { + "$id": "695", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "slyfiibvwlhfdpzjynsywhbfauexk" + }, + "systemData": { + "$id": "696", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "697", + "createdBy": { + "$id": "698", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "699", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "700", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "701", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "702", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "703", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "704", + "kind": "string", + "type": { + "$ref": "339" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + }, + { + "$id": "705", + "name": "create", + "resourceName": "DeidService", + "doc": "Create a DeidService", + "accessibility": "public", + "parameters": [ + { + "$id": "706", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "707", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "708", + "type": { + "$id": "709", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-20" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "710", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "711", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "712", + "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": "713", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "714", + "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": "715", + "name": "deidServiceName", + "nameInRequest": "deidServiceName", + "doc": "The name of the deid service", + "type": { + "$id": "716", + "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": "717", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "718", + "kind": "constant", + "valueType": { + "$id": "719", + "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": "720", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "721", + "kind": "constant", + "valueType": { + "$id": "722", + "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": "723", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "265" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "724", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "265" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "725", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "265" + }, + "headers": [ + { + "$id": "726", + "name": "azureAsyncOperation", + "nameInResponse": "Azure-AsyncOperation", + "doc": "A link to the status monitor", + "type": { + "$id": "727", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "728", + "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": "729", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "longRunning": { + "$id": "730", + "finalStateVia": 0, + "finalResponse": { + "$id": "731", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "265" + } + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidServices.create", + "decorators": [], + "examples": [ + { + "$id": "732", + "kind": "http", + "name": "DeidServices_Create - generated by [MaximumSet] rule. [stable]", + "description": "DeidServices_Create - generated by [MaximumSet] rule. [stable]", + "filePath": "2024-09-20/DeidServices_Create_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "733", + "parameter": { + "$ref": "706" + }, + "value": { + "$id": "734", + "kind": "string", + "type": { + "$ref": "707" + }, + "value": "2024-09-20" + } + }, + { + "$id": "735", + "parameter": { + "$ref": "710" + }, + "value": { + "$id": "736", + "kind": "string", + "type": { + "$ref": "711" + }, + "value": "F21BB31B-C214-42C0-ACF0-DACCA05D3011" + } + }, + { + "$id": "737", + "parameter": { + "$ref": "713" + }, + "value": { + "$id": "738", + "kind": "string", + "type": { + "$ref": "714" + }, + "value": "rgopenapi" + } + }, + { + "$id": "739", + "parameter": { + "$ref": "715" + }, + "value": { + "$id": "740", + "kind": "string", + "type": { + "$ref": "716" + }, + "value": "deidTest" + } + }, + { + "$id": "741", + "parameter": { + "$ref": "723" + }, + "value": { + "$id": "742", + "kind": "model", + "type": { + "$ref": "265" + }, + "value": { + "$id": "743", + "properties": { + "$id": "744", + "kind": "model", + "type": { + "$ref": "278" + }, + "value": { + "$id": "745", + "publicNetworkAccess": { + "$id": "746", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Enabled" + } + } + }, + "identity": { + "$id": "747", + "kind": "model", + "type": { + "$ref": "300" + }, + "value": { + "$id": "748", + "type": { + "$id": "749", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "750", + "kind": "dict", + "type": { + "$ref": "315" + }, + "value": { + "$id": "751" + } + } + } + }, + "tags": { + "$id": "752", + "kind": "dict", + "type": { + "$ref": "268" + }, + "value": { + "$id": "753" + } + }, + "location": { + "$id": "754", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "qwyhvdwcsjulggagdqxlmazcl" + } + } + } + } + ], + "responses": [ + { + "$id": "755", + "response": { + "$ref": "724" + }, + "statusCode": 200, + "bodyValue": { + "$id": "756", + "kind": "model", + "type": { + "$ref": "265" + }, + "value": { + "$id": "757", + "properties": { + "$id": "758", + "kind": "model", + "type": { + "$ref": "278" + }, + "value": { + "$id": "759", + "provisioningState": { + "$id": "760", + "kind": "string", + "type": { + "$ref": "38" + }, + "value": "Succeeded" + }, + "publicNetworkAccess": { + "$id": "761", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Enabled" + }, + "privateEndpointConnections": { + "$id": "762", + "kind": "array", + "type": { + "$ref": "287" + }, + "value": [ + { + "$id": "763", + "kind": "model", + "type": { + "$ref": "288" + }, + "value": { + "$id": "764", + "properties": { + "$id": "765", + "kind": "model", + "type": { + "$ref": "195" + }, + "value": { + "$id": "766", + "privateEndpoint": { + "$id": "767", + "kind": "model", + "type": { + "$ref": "202" + }, + "value": { + "$id": "768", + "id": { + "$id": "769", + "kind": "string", + "type": { + "$ref": "204" + }, + "value": "gpnxxbbtsysdhhclm" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "770", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "771", + "status": { + "$id": "772", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Pending" + }, + "actionsRequired": { + "$id": "773", + "kind": "string", + "type": { + "$ref": "220" + }, + "value": "ulb" + }, + "description": { + "$id": "774", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "ddxuoved" + } + } + }, + "groupIds": { + "$id": "775", + "kind": "array", + "type": { + "$ref": "197" + }, + "value": [ + { + "$id": "776", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "xbdyjqg" + } + ] + }, + "provisioningState": { + "$id": "777", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "778", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/nlrthrxaukih/privateEndpointConnections/mdwvqjtwcjcvrh" + }, + "name": { + "$id": "779", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "mdwvqjtwcjcvrh" + }, + "type": { + "$id": "780", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "bzxabjlpbwreez" + }, + "systemData": { + "$id": "781", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "782", + "createdBy": { + "$id": "783", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "784", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "785", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "786", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "787", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "788", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + ] + }, + "serviceUrl": { + "$id": "789", + "kind": "string", + "type": { + "$ref": "283" + }, + "value": "woponotsxaippkvhwmibffywnqcfru" + } + } + }, + "identity": { + "$id": "790", + "kind": "model", + "type": { + "$ref": "300" + }, + "value": { + "$id": "791", + "type": { + "$id": "792", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "793", + "kind": "dict", + "type": { + "$ref": "315" + }, + "value": { + "$id": "794" + } + }, + "principalId": { + "$id": "795", + "kind": "string", + "type": { + "$ref": "302" + }, + "value": "a82361f4-5320-4a26-8d1b-45832d2164dd" + }, + "tenantId": { + "$id": "796", + "kind": "string", + "type": { + "$ref": "307" + }, + "value": "53a6a686-ae15-4a1d-badf-3e7947918893" + } + } + }, + "tags": { + "$id": "797", + "kind": "dict", + "type": { + "$ref": "268" + }, + "value": { + "$id": "798" + } + }, + "location": { + "$id": "799", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "qwyhvdwcsjulggagdqxlmazcl" + }, + "id": { + "$id": "800", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/nlrthrxaukih" + }, + "name": { + "$id": "801", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "nlrthrxaukih" + }, + "type": { + "$id": "802", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "slyfiibvwlhfdpzjynsywhbfauexk" + }, + "systemData": { + "$id": "803", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "804", + "createdBy": { + "$id": "805", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "806", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "807", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "808", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "809", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "810", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + }, + { + "$id": "811", + "response": { + "$ref": "725" + }, + "statusCode": 201, + "bodyValue": { + "$id": "812", + "kind": "model", + "type": { + "$ref": "265" + }, + "value": { + "$id": "813", + "properties": { + "$id": "814", + "kind": "model", + "type": { + "$ref": "278" + }, + "value": { + "$id": "815", + "provisioningState": { + "$id": "816", + "kind": "string", + "type": { + "$ref": "38" + }, + "value": "Succeeded" + }, + "publicNetworkAccess": { + "$id": "817", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Enabled" + }, + "privateEndpointConnections": { + "$id": "818", + "kind": "array", + "type": { + "$ref": "287" + }, + "value": [ + { + "$id": "819", + "kind": "model", + "type": { + "$ref": "288" + }, + "value": { + "$id": "820", + "properties": { + "$id": "821", + "kind": "model", + "type": { + "$ref": "195" + }, + "value": { + "$id": "822", + "privateEndpoint": { + "$id": "823", + "kind": "model", + "type": { + "$ref": "202" + }, + "value": { + "$id": "824", + "id": { + "$id": "825", + "kind": "string", + "type": { + "$ref": "204" + }, + "value": "gpnxxbbtsysdhhclm" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "826", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "827", + "status": { + "$id": "828", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Pending" + }, + "actionsRequired": { + "$id": "829", + "kind": "string", + "type": { + "$ref": "220" + }, + "value": "ulb" + }, + "description": { + "$id": "830", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "ddxuoved" + } + } + }, + "groupIds": { + "$id": "831", + "kind": "array", + "type": { + "$ref": "197" + }, + "value": [ + { + "$id": "832", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "xbdyjqg" + } + ] + }, + "provisioningState": { + "$id": "833", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "834", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/nlrthrxaukih/privateEndpointConnections/mdwvqjtwcjcvrh" + }, + "name": { + "$id": "835", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "mdwvqjtwcjcvrh" + }, + "type": { + "$id": "836", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "bzxabjlpbwreez" + }, + "systemData": { + "$id": "837", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "838", + "createdBy": { + "$id": "839", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "840", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "841", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "842", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "843", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "844", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + ] + }, + "serviceUrl": { + "$id": "845", + "kind": "string", + "type": { + "$ref": "283" + }, + "value": "woponotsxaippkvhwmibffywnqcfru" + } + } + }, + "identity": { + "$id": "846", + "kind": "model", + "type": { + "$ref": "300" + }, + "value": { + "$id": "847", + "type": { + "$id": "848", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "849", + "kind": "dict", + "type": { + "$ref": "315" + }, + "value": { + "$id": "850" + } + }, + "principalId": { + "$id": "851", + "kind": "string", + "type": { + "$ref": "302" + }, + "value": "a82361f4-5320-4a26-8d1b-45832d2164dd" + }, + "tenantId": { + "$id": "852", + "kind": "string", + "type": { + "$ref": "307" + }, + "value": "53a6a686-ae15-4a1d-badf-3e7947918893" + } + } + }, + "tags": { + "$id": "853", + "kind": "dict", + "type": { + "$ref": "268" + }, + "value": { + "$id": "854" + } + }, + "location": { + "$id": "855", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "qwyhvdwcsjulggagdqxlmazcl" + }, + "id": { + "$id": "856", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/nlrthrxaukih" + }, + "name": { + "$id": "857", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "nlrthrxaukih" + }, + "type": { + "$id": "858", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "slyfiibvwlhfdpzjynsywhbfauexk" + }, + "systemData": { + "$id": "859", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "860", + "createdBy": { + "$id": "861", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "862", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "863", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "864", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "865", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "866", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "867", + "name": "update", + "resourceName": "DeidService", + "doc": "Update a DeidService", + "accessibility": "public", + "parameters": [ + { + "$id": "868", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "869", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "870", + "type": { + "$id": "871", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-20" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "872", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "873", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "874", + "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": "875", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "876", + "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": "877", + "name": "deidServiceName", + "nameInRequest": "deidServiceName", + "doc": "The name of the deid service", + "type": { + "$id": "878", + "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": "879", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "880", + "kind": "constant", + "valueType": { + "$id": "881", + "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": "882", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "883", + "kind": "constant", + "valueType": { + "$id": "884", + "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": "885", + "name": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "343" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "886", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "265" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "887", + "statusCodes": [ + 202 + ], + "headers": [ + { + "$id": "888", + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "889", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "890", + "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": "891", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + } + ], + "httpMethod": "PATCH", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "longRunning": { + "$id": "892", + "finalStateVia": 1, + "finalResponse": { + "$id": "893", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "265" + } + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": false, + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidServices.update", + "decorators": [], + "examples": [ + { + "$id": "894", + "kind": "http", + "name": "DeidServices_Update - generated by [MaximumSet] rule. [stable]", + "description": "DeidServices_Update - generated by [MaximumSet] rule. [stable]", + "filePath": "2024-09-20/DeidServices_Update_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "895", + "parameter": { + "$ref": "868" + }, + "value": { + "$id": "896", + "kind": "string", + "type": { + "$ref": "869" + }, + "value": "2024-09-20" + } + }, + { + "$id": "897", + "parameter": { + "$ref": "872" + }, + "value": { + "$id": "898", + "kind": "string", + "type": { + "$ref": "873" + }, + "value": "F21BB31B-C214-42C0-ACF0-DACCA05D3011" + } + }, + { + "$id": "899", + "parameter": { + "$ref": "875" + }, + "value": { + "$id": "900", + "kind": "string", + "type": { + "$ref": "876" + }, + "value": "rgopenapi" + } + }, + { + "$id": "901", + "parameter": { + "$ref": "877" + }, + "value": { + "$id": "902", + "kind": "string", + "type": { + "$ref": "878" + }, + "value": "deidTest" + } + }, + { + "$id": "903", + "parameter": { + "$ref": "885" + }, + "value": { + "$id": "904", + "kind": "model", + "type": { + "$ref": "343" + }, + "value": { + "$id": "905", + "identity": { + "$id": "906", + "kind": "model", + "type": { + "$ref": "351" + }, + "value": { + "$id": "907", + "type": { + "$id": "908", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "909", + "kind": "dict", + "type": { + "$ref": "356" + }, + "value": { + "$id": "910" + } + } + } + }, + "tags": { + "$id": "911", + "kind": "dict", + "type": { + "$ref": "345" + }, + "value": { + "$id": "912" + } + }, + "properties": { + "$id": "913", + "kind": "model", + "type": { + "$ref": "363" + }, + "value": { + "$id": "914", + "publicNetworkAccess": { + "$id": "915", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Enabled" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "916", + "response": { + "$ref": "886" + }, + "statusCode": 200, + "bodyValue": { + "$id": "917", + "kind": "model", + "type": { + "$ref": "265" + }, + "value": { + "$id": "918", + "properties": { + "$id": "919", + "kind": "model", + "type": { + "$ref": "278" + }, + "value": { + "$id": "920", + "provisioningState": { + "$id": "921", + "kind": "string", + "type": { + "$ref": "38" + }, + "value": "Succeeded" + }, + "publicNetworkAccess": { + "$id": "922", + "kind": "string", + "type": { + "$ref": "54" + }, + "value": "Enabled" + }, + "privateEndpointConnections": { + "$id": "923", + "kind": "array", + "type": { + "$ref": "287" + }, + "value": [ + { + "$id": "924", + "kind": "model", + "type": { + "$ref": "288" + }, + "value": { + "$id": "925", + "properties": { + "$id": "926", + "kind": "model", + "type": { + "$ref": "195" + }, + "value": { + "$id": "927", + "privateEndpoint": { + "$id": "928", + "kind": "model", + "type": { + "$ref": "202" + }, + "value": { + "$id": "929", + "id": { + "$id": "930", + "kind": "string", + "type": { + "$ref": "204" + }, + "value": "gpnxxbbtsysdhhclm" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "931", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "932", + "status": { + "$id": "933", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Pending" + }, + "actionsRequired": { + "$id": "934", + "kind": "string", + "type": { + "$ref": "220" + }, + "value": "ulb" + }, + "description": { + "$id": "935", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "ddxuoved" + } + } + }, + "groupIds": { + "$id": "936", + "kind": "array", + "type": { + "$ref": "197" + }, + "value": [ + { + "$id": "937", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "xbdyjqg" + } + ] + }, + "provisioningState": { + "$id": "938", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "939", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/nlrthrxaukih/privateEndpointConnections/mdwvqjtwcjcvrh" + }, + "name": { + "$id": "940", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "mdwvqjtwcjcvrh" + }, + "type": { + "$id": "941", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "bzxabjlpbwreez" + }, + "systemData": { + "$id": "942", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "943", + "createdBy": { + "$id": "944", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "945", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "946", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "947", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "948", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "949", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + ] + }, + "serviceUrl": { + "$id": "950", + "kind": "string", + "type": { + "$ref": "283" + }, + "value": "woponotsxaippkvhwmibffywnqcfru" + } + } + }, + "identity": { + "$id": "951", + "kind": "model", + "type": { + "$ref": "300" + }, + "value": { + "$id": "952", + "type": { + "$id": "953", + "kind": "string", + "type": { + "$ref": "60" + }, + "value": "None" + }, + "userAssignedIdentities": { + "$id": "954", + "kind": "dict", + "type": { + "$ref": "315" + }, + "value": { + "$id": "955" + } + }, + "principalId": { + "$id": "956", + "kind": "string", + "type": { + "$ref": "302" + }, + "value": "a82361f4-5320-4a26-8d1b-45832d2164dd" + }, + "tenantId": { + "$id": "957", + "kind": "string", + "type": { + "$ref": "307" + }, + "value": "53a6a686-ae15-4a1d-badf-3e7947918893" + } + } + }, + "tags": { + "$id": "958", + "kind": "dict", + "type": { + "$ref": "268" + }, + "value": { + "$id": "959" + } + }, + "location": { + "$id": "960", + "kind": "string", + "type": { + "$ref": "274" + }, + "value": "qwyhvdwcsjulggagdqxlmazcl" + }, + "id": { + "$id": "961", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/nlrthrxaukih" + }, + "name": { + "$id": "962", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "nlrthrxaukih" + }, + "type": { + "$id": "963", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "slyfiibvwlhfdpzjynsywhbfauexk" + }, + "systemData": { + "$id": "964", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "965", + "createdBy": { + "$id": "966", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "967", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "968", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "969", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "970", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "971", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + }, + { + "$id": "972", + "response": { + "$ref": "887" + }, + "statusCode": 202 + } + ] + } + ] + }, + { + "$id": "973", + "name": "delete", + "resourceName": "DeidService", + "doc": "Delete a DeidService", + "accessibility": "public", + "parameters": [ + { + "$id": "974", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "975", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "976", + "type": { + "$id": "977", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-20" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "978", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "979", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "980", + "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": "981", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "982", + "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": "983", + "name": "deidServiceName", + "nameInRequest": "deidServiceName", + "doc": "The name of the deid service", + "type": { + "$id": "984", + "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": "985", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "986", + "kind": "constant", + "valueType": { + "$id": "987", + "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": "988", + "statusCodes": [ + 202 + ], + "headers": [ + { + "$id": "989", + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "990", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "991", + "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": "992", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "$id": "993", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}", + "bufferResponse": true, + "longRunning": { + "$id": "994", + "finalStateVia": 1, + "finalResponse": { + "$id": "995", + "statusCodes": [ + 204 + ] + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidServices.delete", + "decorators": [], + "examples": [ + { + "$id": "996", + "kind": "http", + "name": "DeidServices_Delete - generated by [MaximumSet] rule. [stable]", + "description": "DeidServices_Delete - generated by [MaximumSet] rule. [stable]", + "filePath": "2024-09-20/DeidServices_Delete_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "997", + "parameter": { + "$ref": "974" + }, + "value": { + "$id": "998", + "kind": "string", + "type": { + "$ref": "975" + }, + "value": "2024-09-20" + } + }, + { + "$id": "999", + "parameter": { + "$ref": "978" + }, + "value": { + "$id": "1000", + "kind": "string", + "type": { + "$ref": "979" + }, + "value": "F21BB31B-C214-42C0-ACF0-DACCA05D3011" + } + }, + { + "$id": "1001", + "parameter": { + "$ref": "981" + }, + "value": { + "$id": "1002", + "kind": "string", + "type": { + "$ref": "982" + }, + "value": "rgopenapi" + } + }, + { + "$id": "1003", + "parameter": { + "$ref": "983" + }, + "value": { + "$id": "1004", + "kind": "string", + "type": { + "$ref": "984" + }, + "value": "deidTest" + } + } + ], + "responses": [ + { + "$id": "1005", + "response": { + "$ref": "988" + }, + "statusCode": 202 + }, + { + "$id": "1006", + "response": { + "$ref": "993" + }, + "statusCode": 204 + } + ] + } + ] + } + ], + "parent": "HealthDataAIServicesClient", + "parameters": [ + { + "$id": "1007", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "1008", + "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": "1009", + "type": { + "$id": "1010", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.DeidServices" + }, + { + "$id": "1011", + "name": "PrivateEndpointConnections", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "doc": "Private connection operations", + "operations": [ + { + "$id": "1012", + "name": "get", + "resourceName": "PrivateEndpointConnectionResource", + "doc": "Get a specific private connection", + "accessibility": "public", + "parameters": [ + { + "$id": "1013", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1014", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1015", + "type": { + "$id": "1016", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-20" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1017", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1018", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1019", + "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": "1020", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1021", + "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": "1022", + "name": "deidServiceName", + "nameInRequest": "deidServiceName", + "doc": "The name of the deid service", + "type": { + "$id": "1023", + "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": "1024", + "name": "privateEndpointConnectionName", + "nameInRequest": "privateEndpointConnectionName", + "doc": "The name of the private endpoint connection associated with the Azure resource.", + "type": { + "$id": "1025", + "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": "1026", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1027", + "kind": "constant", + "valueType": { + "$id": "1028", + "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": "1029", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "193" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.PrivateEndpointConnections.get", + "decorators": [], + "examples": [ + { + "$id": "1030", + "kind": "http", + "name": "PrivateEndpointConnections_Get - generated by [MaximumSet] rule. [stable]", + "description": "PrivateEndpointConnections_Get - generated by [MaximumSet] rule. [stable]", + "filePath": "2024-09-20/PrivateEndpointConnections_Get_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "1031", + "parameter": { + "$ref": "1013" + }, + "value": { + "$id": "1032", + "kind": "string", + "type": { + "$ref": "1014" + }, + "value": "2024-09-20" + } + }, + { + "$id": "1033", + "parameter": { + "$ref": "1017" + }, + "value": { + "$id": "1034", + "kind": "string", + "type": { + "$ref": "1018" + }, + "value": "F21BB31B-C214-42C0-ACF0-DACCA05D3011" + } + }, + { + "$id": "1035", + "parameter": { + "$ref": "1020" + }, + "value": { + "$id": "1036", + "kind": "string", + "type": { + "$ref": "1021" + }, + "value": "rgopenapi" + } + }, + { + "$id": "1037", + "parameter": { + "$ref": "1022" + }, + "value": { + "$id": "1038", + "kind": "string", + "type": { + "$ref": "1023" + }, + "value": "deidTest" + } + }, + { + "$id": "1039", + "parameter": { + "$ref": "1024" + }, + "value": { + "$id": "1040", + "kind": "string", + "type": { + "$ref": "1025" + }, + "value": "kgwgrrpabvrsrrvpcgcnfmyfgyrl" + } + } + ], + "responses": [ + { + "$id": "1041", + "response": { + "$ref": "1029" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1042", + "kind": "model", + "type": { + "$ref": "193" + }, + "value": { + "$id": "1043", + "properties": { + "$id": "1044", + "kind": "model", + "type": { + "$ref": "195" + }, + "value": { + "$id": "1045", + "privateEndpoint": { + "$id": "1046", + "kind": "model", + "type": { + "$ref": "202" + }, + "value": { + "$id": "1047", + "id": { + "$id": "1048", + "kind": "string", + "type": { + "$ref": "204" + }, + "value": "gpnxxbbtsysdhhclm" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "1049", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "1050", + "status": { + "$id": "1051", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Pending" + }, + "actionsRequired": { + "$id": "1052", + "kind": "string", + "type": { + "$ref": "220" + }, + "value": "ulb" + }, + "description": { + "$id": "1053", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "xr" + } + } + }, + "groupIds": { + "$id": "1054", + "kind": "array", + "type": { + "$ref": "197" + }, + "value": [ + { + "$id": "1055", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "xbdyjqg" + } + ] + }, + "provisioningState": { + "$id": "1056", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "1057", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/deidTest/privateEndpointConnections/aduyb" + }, + "name": { + "$id": "1058", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "aduyb" + }, + "type": { + "$id": "1059", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "umjjkodjuhccrngl" + }, + "systemData": { + "$id": "1060", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "1061", + "createdBy": { + "$id": "1062", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "1063", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "1064", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "1065", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "1066", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1067", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1068", + "name": "create", + "resourceName": "PrivateEndpointConnectionResource", + "doc": "Create a Private endpoint connection", + "accessibility": "public", + "parameters": [ + { + "$id": "1069", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1070", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1071", + "type": { + "$id": "1072", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-20" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1073", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1074", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1075", + "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": "1076", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "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": "deidServiceName", + "nameInRequest": "deidServiceName", + "doc": "The name of the deid service", + "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": "privateEndpointConnectionName", + "nameInRequest": "privateEndpointConnectionName", + "doc": "The name of the private endpoint connection associated with the Azure resource.", + "type": { + "$id": "1081", + "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": "1082", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "1083", + "kind": "constant", + "valueType": { + "$id": "1084", + "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": "1085", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1086", + "kind": "constant", + "valueType": { + "$id": "1087", + "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": "1088", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "193" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1089", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "193" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "1090", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "193" + }, + "headers": [ + { + "$id": "1091", + "name": "azureAsyncOperation", + "nameInResponse": "Azure-AsyncOperation", + "doc": "A link to the status monitor", + "type": { + "$id": "1092", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1093", + "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": "1094", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "longRunning": { + "$id": "1095", + "finalStateVia": 0, + "finalResponse": { + "$id": "1096", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "193" + } + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.PrivateEndpointConnections.create", + "decorators": [], + "examples": [ + { + "$id": "1097", + "kind": "http", + "name": "PrivateEndpointConnections_Create - generated by [MaximumSet] rule. [stable]", + "description": "PrivateEndpointConnections_Create - generated by [MaximumSet] rule. [stable]", + "filePath": "2024-09-20/PrivateEndpointConnections_Create_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "1098", + "parameter": { + "$ref": "1069" + }, + "value": { + "$id": "1099", + "kind": "string", + "type": { + "$ref": "1070" + }, + "value": "2024-09-20" + } + }, + { + "$id": "1100", + "parameter": { + "$ref": "1073" + }, + "value": { + "$id": "1101", + "kind": "string", + "type": { + "$ref": "1074" + }, + "value": "F21BB31B-C214-42C0-ACF0-DACCA05D3011" + } + }, + { + "$id": "1102", + "parameter": { + "$ref": "1076" + }, + "value": { + "$id": "1103", + "kind": "string", + "type": { + "$ref": "1077" + }, + "value": "rgopenapi" + } + }, + { + "$id": "1104", + "parameter": { + "$ref": "1078" + }, + "value": { + "$id": "1105", + "kind": "string", + "type": { + "$ref": "1079" + }, + "value": "deidTest" + } + }, + { + "$id": "1106", + "parameter": { + "$ref": "1080" + }, + "value": { + "$id": "1107", + "kind": "string", + "type": { + "$ref": "1081" + }, + "value": "kgwgrrpabvrsrrvpcgcnfmyfgyrl" + } + }, + { + "$id": "1108", + "parameter": { + "$ref": "1088" + }, + "value": { + "$id": "1109", + "kind": "model", + "type": { + "$ref": "193" + }, + "value": { + "$id": "1110", + "properties": { + "$id": "1111", + "kind": "model", + "type": { + "$ref": "195" + }, + "value": { + "$id": "1112", + "privateEndpoint": { + "$id": "1113", + "kind": "model", + "type": { + "$ref": "202" + }, + "value": { + "$id": "1114" + } + }, + "privateLinkServiceConnectionState": { + "$id": "1115", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "1116", + "status": { + "$id": "1117", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Pending" + }, + "actionsRequired": { + "$id": "1118", + "kind": "string", + "type": { + "$ref": "220" + }, + "value": "ulb" + }, + "description": { + "$id": "1119", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "xr" + } + } + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "1120", + "response": { + "$ref": "1089" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1121", + "kind": "model", + "type": { + "$ref": "193" + }, + "value": { + "$id": "1122", + "properties": { + "$id": "1123", + "kind": "model", + "type": { + "$ref": "195" + }, + "value": { + "$id": "1124", + "privateEndpoint": { + "$id": "1125", + "kind": "model", + "type": { + "$ref": "202" + }, + "value": { + "$id": "1126", + "id": { + "$id": "1127", + "kind": "string", + "type": { + "$ref": "204" + }, + "value": "gpnxxbbtsysdhhclm" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "1128", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "1129", + "status": { + "$id": "1130", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Pending" + }, + "actionsRequired": { + "$id": "1131", + "kind": "string", + "type": { + "$ref": "220" + }, + "value": "ulb" + }, + "description": { + "$id": "1132", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "xr" + } + } + }, + "groupIds": { + "$id": "1133", + "kind": "array", + "type": { + "$ref": "197" + }, + "value": [ + { + "$id": "1134", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "xbdyjqg" + } + ] + }, + "provisioningState": { + "$id": "1135", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "1136", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/deidTest/privateEndpointConnections/aduyb" + }, + "name": { + "$id": "1137", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "aduyb" + }, + "type": { + "$id": "1138", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "umjjkodjuhccrngl" + }, + "systemData": { + "$id": "1139", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "1140", + "createdBy": { + "$id": "1141", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "1142", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "1143", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "1144", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "1145", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1146", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + }, + { + "$id": "1147", + "response": { + "$ref": "1090" + }, + "statusCode": 201, + "bodyValue": { + "$id": "1148", + "kind": "model", + "type": { + "$ref": "193" + }, + "value": { + "$id": "1149", + "properties": { + "$id": "1150", + "kind": "model", + "type": { + "$ref": "195" + }, + "value": { + "$id": "1151", + "privateEndpoint": { + "$id": "1152", + "kind": "model", + "type": { + "$ref": "202" + }, + "value": { + "$id": "1153", + "id": { + "$id": "1154", + "kind": "string", + "type": { + "$ref": "204" + }, + "value": "gpnxxbbtsysdhhclm" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "1155", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "1156", + "status": { + "$id": "1157", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Pending" + }, + "actionsRequired": { + "$id": "1158", + "kind": "string", + "type": { + "$ref": "220" + }, + "value": "ulb" + }, + "description": { + "$id": "1159", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "xr" + } + } + }, + "groupIds": { + "$id": "1160", + "kind": "array", + "type": { + "$ref": "197" + }, + "value": [ + { + "$id": "1161", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "xbdyjqg" + } + ] + }, + "provisioningState": { + "$id": "1162", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "1163", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/deidTest/privateEndpointConnections/aduyb" + }, + "name": { + "$id": "1164", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "aduyb" + }, + "type": { + "$id": "1165", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "umjjkodjuhccrngl" + }, + "systemData": { + "$id": "1166", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "1167", + "createdBy": { + "$id": "1168", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "1169", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "1170", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "1171", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "1172", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1173", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1174", + "name": "delete", + "resourceName": "PrivateEndpointConnectionResource", + "doc": "Delete the private endpoint connection", + "accessibility": "public", + "parameters": [ + { + "$id": "1175", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1176", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1177", + "type": { + "$id": "1178", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-20" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1179", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1180", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1181", + "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": "1182", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1183", + "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": "1184", + "name": "deidServiceName", + "nameInRequest": "deidServiceName", + "doc": "The name of the deid service", + "type": { + "$id": "1185", + "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": "1186", + "name": "privateEndpointConnectionName", + "nameInRequest": "privateEndpointConnectionName", + "doc": "The name of the private endpoint connection associated with the Azure resource.", + "type": { + "$id": "1187", + "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": "1188", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1189", + "kind": "constant", + "valueType": { + "$id": "1190", + "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": "1191", + "statusCodes": [ + 202 + ], + "headers": [ + { + "$id": "1192", + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "1193", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1194", + "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": "1195", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "$id": "1196", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", + "bufferResponse": true, + "longRunning": { + "$id": "1197", + "finalStateVia": 1, + "finalResponse": { + "$id": "1198", + "statusCodes": [ + 204 + ] + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.PrivateEndpointConnections.delete", + "decorators": [], + "examples": [ + { + "$id": "1199", + "kind": "http", + "name": "PrivateEndpointConnections_Delete - generated by [MaximumSet] rule. [stable]", + "description": "PrivateEndpointConnections_Delete - generated by [MaximumSet] rule. [stable]", + "filePath": "2024-09-20/PrivateEndpointConnections_Delete_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "1200", + "parameter": { + "$ref": "1175" + }, + "value": { + "$id": "1201", + "kind": "string", + "type": { + "$ref": "1176" + }, + "value": "2024-09-20" + } + }, + { + "$id": "1202", + "parameter": { + "$ref": "1179" + }, + "value": { + "$id": "1203", + "kind": "string", + "type": { + "$ref": "1180" + }, + "value": "F21BB31B-C214-42C0-ACF0-DACCA05D3011" + } + }, + { + "$id": "1204", + "parameter": { + "$ref": "1182" + }, + "value": { + "$id": "1205", + "kind": "string", + "type": { + "$ref": "1183" + }, + "value": "rgopenapi" + } + }, + { + "$id": "1206", + "parameter": { + "$ref": "1184" + }, + "value": { + "$id": "1207", + "kind": "string", + "type": { + "$ref": "1185" + }, + "value": "deidTest" + } + }, + { + "$id": "1208", + "parameter": { + "$ref": "1186" + }, + "value": { + "$id": "1209", + "kind": "string", + "type": { + "$ref": "1187" + }, + "value": "kgwgrrpabvrsrrvpcgcnfmyfgyrl" + } + } + ], + "responses": [ + { + "$id": "1210", + "response": { + "$ref": "1191" + }, + "statusCode": 202 + }, + { + "$id": "1211", + "response": { + "$ref": "1196" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "1212", + "name": "listByDeidService", + "resourceName": "PrivateEndpointConnectionResource", + "doc": "List private endpoint connections on the given resource", + "accessibility": "public", + "parameters": [ + { + "$id": "1213", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1214", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1215", + "type": { + "$id": "1216", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-20" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1217", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1218", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1219", + "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": "1220", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1221", + "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": "1222", + "name": "deidServiceName", + "nameInRequest": "deidServiceName", + "doc": "The name of the deid service", + "type": { + "$id": "1223", + "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": "1224", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1225", + "kind": "constant", + "valueType": { + "$id": "1226", + "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": "1227", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "255" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}/privateEndpointConnections", + "bufferResponse": true, + "paging": { + "$id": "1228", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1229", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.PrivateEndpointConnections.listByDeidService", + "decorators": [], + "examples": [ + { + "$id": "1230", + "kind": "http", + "name": "PrivateEndpointConnections_ListByDeidService - generated by [MaximumSet] rule. [stable]", + "description": "PrivateEndpointConnections_ListByDeidService - generated by [MaximumSet] rule. [stable]", + "filePath": "2024-09-20/PrivateEndpointConnections_ListByDeidService_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "1231", + "parameter": { + "$ref": "1213" + }, + "value": { + "$id": "1232", + "kind": "string", + "type": { + "$ref": "1214" + }, + "value": "2024-09-20" + } + }, + { + "$id": "1233", + "parameter": { + "$ref": "1217" + }, + "value": { + "$id": "1234", + "kind": "string", + "type": { + "$ref": "1218" + }, + "value": "F21BB31B-C214-42C0-ACF0-DACCA05D3011" + } + }, + { + "$id": "1235", + "parameter": { + "$ref": "1220" + }, + "value": { + "$id": "1236", + "kind": "string", + "type": { + "$ref": "1221" + }, + "value": "rgopenapi" + } + }, + { + "$id": "1237", + "parameter": { + "$ref": "1222" + }, + "value": { + "$id": "1238", + "kind": "string", + "type": { + "$ref": "1223" + }, + "value": "deidTest" + } + } + ], + "responses": [ + { + "$id": "1239", + "response": { + "$ref": "1227" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1240", + "kind": "model", + "type": { + "$ref": "255" + }, + "value": { + "$id": "1241", + "value": { + "$id": "1242", + "kind": "array", + "type": { + "$ref": "257" + }, + "value": [ + { + "$id": "1243", + "kind": "model", + "type": { + "$ref": "193" + }, + "value": { + "$id": "1244", + "properties": { + "$id": "1245", + "kind": "model", + "type": { + "$ref": "195" + }, + "value": { + "$id": "1246", + "privateEndpoint": { + "$id": "1247", + "kind": "model", + "type": { + "$ref": "202" + }, + "value": { + "$id": "1248", + "id": { + "$id": "1249", + "kind": "string", + "type": { + "$ref": "204" + }, + "value": "gpnxxbbtsysdhhclm" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "1250", + "kind": "model", + "type": { + "$ref": "211" + }, + "value": { + "$id": "1251", + "status": { + "$id": "1252", + "kind": "string", + "type": { + "$ref": "12" + }, + "value": "Pending" + }, + "actionsRequired": { + "$id": "1253", + "kind": "string", + "type": { + "$ref": "220" + }, + "value": "ulb" + }, + "description": { + "$id": "1254", + "kind": "string", + "type": { + "$ref": "216" + }, + "value": "mmvcleuufspfrojjveuith" + } + } + }, + "groupIds": { + "$id": "1255", + "kind": "array", + "type": { + "$ref": "197" + }, + "value": [ + { + "$id": "1256", + "kind": "string", + "type": { + "$ref": "198" + }, + "value": "xbdyjqg" + } + ] + }, + "provisioningState": { + "$id": "1257", + "kind": "string", + "type": { + "$ref": "20" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "1258", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/deidTest/privateEndpointConnections/aduyb" + }, + "name": { + "$id": "1259", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "aduyb" + }, + "type": { + "$id": "1260", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "umjjkodjuhccrngl" + }, + "systemData": { + "$id": "1261", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "1262", + "createdBy": { + "$id": "1263", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "1264", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "1265", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "1266", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "1267", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1268", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1269", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "parent": "HealthDataAIServicesClient", + "parameters": [ + { + "$id": "1270", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "1271", + "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": "1272", + "type": { + "$id": "1273", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.PrivateEndpointConnections" + }, + { + "$id": "1274", + "name": "PrivateLinks", + "namespace": "Azure.ResourceManager.HealthDataAIServices", + "doc": "Operations for private links on DeidService resource", + "operations": [ + { + "$id": "1275", + "name": "listByDeidService", + "resourceName": "PrivateLinkResource", + "doc": "List private links on the given resource", + "accessibility": "public", + "parameters": [ + { + "$id": "1276", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1277", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1278", + "type": { + "$id": "1279", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-20" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1280", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1281", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1282", + "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": "1283", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1284", + "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": "1285", + "name": "deidServiceName", + "nameInRequest": "deidServiceName", + "doc": "The name of the deid service", + "type": { + "$id": "1286", + "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": "1287", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1288", + "kind": "constant", + "valueType": { + "$id": "1289", + "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": "1290", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "86" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices/{deidServiceName}/privateLinkResources", + "bufferResponse": true, + "paging": { + "$id": "1291", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1292", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.PrivateLinks.listByDeidService", + "decorators": [], + "examples": [ + { + "$id": "1293", + "kind": "http", + "name": "PrivateLinks_ListByDeidService - generated by [MaximumSet] rule. [stable]", + "description": "PrivateLinks_ListByDeidService - generated by [MaximumSet] rule. [stable]", + "filePath": "2024-09-20/PrivateLinks_ListByDeidService_MaximumSet_Gen.json", + "parameters": [ + { + "$id": "1294", + "parameter": { + "$ref": "1276" + }, + "value": { + "$id": "1295", + "kind": "string", + "type": { + "$ref": "1277" + }, + "value": "2024-09-20" + } + }, + { + "$id": "1296", + "parameter": { + "$ref": "1280" + }, + "value": { + "$id": "1297", + "kind": "string", + "type": { + "$ref": "1281" + }, + "value": "F21BB31B-C214-42C0-ACF0-DACCA05D3011" + } + }, + { + "$id": "1298", + "parameter": { + "$ref": "1283" + }, + "value": { + "$id": "1299", + "kind": "string", + "type": { + "$ref": "1284" + }, + "value": "rgopenapi" + } + }, + { + "$id": "1300", + "parameter": { + "$ref": "1285" + }, + "value": { + "$id": "1301", + "kind": "string", + "type": { + "$ref": "1286" + }, + "value": "deidTest" + } + } + ], + "responses": [ + { + "$id": "1302", + "response": { + "$ref": "1290" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1303", + "kind": "model", + "type": { + "$ref": "86" + }, + "value": { + "$id": "1304", + "value": { + "$id": "1305", + "kind": "array", + "type": { + "$ref": "88" + }, + "value": [ + { + "$id": "1306", + "kind": "model", + "type": { + "$ref": "89" + }, + "value": { + "$id": "1307", + "properties": { + "$id": "1308", + "kind": "model", + "type": { + "$ref": "135" + }, + "value": { + "$id": "1309", + "groupId": { + "$id": "1310", + "kind": "string", + "type": { + "$ref": "137" + }, + "value": "flaloakbdcqjisfhfnkrxmt" + }, + "requiredMembers": { + "$id": "1311", + "kind": "array", + "type": { + "$ref": "141" + }, + "value": [ + { + "$id": "1312", + "kind": "string", + "type": { + "$ref": "142" + }, + "value": "wbraaugftjqa" + } + ] + }, + "requiredZoneNames": { + "$id": "1313", + "kind": "array", + "type": { + "$ref": "146" + }, + "value": [ + { + "$id": "1314", + "kind": "string", + "type": { + "$ref": "147" + }, + "value": "ndsmc" + } + ] + } + } + }, + "id": { + "$id": "1315", + "kind": "string", + "type": { + "$ref": "93" + }, + "value": "/subscriptions/F21BB31B-C214-42C0-ACF0-DACCA05D3011/resourceGroups/rgopenapi/providers/Microsoft.HealthDataAIServices/deidServices/deidTest/privateLinkResources/rmptbzejhgxhlfpdizsekhsq" + }, + "name": { + "$id": "1316", + "kind": "string", + "type": { + "$ref": "98" + }, + "value": "rmptbzejhgxhlfpdizsekhsq" + }, + "type": { + "$id": "1317", + "kind": "string", + "type": { + "$ref": "102" + }, + "value": "lplbvyjkvsujegzqr" + }, + "systemData": { + "$id": "1318", + "kind": "model", + "type": { + "$ref": "107" + }, + "value": { + "$id": "1319", + "createdBy": { + "$id": "1320", + "kind": "string", + "type": { + "$ref": "109" + }, + "value": "p" + }, + "createdByType": { + "$id": "1321", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "createdAt": { + "$id": "1322", + "kind": "string", + "type": { + "$ref": "116" + }, + "value": "2024-04-13T19:47:24.985Z" + }, + "lastModifiedBy": { + "$id": "1323", + "kind": "string", + "type": { + "$ref": "121" + }, + "value": "pmbozfvwrblbknedeb" + }, + "lastModifiedByType": { + "$id": "1324", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1325", + "kind": "string", + "type": { + "$ref": "128" + }, + "value": "2024-04-13T19:47:24.986Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1326", + "kind": "string", + "type": { + "$ref": "155" + }, + "value": "https://microsoft.com/arzijt" + } + } + } + } + ] + } + ] + } + ], + "parent": "HealthDataAIServicesClient", + "parameters": [ + { + "$id": "1327", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "1328", + "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": "1329", + "type": { + "$id": "1330", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HealthDataAIServices.PrivateLinks" + } + ], + "auth": { + "$id": "1331", + "oAuth2": { + "$id": "1332", + "scopes": [ + "user_impersonation" + ] + } + } +} diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 15e7655c7b93..27b5cc1abe45 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -40,6 +40,7 @@ trigger: - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis - sdk/chaos/Azure.ResourceManager.Chaos - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices + - sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations - sdk/communication/Azure.ResourceManager.Communication - sdk/compute/Azure.ResourceManager.Compute - sdk/computefleet/Azure.ResourceManager.ComputeFleet @@ -57,6 +58,7 @@ trigger: - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql - sdk/costmanagement/Azure.ResourceManager.CostManagement - sdk/customer-insights/Azure.ResourceManager.CustomerInsights + - sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager - sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher - sdk/databox/Azure.ResourceManager.DataBox - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge @@ -248,6 +250,7 @@ pr: - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis - sdk/chaos/Azure.ResourceManager.Chaos - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices + - sdk/commonedgesitemanageroperations/Azure.ResourceManager.CommonEdgeSiteManagerOperations - sdk/communication/Azure.ResourceManager.Communication - sdk/compute/Azure.ResourceManager.Compute - sdk/computefleet/Azure.ResourceManager.ComputeFleet @@ -265,6 +268,7 @@ pr: - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql - sdk/costmanagement/Azure.ResourceManager.CostManagement - sdk/customer-insights/Azure.ResourceManager.CustomerInsights + - sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager - sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher - sdk/databox/Azure.ResourceManager.DataBox - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge 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 2a73ebd28170..16a0c12d2153 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: 7bc390ce48e29aeb16d6521472b781813b146343 -repo: Azure/azure-rest-api-specs \ No newline at end of file +directory: specification/standbypool/StandbyPool.Management +commit: 216cc05a932c0770a40b19ebafd0c76a5c17809b +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..1d5f852ef130 --- /dev/null +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/tspCodeModel.json @@ -0,0 +1,16273 @@ +{ + "$id": "1", + "name": "Microsoft.StandbyPool", + "apiVersions": [ + "2024-03-01", + "2025-03-01" + ], + "enums": [ + { + "$id": "2", + "kind": "enum", + "name": "PoolContainerGroupState", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolContainerGroupState", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "Running", + "value": "Running", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The container group is up and running.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "Creating", + "value": "Creating", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "doc": "The container group is creating.", + "decorators": [] + }, + { + "$id": "8", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "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": "10", + "kind": "enum", + "name": "HealthStateCode", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.HealthStateCode", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "12", + "kind": "enumvalue", + "name": "healthy", + "value": "HealthState/healthy", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "doc": "StandbyPool is in healthy state.", + "decorators": [] + }, + { + "$id": "14", + "kind": "enumvalue", + "name": "degraded", + "value": "HealthState/degraded", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "doc": "StandbyPool is in degraded state.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.StandbyPool", + "doc": "StandbyPool health state.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "16", + "kind": "enum", + "name": "StandbyProvisioningState", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ProvisioningState", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "18", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "16" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "20", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "16" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "22", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "16" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + }, + { + "$id": "24", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "16" + }, + "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": "26", + "kind": "enum", + "name": "createdByType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.createdByType", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "28", + "kind": "enumvalue", + "name": "User", + "value": "User", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "26" + }, + "doc": "The entity was created by a user.", + "decorators": [] + }, + { + "$id": "30", + "kind": "enumvalue", + "name": "Application", + "value": "Application", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "26" + }, + "doc": "The entity was created by an application.", + "decorators": [] + }, + { + "$id": "32", + "kind": "enumvalue", + "name": "ManagedIdentity", + "value": "ManagedIdentity", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "26" + }, + "doc": "The entity was created by a managed identity.", + "decorators": [] + }, + { + "$id": "34", + "kind": "enumvalue", + "name": "Key", + "value": "Key", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "26" + }, + "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": "36", + "kind": "enum", + "name": "StandbyRefillPolicy", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.RefillPolicy", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "38", + "kind": "enumvalue", + "name": "always", + "value": "always", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "36" + }, + "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": "40", + "kind": "enum", + "name": "ResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceProvisioningState", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "42", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "44", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "46", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "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": "48", + "kind": "enum", + "name": "PoolVirtualMachineState", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolVirtualMachineState", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "50", + "kind": "enumvalue", + "name": "Running", + "value": "Running", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "The virtual machine is up and running.", + "decorators": [] + }, + { + "$id": "52", + "kind": "enumvalue", + "name": "Creating", + "value": "Creating", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "The virtual machine is creating.", + "decorators": [] + }, + { + "$id": "54", + "kind": "enumvalue", + "name": "Starting", + "value": "Starting", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "The virtual machine is starting.", + "decorators": [] + }, + { + "$id": "56", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "The virtual machine is deleting.", + "decorators": [] + }, + { + "$id": "58", + "kind": "enumvalue", + "name": "Deallocated", + "value": "Deallocated", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "The virtual machine has released the lease on the underlying hardware and is powered off.", + "decorators": [] + }, + { + "$id": "60", + "kind": "enumvalue", + "name": "Deallocating", + "value": "Deallocating", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "doc": "The virtual machine is releasing the lease on the underlying hardware and is powered off.", + "decorators": [] + }, + { + "$id": "62", + "kind": "enumvalue", + "name": "Hibernated", + "value": "Hibernated", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "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": "64", + "kind": "enumvalue", + "name": "Hibernating", + "value": "Hibernating", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "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": "66", + "kind": "enum", + "name": "StandbyVirtualMachineState", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineState", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "68", + "kind": "enumvalue", + "name": "Running", + "value": "Running", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "The virtual machine is up and running.", + "decorators": [] + }, + { + "$id": "70", + "kind": "enumvalue", + "name": "Deallocated", + "value": "Deallocated", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "doc": "The virtual machine has released the lease on the underlying hardware and is powered off.", + "decorators": [] + }, + { + "$id": "72", + "kind": "enumvalue", + "name": "Hibernated", + "value": "Hibernated", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "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": "74", + "kind": "enum", + "name": "Origin", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Origin", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "76", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "74" + }, + "doc": "Indicates the operation is initiated by a user.", + "decorators": [] + }, + { + "$id": "78", + "kind": "enumvalue", + "name": "system", + "value": "system", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "74" + }, + "doc": "Indicates the operation is initiated by a system.", + "decorators": [] + }, + { + "$id": "80", + "kind": "enumvalue", + "name": "user,system", + "value": "user,system", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "74" + }, + "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": "82", + "kind": "enum", + "name": "ActionType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ActionType", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "84", + "kind": "enumvalue", + "name": "Internal", + "value": "Internal", + "valueType": { + "$id": "85", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "82" + }, + "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": "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": "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": { + "$id": "93", + "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": { + "$id": "94", + "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": "95", + "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": "96", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "97", + "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": "98", + "json": { + "$id": "99", + "name": "id" + } + } + }, + { + "$id": "100", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the resource", + "type": { + "$id": "101", + "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": "102", + "json": { + "$id": "103", + "name": "name" + } + } + }, + { + "$id": "104", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"", + "type": { + "$id": "105", + "kind": "string", + "name": "armResourceType", + "crossLanguageDefinitionId": "Azure.Core.armResourceType", + "baseType": { + "$id": "106", + "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": "107", + "json": { + "$id": "108", + "name": "type" + } + } + }, + { + "$id": "109", + "kind": "property", + "name": "systemData", + "serializedName": "systemData", + "doc": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "type": { + "$id": "110", + "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": "111", + "kind": "property", + "name": "createdBy", + "serializedName": "createdBy", + "doc": "The identity that created the resource.", + "type": { + "$id": "112", + "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": "113", + "json": { + "$id": "114", + "name": "createdBy" + } + } + }, + { + "$id": "115", + "kind": "property", + "name": "createdByType", + "serializedName": "createdByType", + "doc": "The type of identity that created the resource.", + "type": { + "$ref": "26" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdByType", + "serializationOptions": { + "$id": "116", + "json": { + "$id": "117", + "name": "createdByType" + } + } + }, + { + "$id": "118", + "kind": "property", + "name": "createdAt", + "serializedName": "createdAt", + "doc": "The timestamp of resource creation (UTC).", + "type": { + "$id": "119", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "120", + "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": "121", + "json": { + "$id": "122", + "name": "createdAt" + } + } + }, + { + "$id": "123", + "kind": "property", + "name": "lastModifiedBy", + "serializedName": "lastModifiedBy", + "doc": "The identity that last modified the resource.", + "type": { + "$id": "124", + "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": "125", + "json": { + "$id": "126", + "name": "lastModifiedBy" + } + } + }, + { + "$id": "127", + "kind": "property", + "name": "lastModifiedByType", + "serializedName": "lastModifiedByType", + "doc": "The type of identity that last modified the resource.", + "type": { + "$ref": "26" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedByType", + "serializationOptions": { + "$id": "128", + "json": { + "$id": "129", + "name": "lastModifiedByType" + } + } + }, + { + "$id": "130", + "kind": "property", + "name": "lastModifiedAt", + "serializedName": "lastModifiedAt", + "doc": "The timestamp of resource last modification (UTC)", + "type": { + "$id": "131", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "132", + "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": "133", + "json": { + "$id": "134", + "name": "lastModifiedAt" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.systemData", + "serializationOptions": { + "$id": "135", + "json": { + "$id": "136", + "name": "systemData" + } + } + } + ] + }, + "properties": [] + }, + "properties": [ + { + "$id": "137", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "138", + "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": "139", + "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": "140", + "kind": "array", + "name": "ArrayContainerGroupInstanceCountSummary", + "valueType": { + "$id": "141", + "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": "142", + "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": "143", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupInstanceCountSummary.zone", + "serializationOptions": { + "$id": "144", + "json": { + "$id": "145", + "name": "zone" + } + } + }, + { + "$id": "146", + "kind": "property", + "name": "instanceCountsByStateUpdated", + "serializedName": "instanceCountsByState", + "doc": "The count of pooled container groups in each state for the given zone.", + "type": { + "$id": "147", + "kind": "array", + "name": "ArrayPoolContainerGroupStateCount", + "valueType": { + "$id": "148", + "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": "149", + "kind": "property", + "name": "state", + "serializedName": "state", + "doc": "The state that the pooled container groups count is for.", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolContainerGroupStateCount.state", + "serializationOptions": { + "$id": "150", + "json": { + "$id": "151", + "name": "state" + } + } + }, + { + "$id": "152", + "kind": "property", + "name": "count", + "serializedName": "count", + "doc": "The count of pooled container groups in the given state.", + "type": { + "$id": "153", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolContainerGroupStateCount.count", + "serializationOptions": { + "$id": "154", + "json": { + "$id": "155", + "name": "count" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupInstanceCountSummary.instanceCountsByState", + "serializationOptions": { + "$id": "156", + "json": { + "$id": "157", + "name": "instanceCountsByState" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties.instanceCountSummary", + "serializationOptions": { + "$id": "158", + "json": { + "$id": "159", + "name": "instanceCountSummary" + } + } + }, + { + "$id": "160", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "Display status of the standby pool", + "type": { + "$id": "161", + "kind": "model", + "name": "PoolStatus", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolStatus", + "usage": "Output,Json", + "doc": "Displays StandbyPool status.", + "decorators": [], + "properties": [ + { + "$id": "162", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "Displays the healthy state of the StandbyPool.", + "type": { + "$ref": "10" + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolStatus.code", + "serializationOptions": { + "$id": "163", + "json": { + "$id": "164", + "name": "code" + } + } + }, + { + "$id": "165", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "Displays the StandbyPool health state details.", + "type": { + "$id": "166", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolStatus.message", + "serializationOptions": { + "$id": "167", + "json": { + "$id": "168", + "name": "message" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties.status", + "serializationOptions": { + "$id": "169", + "json": { + "$id": "170", + "name": "status" + } + } + }, + { + "$id": "171", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Displays the provisioning state of the standby pool", + "type": { + "$ref": "16" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties.provisioningState", + "serializationOptions": { + "$id": "172", + "json": { + "$id": "173", + "name": "provisioningState" + } + } + }, + { + "$id": "174", + "kind": "property", + "name": "prediction", + "serializedName": "prediction", + "doc": "Displays prediction information of the standby pool", + "type": { + "$id": "175", + "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": "176", + "kind": "property", + "name": "forecastValues", + "serializedName": "forecastValues", + "doc": "Displays the forecast information of the standby pool.", + "type": { + "$id": "177", + "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": "178", + "kind": "property", + "name": "instancesRequestedCount", + "serializedName": "instancesRequestedCount", + "doc": "Displays the predicted count of instances to be requested from the standby pool.", + "type": { + "$id": "179", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "180", + "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": "181", + "json": { + "$id": "182", + "name": "instancesRequestedCount" + } + } + } + ] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolPrediction.forecastValues", + "serializationOptions": { + "$id": "183", + "json": { + "$id": "184", + "name": "forecastValues" + } + } + }, + { + "$id": "185", + "kind": "property", + "name": "forecastStartTime", + "serializedName": "forecastStartTime", + "doc": "Displays the UTC timestamp of when the prediction was retrieved for the standby pool.", + "type": { + "$id": "186", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "187", + "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": "188", + "json": { + "$id": "189", + "name": "forecastStartTime" + } + } + }, + { + "$id": "190", + "kind": "property", + "name": "forecastInfo", + "serializedName": "forecastInfo", + "doc": "Displays additional information for the prediction of the standby pool.", + "type": { + "$id": "191", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolPrediction.forecastInfo", + "serializationOptions": { + "$id": "192", + "json": { + "$id": "193", + "name": "forecastInfo" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResourceProperties.prediction", + "serializationOptions": { + "$id": "194", + "json": { + "$id": "195", + "name": "prediction" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViewResource.properties", + "serializationOptions": { + "$id": "196", + "json": { + "$id": "197", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "138" + }, + { + "$ref": "141" + }, + { + "$ref": "148" + }, + { + "$ref": "161" + }, + { + "$ref": "175" + }, + { + "$ref": "177" + }, + { + "$ref": "93" + }, + { + "$ref": "94" + }, + { + "$ref": "110" + }, + { + "$id": "198", + "kind": "model", + "name": "ErrorResponse", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "usage": "Error,Json,Exception", + "doc": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", + "decorators": [], + "properties": [ + { + "$id": "199", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error object.", + "type": { + "$id": "200", + "kind": "model", + "name": "ErrorDetail", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "usage": "Json,Exception,LroPolling", + "doc": "The error detail.", + "decorators": [], + "properties": [ + { + "$id": "201", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "202", + "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": "203", + "json": { + "$id": "204", + "name": "code" + } + } + }, + { + "$id": "205", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "206", + "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": "207", + "json": { + "$id": "208", + "name": "message" + } + } + }, + { + "$id": "209", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The error target.", + "type": { + "$id": "210", + "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": "211", + "json": { + "$id": "212", + "name": "target" + } + } + }, + { + "$id": "213", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The error details.", + "type": { + "$id": "214", + "kind": "array", + "name": "ArrayErrorDetail", + "valueType": { + "$ref": "200" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details", + "serializationOptions": { + "$id": "215", + "json": { + "$id": "216", + "name": "details" + } + } + }, + { + "$id": "217", + "kind": "property", + "name": "additionalInfo", + "serializedName": "additionalInfo", + "doc": "The error additional info.", + "type": { + "$id": "218", + "kind": "array", + "name": "ArrayErrorAdditionalInfo", + "valueType": { + "$id": "219", + "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": "220", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The additional info type.", + "type": { + "$id": "221", + "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": "222", + "json": { + "$id": "223", + "name": "type" + } + } + }, + { + "$id": "224", + "kind": "property", + "name": "info", + "serializedName": "info", + "doc": "The additional info.", + "type": { + "$id": "225", + "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": "226", + "json": { + "$id": "227", + "name": "info" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo", + "serializationOptions": { + "$id": "228", + "json": { + "$id": "229", + "name": "additionalInfo" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error", + "serializationOptions": { + "$id": "230", + "json": { + "$id": "231", + "name": "error" + } + } + } + ] + }, + { + "$ref": "200" + }, + { + "$ref": "219" + }, + { + "$ref": "225" + }, + { + "$id": "232", + "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": "233", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyContainerGroupPoolRuntimeViewResource items on this page", + "type": { + "$id": "234", + "kind": "array", + "name": "ArrayStandbyContainerGroupPoolRuntimeViewResource", + "valueType": { + "$ref": "92" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "235", + "json": { + "$id": "236", + "name": "value" + } + } + }, + { + "$id": "237", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "238", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "239", + "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": "240", + "json": { + "$id": "241", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "242", + "kind": "model", + "name": "StandbyContainerGroupPool", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "A StandbyContainerGroupPoolResource.", + "decorators": [], + "baseModel": { + "$id": "243", + "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": { + "$ref": "94" + }, + "properties": [ + { + "$id": "244", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "245", + "kind": "dict", + "keyType": { + "$id": "246", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "247", + "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": "248", + "json": { + "$id": "249", + "name": "tags" + } + } + }, + { + "$id": "250", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The geo-location where the resource lives", + "type": { + "$id": "251", + "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": "252", + "json": { + "$id": "253", + "name": "location" + } + } + } + ] + }, + "properties": [ + { + "$id": "254", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "255", + "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": "256", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies elasticity profile of standby container group pools.", + "type": { + "$id": "257", + "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": "258", + "kind": "property", + "name": "maxReadyCapacity", + "serializedName": "maxReadyCapacity", + "doc": "Specifies maximum number of standby container groups in the standby pool.", + "type": { + "$id": "259", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolElasticityProfile.maxReadyCapacity", + "serializationOptions": { + "$id": "260", + "json": { + "$id": "261", + "name": "maxReadyCapacity" + } + } + }, + { + "$id": "262", + "kind": "property", + "name": "refillPolicy", + "serializedName": "refillPolicy", + "doc": "Specifies refill policy of the pool.", + "type": { + "$ref": "36" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolElasticityProfile.refillPolicy", + "serializationOptions": { + "$id": "263", + "json": { + "$id": "264", + "name": "refillPolicy" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties.elasticityProfile", + "serializationOptions": { + "$id": "265", + "json": { + "$id": "266", + "name": "elasticityProfile" + } + } + }, + { + "$id": "267", + "kind": "property", + "name": "containerGroupProperties", + "serializedName": "containerGroupProperties", + "doc": "Specifies container group properties of standby container group pools.", + "type": { + "$id": "268", + "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": "269", + "kind": "property", + "name": "containerGroupProfile", + "serializedName": "containerGroupProfile", + "doc": "Specifies container group profile of standby container groups.", + "type": { + "$id": "270", + "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": "271", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Specifies container group profile id of standby container groups.", + "type": { + "$id": "272", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "273", + "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": "274", + "json": { + "$id": "275", + "name": "id" + } + } + }, + { + "$id": "276", + "kind": "property", + "name": "revision", + "serializedName": "revision", + "doc": "Specifies revision of container group profile.", + "type": { + "$id": "277", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProfile.revision", + "serializationOptions": { + "$id": "278", + "json": { + "$id": "279", + "name": "revision" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProperties.containerGroupProfile", + "serializationOptions": { + "$id": "280", + "json": { + "$id": "281", + "name": "containerGroupProfile" + } + } + }, + { + "$id": "282", + "kind": "property", + "name": "subnetIds", + "serializedName": "subnetIds", + "doc": "Specifies subnet Ids for container group.", + "type": { + "$id": "283", + "kind": "array", + "name": "ArraySubnet", + "valueType": { + "$id": "284", + "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": "285", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Specifies ARM resource id of the subnet.", + "type": { + "$id": "286", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "287", + "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": "288", + "json": { + "$id": "289", + "name": "id" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.ContainerGroupProperties.subnetIds", + "serializationOptions": { + "$id": "290", + "json": { + "$id": "291", + "name": "subnetIds" + } + } + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties.containerGroupProperties", + "serializationOptions": { + "$id": "292", + "json": { + "$id": "293", + "name": "containerGroupProperties" + } + } + }, + { + "$id": "294", + "kind": "property", + "name": "zones", + "serializedName": "zones", + "doc": "Specifies zones of standby container group pools.", + "type": { + "$id": "295", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "296", + "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": "297", + "json": { + "$id": "298", + "name": "zones" + } + } + }, + { + "$id": "299", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "16" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResourceProperties.provisioningState", + "serializationOptions": { + "$id": "300", + "json": { + "$id": "301", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolResource.properties", + "serializationOptions": { + "$id": "302", + "json": { + "$id": "303", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "255" + }, + { + "$ref": "257" + }, + { + "$ref": "268" + }, + { + "$ref": "270" + }, + { + "$ref": "284" + }, + { + "$ref": "243" + }, + { + "$id": "304", + "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": "305", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The operation status", + "type": { + "$ref": "40" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.status", + "serializationOptions": { + "$id": "306", + "json": { + "$id": "307", + "name": "status" + } + } + }, + { + "$id": "308", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operationStatus resource", + "type": { + "$id": "309", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.name", + "serializationOptions": { + "$id": "310", + "json": { + "$id": "311", + "name": "name" + } + } + }, + { + "$id": "312", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "Operation start time", + "type": { + "$id": "313", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "314", + "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": "315", + "json": { + "$id": "316", + "name": "startTime" + } + } + }, + { + "$id": "317", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "Operation complete time", + "type": { + "$id": "318", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "319", + "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": "320", + "json": { + "$id": "321", + "name": "endTime" + } + } + }, + { + "$id": "322", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "doc": "The progress made toward completing the operation", + "type": { + "$id": "323", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.percentComplete", + "serializationOptions": { + "$id": "324", + "json": { + "$id": "325", + "name": "percentComplete" + } + } + }, + { + "$id": "326", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Errors that occurred if the operation ended with Canceled or Failed status", + "type": { + "$ref": "200" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.error", + "serializationOptions": { + "$id": "327", + "json": { + "$id": "328", + "name": "error" + } + } + } + ] + }, + { + "$id": "329", + "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": "330", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "331", + "kind": "dict", + "keyType": { + "$id": "332", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "333", + "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": "334", + "json": { + "$id": "335", + "name": "tags" + } + } + }, + { + "$id": "336", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "337", + "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": "338", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies elasticity profile of standby container group pools.", + "type": { + "$ref": "257" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.elasticityProfile", + "serializationOptions": { + "$id": "339", + "json": { + "$id": "340", + "name": "elasticityProfile" + } + } + }, + { + "$id": "341", + "kind": "property", + "name": "containerGroupProperties", + "serializedName": "containerGroupProperties", + "doc": "Specifies container group properties of standby container group pools.", + "type": { + "$ref": "268" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.containerGroupProperties", + "serializationOptions": { + "$id": "342", + "json": { + "$id": "343", + "name": "containerGroupProperties" + } + } + }, + { + "$id": "344", + "kind": "property", + "name": "zones", + "serializedName": "zones", + "doc": "Specifies zones of standby container group pools.", + "type": { + "$id": "345", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "346", + "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": "347", + "json": { + "$id": "348", + "name": "zones" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.properties", + "serializationOptions": { + "$id": "349", + "json": { + "$id": "350", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "337" + }, + { + "$id": "351", + "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": "352", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyContainerGroupPoolResource items on this page", + "type": { + "$id": "353", + "kind": "array", + "name": "ArrayStandbyContainerGroupPoolResource", + "valueType": { + "$ref": "242" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "354", + "json": { + "$id": "355", + "name": "value" + } + } + }, + { + "$id": "356", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "357", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "358", + "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": "359", + "json": { + "$id": "360", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "361", + "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": "93" + }, + "properties": [ + { + "$id": "362", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "363", + "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": "364", + "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": "365", + "kind": "array", + "name": "ArrayVirtualMachineInstanceCountSummary", + "valueType": { + "$id": "366", + "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": "367", + "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": "368", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineInstanceCountSummary.zone", + "serializationOptions": { + "$id": "369", + "json": { + "$id": "370", + "name": "zone" + } + } + }, + { + "$id": "371", + "kind": "property", + "name": "instanceCountsByStateUpdated", + "serializedName": "instanceCountsByState", + "doc": "The count of pooled virtual machines in each state for the given zone.", + "type": { + "$id": "372", + "kind": "array", + "name": "ArrayPoolVirtualMachineStateCount", + "valueType": { + "$id": "373", + "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": "374", + "kind": "property", + "name": "state", + "serializedName": "state", + "doc": "The state that the pooled virtual machines count is for.", + "type": { + "$ref": "48" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolVirtualMachineStateCount.state", + "serializationOptions": { + "$id": "375", + "json": { + "$id": "376", + "name": "state" + } + } + }, + { + "$id": "377", + "kind": "property", + "name": "count", + "serializedName": "count", + "doc": "The count of pooled virtual machines in the given state.", + "type": { + "$id": "378", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.PoolVirtualMachineStateCount.count", + "serializationOptions": { + "$id": "379", + "json": { + "$id": "380", + "name": "count" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.VirtualMachineInstanceCountSummary.instanceCountsByState", + "serializationOptions": { + "$id": "381", + "json": { + "$id": "382", + "name": "instanceCountsByState" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties.instanceCountSummary", + "serializationOptions": { + "$id": "383", + "json": { + "$id": "384", + "name": "instanceCountSummary" + } + } + }, + { + "$id": "385", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "Display status of the standby pool", + "type": { + "$ref": "161" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties.status", + "serializationOptions": { + "$id": "386", + "json": { + "$id": "387", + "name": "status" + } + } + }, + { + "$id": "388", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Displays the provisioning state of the standby pool", + "type": { + "$ref": "16" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties.provisioningState", + "serializationOptions": { + "$id": "389", + "json": { + "$id": "390", + "name": "provisioningState" + } + } + }, + { + "$id": "391", + "kind": "property", + "name": "prediction", + "serializedName": "prediction", + "doc": "Displays prediction information of the standby pool", + "type": { + "$id": "392", + "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": "393", + "kind": "property", + "name": "forecastValues", + "serializedName": "forecastValues", + "doc": "Displays the forecast information of the standby pool.", + "type": { + "$id": "394", + "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": "395", + "kind": "property", + "name": "instancesRequestedCount", + "serializedName": "instancesRequestedCount", + "doc": "Displays the predicted count of instances to be requested from the standby pool.", + "type": { + "$id": "396", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "397", + "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": "398", + "json": { + "$id": "399", + "name": "instancesRequestedCount" + } + } + } + ] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolPrediction.forecastValues", + "serializationOptions": { + "$id": "400", + "json": { + "$id": "401", + "name": "forecastValues" + } + } + }, + { + "$id": "402", + "kind": "property", + "name": "forecastStartTime", + "serializedName": "forecastStartTime", + "doc": "Displays the UTC timestamp of when the prediction was retrieved for the standby pool.", + "type": { + "$id": "403", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "404", + "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": "405", + "json": { + "$id": "406", + "name": "forecastStartTime" + } + } + }, + { + "$id": "407", + "kind": "property", + "name": "forecastInfo", + "serializedName": "forecastInfo", + "doc": "Displays additional information for the prediction of the standby pool.", + "type": { + "$id": "408", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolPrediction.forecastInfo", + "serializationOptions": { + "$id": "409", + "json": { + "$id": "410", + "name": "forecastInfo" + } + } + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResourceProperties.prediction", + "serializationOptions": { + "$id": "411", + "json": { + "$id": "412", + "name": "prediction" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViewResource.properties", + "serializationOptions": { + "$id": "413", + "json": { + "$id": "414", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "363" + }, + { + "$ref": "366" + }, + { + "$ref": "373" + }, + { + "$ref": "392" + }, + { + "$ref": "394" + }, + { + "$id": "415", + "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": "416", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyVirtualMachinePoolRuntimeViewResource items on this page", + "type": { + "$id": "417", + "kind": "array", + "name": "ArrayStandbyVirtualMachinePoolRuntimeViewResource", + "valueType": { + "$ref": "361" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "418", + "json": { + "$id": "419", + "name": "value" + } + } + }, + { + "$id": "420", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "421", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "422", + "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": "423", + "json": { + "$id": "424", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "425", + "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": { + "$ref": "93" + }, + "properties": [ + { + "$id": "426", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "427", + "kind": "model", + "name": "StandbyVirtualMachineProperties", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResourceProperties", + "usage": "Output,Json", + "doc": "Details of the StandbyVirtualMachine.", + "decorators": [], + "properties": [ + { + "$id": "428", + "kind": "property", + "name": "virtualMachineResourceId", + "serializedName": "virtualMachineResourceId", + "doc": "Resource id of the virtual machine.", + "type": { + "$id": "429", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "430", + "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": "431", + "json": { + "$id": "432", + "name": "virtualMachineResourceId" + } + } + }, + { + "$id": "433", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "16" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResourceProperties.provisioningState", + "serializationOptions": { + "$id": "434", + "json": { + "$id": "435", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachineResource.properties", + "serializationOptions": { + "$id": "436", + "json": { + "$id": "437", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "427" + }, + { + "$id": "438", + "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": "439", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyVirtualMachineResource items on this page", + "type": { + "$id": "440", + "kind": "array", + "name": "ArrayStandbyVirtualMachineResource", + "valueType": { + "$ref": "425" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "441", + "json": { + "$id": "442", + "name": "value" + } + } + }, + { + "$id": "443", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "444", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "445", + "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": "446", + "json": { + "$id": "447", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "448", + "kind": "model", + "name": "StandbyVirtualMachinePool", + "namespace": "Azure.ResourceManager.StandbyPool", + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResource", + "usage": "Input,Output,Json,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "A StandbyVirtualMachinePoolResource.", + "decorators": [], + "baseModel": { + "$ref": "243" + }, + "properties": [ + { + "$id": "449", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "450", + "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": "451", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies the elasticity profile of the standby virtual machine pools.", + "type": { + "$id": "452", + "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": "453", + "kind": "property", + "name": "maxReadyCapacity", + "serializedName": "maxReadyCapacity", + "doc": "Specifies the maximum number of virtual machines in the standby virtual machine pool.", + "type": { + "$id": "454", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolElasticityProfile.maxReadyCapacity", + "serializationOptions": { + "$id": "455", + "json": { + "$id": "456", + "name": "maxReadyCapacity" + } + } + }, + { + "$id": "457", + "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": "458", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolElasticityProfile.minReadyCapacity", + "serializationOptions": { + "$id": "459", + "json": { + "$id": "460", + "name": "minReadyCapacity" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.elasticityProfile", + "serializationOptions": { + "$id": "461", + "json": { + "$id": "462", + "name": "elasticityProfile" + } + } + }, + { + "$id": "463", + "kind": "property", + "name": "virtualMachineState", + "serializedName": "virtualMachineState", + "doc": "Specifies the desired state of virtual machines in the pool.", + "type": { + "$ref": "66" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.virtualMachineState", + "serializationOptions": { + "$id": "464", + "json": { + "$id": "465", + "name": "virtualMachineState" + } + } + }, + { + "$id": "466", + "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": "467", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "468", + "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": "469", + "json": { + "$id": "470", + "name": "attachedVirtualMachineScaleSetId" + } + } + }, + { + "$id": "471", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The status of the last operation.", + "type": { + "$ref": "16" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResourceProperties.provisioningState", + "serializationOptions": { + "$id": "472", + "json": { + "$id": "473", + "name": "provisioningState" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolResource.properties", + "serializationOptions": { + "$id": "474", + "json": { + "$id": "475", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "450" + }, + { + "$ref": "452" + }, + { + "$id": "476", + "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": "477", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "478", + "kind": "dict", + "keyType": { + "$id": "479", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "480", + "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": "481", + "json": { + "$id": "482", + "name": "tags" + } + } + }, + { + "$id": "483", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "The resource-specific properties for this resource.", + "type": { + "$id": "484", + "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": "485", + "kind": "property", + "name": "elasticityProfile", + "serializedName": "elasticityProfile", + "doc": "Specifies the elasticity profile of the standby virtual machine pools.", + "type": { + "$ref": "452" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.elasticityProfile", + "serializationOptions": { + "$id": "486", + "json": { + "$id": "487", + "name": "elasticityProfile" + } + } + }, + { + "$id": "488", + "kind": "property", + "name": "virtualMachineState", + "serializedName": "virtualMachineState", + "doc": "Specifies the desired state of virtual machines in the pool.", + "type": { + "$ref": "66" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties.virtualMachineState", + "serializationOptions": { + "$id": "489", + "json": { + "$id": "490", + "name": "virtualMachineState" + } + } + }, + { + "$id": "491", + "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": "492", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "493", + "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": "494", + "json": { + "$id": "495", + "name": "attachedVirtualMachineScaleSetId" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Foundations.ResourceUpdateModel.properties", + "serializationOptions": { + "$id": "496", + "json": { + "$id": "497", + "name": "properties" + } + } + } + ] + }, + { + "$ref": "484" + }, + { + "$id": "498", + "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": "499", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The StandbyVirtualMachinePoolResource items on this page", + "type": { + "$id": "500", + "kind": "array", + "name": "ArrayStandbyVirtualMachinePoolResource", + "valueType": { + "$ref": "448" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "$id": "501", + "json": { + "$id": "502", + "name": "value" + } + } + }, + { + "$id": "503", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "504", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "505", + "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": "506", + "json": { + "$id": "507", + "name": "nextLink" + } + } + } + ] + }, + { + "$id": "508", + "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": "509", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Operation items on this page", + "type": { + "$id": "510", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$id": "511", + "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": "512", + "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": "513", + "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": "514", + "json": { + "$id": "515", + "name": "name" + } + } + }, + { + "$id": "516", + "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": "517", + "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": "518", + "json": { + "$id": "519", + "name": "isDataAction" + } + } + }, + { + "$id": "520", + "kind": "property", + "name": "display", + "serializedName": "display", + "doc": "Localized display information for this particular operation.", + "type": { + "$id": "521", + "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": "522", + "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": "523", + "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": "524", + "json": { + "$id": "525", + "name": "provider" + } + } + }, + { + "$id": "526", + "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": "527", + "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": "528", + "json": { + "$id": "529", + "name": "resource" + } + } + }, + { + "$id": "530", + "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": "531", + "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": "532", + "json": { + "$id": "533", + "name": "operation" + } + } + }, + { + "$id": "534", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + "type": { + "$id": "535", + "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": "536", + "json": { + "$id": "537", + "name": "description" + } + } + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display", + "serializationOptions": { + "$id": "538", + "json": { + "$id": "539", + "name": "display" + } + } + }, + { + "$id": "540", + "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": "74" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin", + "serializationOptions": { + "$id": "541", + "json": { + "$id": "542", + "name": "origin" + } + } + }, + { + "$id": "543", + "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": "82" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType", + "serializationOptions": { + "$id": "544", + "json": { + "$id": "545", + "name": "actionType" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.value", + "serializationOptions": { + "$id": "546", + "json": { + "$id": "547", + "name": "value" + } + } + }, + { + "$id": "548", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "549", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "550", + "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": "551", + "json": { + "$id": "552", + "name": "nextLink" + } + } + } + ] + }, + { + "$ref": "511" + }, + { + "$ref": "521" + } + ], + "clients": [ + { + "$id": "553", + "name": "StandbyPoolClient", + "namespace": "Azure.ResourceManager.StandbyPool", + "operations": [], + "parameters": [ + { + "$id": "554", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "555", + "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": "556", + "type": { + "$id": "557", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool" + }, + { + "$id": "558", + "name": "Operations", + "namespace": "Azure.ResourceManager.StandbyPool", + "operations": [ + { + "$id": "559", + "name": "list", + "resourceName": "Operations", + "doc": "List the operations for the provider", + "accessibility": "internal", + "parameters": [ + { + "$id": "560", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "561", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "562", + "type": { + "$id": "563", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "564", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "565", + "kind": "constant", + "valueType": { + "$id": "566", + "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": "567", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "508" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/providers/Microsoft.StandbyPool/operations", + "bufferResponse": true, + "paging": { + "$id": "568", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "569", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "decorators": [], + "examples": [ + { + "$id": "570", + "kind": "http", + "name": "Operations_List", + "description": "Operations_List", + "filePath": "2025-03-01/Operations_List.json", + "parameters": [ + { + "$id": "571", + "parameter": { + "$ref": "560" + }, + "value": { + "$id": "572", + "kind": "string", + "type": { + "$ref": "561" + }, + "value": "2025-03-01" + } + } + ], + "responses": [ + { + "$id": "573", + "response": { + "$ref": "567" + }, + "statusCode": 200, + "bodyValue": { + "$id": "574", + "kind": "model", + "type": { + "$ref": "508" + }, + "value": { + "$id": "575", + "value": { + "$id": "576", + "kind": "array", + "type": { + "$ref": "510" + }, + "value": [ + { + "$id": "577", + "kind": "model", + "type": { + "$ref": "511" + }, + "value": { + "$id": "578", + "name": { + "$id": "579", + "kind": "string", + "type": { + "$ref": "513" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools/write" + }, + "isDataAction": { + "$id": "580", + "kind": "boolean", + "type": { + "$ref": "517" + }, + "value": true + }, + "display": { + "$id": "581", + "kind": "model", + "type": { + "$ref": "521" + }, + "value": { + "$id": "582", + "provider": { + "$id": "583", + "kind": "string", + "type": { + "$ref": "523" + }, + "value": "Microsoft.StandbyPool" + }, + "resource": { + "$id": "584", + "kind": "string", + "type": { + "$ref": "527" + }, + "value": "standbyContainerGroupPools" + }, + "operation": { + "$id": "585", + "kind": "string", + "type": { + "$ref": "531" + }, + "value": "StandbyContainerGroupPools_Create" + }, + "description": { + "$id": "586", + "kind": "string", + "type": { + "$ref": "535" + }, + "value": "Create a StandbyContainerGroupPools Resource" + } + } + }, + "origin": { + "$id": "587", + "kind": "string", + "type": { + "$ref": "74" + }, + "value": "user" + }, + "actionType": { + "$id": "588", + "kind": "string", + "type": { + "$ref": "82" + }, + "value": "Internal" + } + } + } + ] + }, + "nextLink": { + "$id": "589", + "kind": "string", + "type": { + "$ref": "549" + }, + "value": "https://example.com/providers/Microsoft.StandbyPool/operations" + } + } + } + } + ] + } + ] + } + ], + "parent": "StandbyPoolClient", + "parameters": [ + { + "$id": "590", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "591", + "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": "592", + "type": { + "$id": "593", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.Operations" + }, + { + "$id": "594", + "name": "StandbyVirtualMachinePools", + "namespace": "Azure.ResourceManager.StandbyPool", + "operations": [ + { + "$id": "595", + "name": "get", + "resourceName": "StandbyVirtualMachinePoolResource", + "doc": "Get a StandbyVirtualMachinePoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "596", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "597", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "598", + "type": { + "$id": "599", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "600", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "601", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "602", + "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": "603", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "604", + "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": "605", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "606", + "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": "607", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "608", + "kind": "constant", + "valueType": { + "$id": "609", + "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": "610", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "448" + }, + "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": "611", + "kind": "http", + "name": "StandbyVirtualMachinePools_Get", + "description": "StandbyVirtualMachinePools_Get", + "filePath": "2025-03-01/StandbyVirtualMachinePools_Get.json", + "parameters": [ + { + "$id": "612", + "parameter": { + "$ref": "596" + }, + "value": { + "$id": "613", + "kind": "string", + "type": { + "$ref": "597" + }, + "value": "2025-03-01" + } + }, + { + "$id": "614", + "parameter": { + "$ref": "600" + }, + "value": { + "$id": "615", + "kind": "string", + "type": { + "$ref": "601" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "616", + "parameter": { + "$ref": "603" + }, + "value": { + "$id": "617", + "kind": "string", + "type": { + "$ref": "604" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "618", + "parameter": { + "$ref": "605" + }, + "value": { + "$id": "619", + "kind": "string", + "type": { + "$ref": "606" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "620", + "response": { + "$ref": "610" + }, + "statusCode": 200, + "bodyValue": { + "$id": "621", + "kind": "model", + "type": { + "$ref": "448" + }, + "value": { + "$id": "622", + "properties": { + "$id": "623", + "kind": "model", + "type": { + "$ref": "450" + }, + "value": { + "$id": "624", + "elasticityProfile": { + "$id": "625", + "kind": "model", + "type": { + "$ref": "452" + }, + "value": { + "$id": "626", + "maxReadyCapacity": { + "$id": "627", + "kind": "number", + "type": { + "$ref": "454" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "628", + "kind": "number", + "type": { + "$ref": "458" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "629", + "kind": "string", + "type": { + "$ref": "66" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "630", + "kind": "string", + "type": { + "$ref": "467" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "631", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "632", + "kind": "dict", + "type": { + "$ref": "245" + }, + "value": { + "$id": "633" + } + }, + "location": { + "$id": "634", + "kind": "string", + "type": { + "$ref": "251" + }, + "value": "West US" + }, + "id": { + "$id": "635", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "636", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "637", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "638", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "639", + "createdBy": { + "$id": "640", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "641", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "642", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "643", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "644", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "645", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "646", + "name": "createOrUpdate", + "resourceName": "StandbyVirtualMachinePoolResource", + "doc": "Create a StandbyVirtualMachinePoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "647", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "648", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "649", + "type": { + "$id": "650", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "651", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "652", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "653", + "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": "654", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "655", + "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": "656", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "657", + "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": "658", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "659", + "kind": "constant", + "valueType": { + "$id": "660", + "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": "661", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "662", + "kind": "constant", + "valueType": { + "$id": "663", + "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": "664", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "448" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "665", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "448" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "666", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "448" + }, + "headers": [ + { + "$id": "667", + "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": "668", + "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, + "longRunning": { + "$id": "669", + "finalStateVia": 0, + "finalResponse": { + "$id": "670", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "448" + } + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.createOrUpdate", + "decorators": [ + { + "$id": "671", + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "$id": "672", + "finalState": "azure-async-operation" + } + } + ], + "examples": [ + { + "$id": "673", + "kind": "http", + "name": "StandbyVirtualMachinePools_CreateOrUpdate", + "description": "StandbyVirtualMachinePools_CreateOrUpdate", + "filePath": "2025-03-01/StandbyVirtualMachinePools_CreateOrUpdate.json", + "parameters": [ + { + "$id": "674", + "parameter": { + "$ref": "647" + }, + "value": { + "$id": "675", + "kind": "string", + "type": { + "$ref": "648" + }, + "value": "2025-03-01" + } + }, + { + "$id": "676", + "parameter": { + "$ref": "651" + }, + "value": { + "$id": "677", + "kind": "string", + "type": { + "$ref": "652" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "678", + "parameter": { + "$ref": "654" + }, + "value": { + "$id": "679", + "kind": "string", + "type": { + "$ref": "655" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "680", + "parameter": { + "$ref": "656" + }, + "value": { + "$id": "681", + "kind": "string", + "type": { + "$ref": "657" + }, + "value": "pool" + } + }, + { + "$id": "682", + "parameter": { + "$ref": "664" + }, + "value": { + "$id": "683", + "kind": "model", + "type": { + "$ref": "448" + }, + "value": { + "$id": "684", + "properties": { + "$id": "685", + "kind": "model", + "type": { + "$ref": "450" + }, + "value": { + "$id": "686", + "elasticityProfile": { + "$id": "687", + "kind": "model", + "type": { + "$ref": "452" + }, + "value": { + "$id": "688", + "maxReadyCapacity": { + "$id": "689", + "kind": "number", + "type": { + "$ref": "454" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "690", + "kind": "number", + "type": { + "$ref": "458" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "691", + "kind": "string", + "type": { + "$ref": "66" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "692", + "kind": "string", + "type": { + "$ref": "467" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + } + } + }, + "tags": { + "$id": "693", + "kind": "dict", + "type": { + "$ref": "245" + }, + "value": { + "$id": "694" + } + }, + "location": { + "$id": "695", + "kind": "string", + "type": { + "$ref": "251" + }, + "value": "West US" + } + } + } + } + ], + "responses": [ + { + "$id": "696", + "response": { + "$ref": "665" + }, + "statusCode": 200, + "bodyValue": { + "$id": "697", + "kind": "model", + "type": { + "$ref": "448" + }, + "value": { + "$id": "698", + "properties": { + "$id": "699", + "kind": "model", + "type": { + "$ref": "450" + }, + "value": { + "$id": "700", + "elasticityProfile": { + "$id": "701", + "kind": "model", + "type": { + "$ref": "452" + }, + "value": { + "$id": "702", + "maxReadyCapacity": { + "$id": "703", + "kind": "number", + "type": { + "$ref": "454" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "704", + "kind": "number", + "type": { + "$ref": "458" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "705", + "kind": "string", + "type": { + "$ref": "66" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "706", + "kind": "string", + "type": { + "$ref": "467" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "707", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "708", + "kind": "dict", + "type": { + "$ref": "245" + }, + "value": { + "$id": "709" + } + }, + "location": { + "$id": "710", + "kind": "string", + "type": { + "$ref": "251" + }, + "value": "West US" + }, + "id": { + "$id": "711", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "712", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "713", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "714", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "715", + "createdBy": { + "$id": "716", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "717", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "718", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "719", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "720", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "721", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + }, + { + "$id": "722", + "response": { + "$ref": "666" + }, + "statusCode": 201, + "bodyValue": { + "$id": "723", + "kind": "model", + "type": { + "$ref": "448" + }, + "value": { + "$id": "724", + "properties": { + "$id": "725", + "kind": "model", + "type": { + "$ref": "450" + }, + "value": { + "$id": "726", + "elasticityProfile": { + "$id": "727", + "kind": "model", + "type": { + "$ref": "452" + }, + "value": { + "$id": "728", + "maxReadyCapacity": { + "$id": "729", + "kind": "number", + "type": { + "$ref": "454" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "730", + "kind": "number", + "type": { + "$ref": "458" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "731", + "kind": "string", + "type": { + "$ref": "66" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "732", + "kind": "string", + "type": { + "$ref": "467" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "733", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "734", + "kind": "dict", + "type": { + "$ref": "245" + }, + "value": { + "$id": "735" + } + }, + "location": { + "$id": "736", + "kind": "string", + "type": { + "$ref": "251" + }, + "value": "West US" + }, + "id": { + "$id": "737", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "738", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "739", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "740", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "741", + "createdBy": { + "$id": "742", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "743", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "744", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "745", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "746", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "747", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "748", + "name": "delete", + "resourceName": "StandbyVirtualMachinePoolResource", + "doc": "Delete a StandbyVirtualMachinePoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "749", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "750", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "751", + "type": { + "$id": "752", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "753", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "754", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "755", + "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": "756", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "757", + "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": "758", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "759", + "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": "760", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "761", + "kind": "constant", + "valueType": { + "$id": "762", + "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": "763", + "statusCodes": [ + 202 + ], + "headers": [ + { + "$id": "764", + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "765", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "766", + "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": "767", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "$id": "768", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}", + "bufferResponse": true, + "longRunning": { + "$id": "769", + "finalStateVia": 1, + "finalResponse": { + "$id": "770", + "statusCodes": [ + 204 + ] + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.delete", + "decorators": [], + "examples": [ + { + "$id": "771", + "kind": "http", + "name": "StandbyVirtualMachinePools_Delete", + "description": "StandbyVirtualMachinePools_Delete", + "filePath": "2025-03-01/StandbyVirtualMachinePools_Delete.json", + "parameters": [ + { + "$id": "772", + "parameter": { + "$ref": "749" + }, + "value": { + "$id": "773", + "kind": "string", + "type": { + "$ref": "750" + }, + "value": "2025-03-01" + } + }, + { + "$id": "774", + "parameter": { + "$ref": "753" + }, + "value": { + "$id": "775", + "kind": "string", + "type": { + "$ref": "754" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "776", + "parameter": { + "$ref": "756" + }, + "value": { + "$id": "777", + "kind": "string", + "type": { + "$ref": "757" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "778", + "parameter": { + "$ref": "758" + }, + "value": { + "$id": "779", + "kind": "string", + "type": { + "$ref": "759" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "780", + "response": { + "$ref": "763" + }, + "statusCode": 202 + }, + { + "$id": "781", + "response": { + "$ref": "768" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "782", + "name": "update", + "resourceName": "StandbyVirtualMachinePoolResource", + "doc": "Update a StandbyVirtualMachinePoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "783", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "784", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "785", + "type": { + "$id": "786", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "787", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "788", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "789", + "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": "790", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "791", + "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": "792", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "793", + "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": "794", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "795", + "kind": "constant", + "valueType": { + "$id": "796", + "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": "797", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "798", + "kind": "constant", + "valueType": { + "$id": "799", + "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": "800", + "name": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "476" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "801", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "448" + }, + "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": "802", + "kind": "http", + "name": "StandbyVirtualMachinePools_Update", + "description": "StandbyVirtualMachinePools_Update", + "filePath": "2025-03-01/StandbyVirtualMachinePools_Update.json", + "parameters": [ + { + "$id": "803", + "parameter": { + "$ref": "783" + }, + "value": { + "$id": "804", + "kind": "string", + "type": { + "$ref": "784" + }, + "value": "2025-03-01" + } + }, + { + "$id": "805", + "parameter": { + "$ref": "787" + }, + "value": { + "$id": "806", + "kind": "string", + "type": { + "$ref": "788" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "807", + "parameter": { + "$ref": "790" + }, + "value": { + "$id": "808", + "kind": "string", + "type": { + "$ref": "791" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "809", + "parameter": { + "$ref": "792" + }, + "value": { + "$id": "810", + "kind": "string", + "type": { + "$ref": "793" + }, + "value": "pool" + } + }, + { + "$id": "811", + "parameter": { + "$ref": "800" + }, + "value": { + "$id": "812", + "kind": "model", + "type": { + "$ref": "476" + }, + "value": { + "$id": "813", + "tags": { + "$id": "814", + "kind": "dict", + "type": { + "$ref": "478" + }, + "value": { + "$id": "815" + } + }, + "properties": { + "$id": "816", + "kind": "model", + "type": { + "$ref": "484" + }, + "value": { + "$id": "817", + "elasticityProfile": { + "$id": "818", + "kind": "model", + "type": { + "$ref": "452" + }, + "value": { + "$id": "819", + "maxReadyCapacity": { + "$id": "820", + "kind": "number", + "type": { + "$ref": "454" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "821", + "kind": "number", + "type": { + "$ref": "458" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "822", + "kind": "string", + "type": { + "$ref": "66" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "823", + "kind": "string", + "type": { + "$ref": "492" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "824", + "response": { + "$ref": "801" + }, + "statusCode": 200, + "bodyValue": { + "$id": "825", + "kind": "model", + "type": { + "$ref": "448" + }, + "value": { + "$id": "826", + "properties": { + "$id": "827", + "kind": "model", + "type": { + "$ref": "450" + }, + "value": { + "$id": "828", + "elasticityProfile": { + "$id": "829", + "kind": "model", + "type": { + "$ref": "452" + }, + "value": { + "$id": "830", + "maxReadyCapacity": { + "$id": "831", + "kind": "number", + "type": { + "$ref": "454" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "832", + "kind": "number", + "type": { + "$ref": "458" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "833", + "kind": "string", + "type": { + "$ref": "66" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "834", + "kind": "string", + "type": { + "$ref": "467" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "835", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "836", + "kind": "dict", + "type": { + "$ref": "245" + }, + "value": { + "$id": "837" + } + }, + "location": { + "$id": "838", + "kind": "string", + "type": { + "$ref": "251" + }, + "value": "West US" + }, + "id": { + "$id": "839", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "840", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "841", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "842", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "843", + "createdBy": { + "$id": "844", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "845", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "846", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "847", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "848", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "849", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "850", + "name": "listByResourceGroup", + "resourceName": "StandbyVirtualMachinePoolResource", + "doc": "List StandbyVirtualMachinePoolResource resources by resource group", + "accessibility": "public", + "parameters": [ + { + "$id": "851", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "852", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "853", + "type": { + "$id": "854", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "855", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "856", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "857", + "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": "858", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "859", + "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": "860", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "861", + "kind": "constant", + "valueType": { + "$id": "862", + "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": "863", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "498" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools", + "bufferResponse": true, + "paging": { + "$id": "864", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "865", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listByResourceGroup", + "decorators": [], + "examples": [ + { + "$id": "866", + "kind": "http", + "name": "StandbyVirtualMachinePools_ListByResourceGroup", + "description": "StandbyVirtualMachinePools_ListByResourceGroup", + "filePath": "2025-03-01/StandbyVirtualMachinePools_ListByResourceGroup.json", + "parameters": [ + { + "$id": "867", + "parameter": { + "$ref": "851" + }, + "value": { + "$id": "868", + "kind": "string", + "type": { + "$ref": "852" + }, + "value": "2025-03-01" + } + }, + { + "$id": "869", + "parameter": { + "$ref": "855" + }, + "value": { + "$id": "870", + "kind": "string", + "type": { + "$ref": "856" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "871", + "parameter": { + "$ref": "858" + }, + "value": { + "$id": "872", + "kind": "string", + "type": { + "$ref": "859" + }, + "value": "rgstandbypool" + } + } + ], + "responses": [ + { + "$id": "873", + "response": { + "$ref": "863" + }, + "statusCode": 200, + "bodyValue": { + "$id": "874", + "kind": "model", + "type": { + "$ref": "498" + }, + "value": { + "$id": "875", + "value": { + "$id": "876", + "kind": "array", + "type": { + "$ref": "500" + }, + "value": [ + { + "$id": "877", + "kind": "model", + "type": { + "$ref": "448" + }, + "value": { + "$id": "878", + "properties": { + "$id": "879", + "kind": "model", + "type": { + "$ref": "450" + }, + "value": { + "$id": "880", + "elasticityProfile": { + "$id": "881", + "kind": "model", + "type": { + "$ref": "452" + }, + "value": { + "$id": "882", + "maxReadyCapacity": { + "$id": "883", + "kind": "number", + "type": { + "$ref": "454" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "884", + "kind": "number", + "type": { + "$ref": "458" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "885", + "kind": "string", + "type": { + "$ref": "66" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "886", + "kind": "string", + "type": { + "$ref": "467" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "887", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "888", + "kind": "dict", + "type": { + "$ref": "245" + }, + "value": { + "$id": "889" + } + }, + "location": { + "$id": "890", + "kind": "string", + "type": { + "$ref": "251" + }, + "value": "West US" + }, + "id": { + "$id": "891", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "892", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "893", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "894", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "895", + "createdBy": { + "$id": "896", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "897", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "898", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "899", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "900", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "901", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "902", + "kind": "string", + "type": { + "$ref": "504" + }, + "value": "https://example.com/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools" + } + } + } + } + ] + } + ] + }, + { + "$id": "903", + "name": "listBySubscription", + "resourceName": "StandbyVirtualMachinePoolResource", + "doc": "List StandbyVirtualMachinePoolResource resources by subscription ID", + "accessibility": "public", + "parameters": [ + { + "$id": "904", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "905", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "906", + "type": { + "$id": "907", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "908", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "909", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "910", + "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": "911", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "912", + "kind": "constant", + "valueType": { + "$id": "913", + "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": "914", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "498" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools", + "bufferResponse": true, + "paging": { + "$id": "915", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "916", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools.listBySubscription", + "decorators": [], + "examples": [ + { + "$id": "917", + "kind": "http", + "name": "StandbyVirtualMachinePools_ListBySubscription", + "description": "StandbyVirtualMachinePools_ListBySubscription", + "filePath": "2025-03-01/StandbyVirtualMachinePools_ListBySubscription.json", + "parameters": [ + { + "$id": "918", + "parameter": { + "$ref": "904" + }, + "value": { + "$id": "919", + "kind": "string", + "type": { + "$ref": "905" + }, + "value": "2025-03-01" + } + }, + { + "$id": "920", + "parameter": { + "$ref": "908" + }, + "value": { + "$id": "921", + "kind": "string", + "type": { + "$ref": "909" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + } + ], + "responses": [ + { + "$id": "922", + "response": { + "$ref": "914" + }, + "statusCode": 200, + "bodyValue": { + "$id": "923", + "kind": "model", + "type": { + "$ref": "498" + }, + "value": { + "$id": "924", + "value": { + "$id": "925", + "kind": "array", + "type": { + "$ref": "500" + }, + "value": [ + { + "$id": "926", + "kind": "model", + "type": { + "$ref": "448" + }, + "value": { + "$id": "927", + "properties": { + "$id": "928", + "kind": "model", + "type": { + "$ref": "450" + }, + "value": { + "$id": "929", + "elasticityProfile": { + "$id": "930", + "kind": "model", + "type": { + "$ref": "452" + }, + "value": { + "$id": "931", + "maxReadyCapacity": { + "$id": "932", + "kind": "number", + "type": { + "$ref": "454" + }, + "value": 304 + }, + "minReadyCapacity": { + "$id": "933", + "kind": "number", + "type": { + "$ref": "458" + }, + "value": 300 + } + } + }, + "virtualMachineState": { + "$id": "934", + "kind": "string", + "type": { + "$ref": "66" + }, + "value": "Running" + }, + "attachedVirtualMachineScaleSetId": { + "$id": "935", + "kind": "string", + "type": { + "$ref": "467" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + }, + "provisioningState": { + "$id": "936", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + } + } + }, + "tags": { + "$id": "937", + "kind": "dict", + "type": { + "$ref": "245" + }, + "value": { + "$id": "938" + } + }, + "location": { + "$id": "939", + "kind": "string", + "type": { + "$ref": "251" + }, + "value": "West US" + }, + "id": { + "$id": "940", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool" + }, + "name": { + "$id": "941", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "942", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools" + }, + "systemData": { + "$id": "943", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "944", + "createdBy": { + "$id": "945", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "946", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "947", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "948", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "949", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "950", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "951", + "kind": "string", + "type": { + "$ref": "504" + }, + "value": "https://example.com/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools" + } + } + } + } + ] + } + ] + } + ], + "parent": "StandbyPoolClient", + "parameters": [ + { + "$id": "952", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "953", + "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": "954", + "type": { + "$id": "955", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePools" + }, + { + "$id": "956", + "name": "StandbyVirtualMachines", + "namespace": "Azure.ResourceManager.StandbyPool", + "operations": [ + { + "$id": "957", + "name": "get", + "resourceName": "StandbyVirtualMachineResource", + "doc": "Get a StandbyVirtualMachineResource", + "accessibility": "public", + "parameters": [ + { + "$id": "958", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "959", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "960", + "type": { + "$id": "961", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "962", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "963", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "964", + "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": "965", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "966", + "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": "967", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "968", + "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": "969", + "name": "standbyVirtualMachineName", + "nameInRequest": "standbyVirtualMachineName", + "doc": "Name of the standby virtual machine", + "type": { + "$id": "970", + "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": "971", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "972", + "kind": "constant", + "valueType": { + "$id": "973", + "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": "974", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "425" + }, + "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": "975", + "kind": "http", + "name": "StandbyVirtualMachines_Get", + "description": "StandbyVirtualMachines_Get", + "filePath": "2025-03-01/StandbyVirtualMachines_Get.json", + "parameters": [ + { + "$id": "976", + "parameter": { + "$ref": "958" + }, + "value": { + "$id": "977", + "kind": "string", + "type": { + "$ref": "959" + }, + "value": "2025-03-01" + } + }, + { + "$id": "978", + "parameter": { + "$ref": "962" + }, + "value": { + "$id": "979", + "kind": "string", + "type": { + "$ref": "963" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "980", + "parameter": { + "$ref": "965" + }, + "value": { + "$id": "981", + "kind": "string", + "type": { + "$ref": "966" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "982", + "parameter": { + "$ref": "967" + }, + "value": { + "$id": "983", + "kind": "string", + "type": { + "$ref": "968" + }, + "value": "pool" + } + }, + { + "$id": "984", + "parameter": { + "$ref": "969" + }, + "value": { + "$id": "985", + "kind": "string", + "type": { + "$ref": "970" + }, + "value": "virtualMachine" + } + } + ], + "responses": [ + { + "$id": "986", + "response": { + "$ref": "974" + }, + "statusCode": 200, + "bodyValue": { + "$id": "987", + "kind": "model", + "type": { + "$ref": "425" + }, + "value": { + "$id": "988", + "properties": { + "$id": "989", + "kind": "model", + "type": { + "$ref": "427" + }, + "value": { + "$id": "990", + "virtualMachineResourceId": { + "$id": "991", + "kind": "string", + "type": { + "$ref": "429" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachines/virtualMachine" + }, + "provisioningState": { + "$id": "992", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "993", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/standbyVirtualMachines/virtualMachine" + }, + "name": { + "$id": "994", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "995", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/virtualMachines" + }, + "systemData": { + "$id": "996", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "997", + "createdBy": { + "$id": "998", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "999", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "1000", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1001", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1002", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1003", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1004", + "name": "listByStandbyVirtualMachinePoolResource", + "resourceName": "StandbyVirtualMachineResource", + "doc": "List StandbyVirtualMachineResource resources by StandbyVirtualMachinePoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1005", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1006", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1007", + "type": { + "$id": "1008", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1009", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1010", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1011", + "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": "1012", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1013", + "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": "1014", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "1015", + "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": "1016", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1017", + "kind": "constant", + "valueType": { + "$id": "1018", + "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": "1019", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "438" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/standbyVirtualMachines", + "bufferResponse": true, + "paging": { + "$id": "1020", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1021", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachines.listByStandbyVirtualMachinePoolResource", + "decorators": [], + "examples": [ + { + "$id": "1022", + "kind": "http", + "name": "StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource", + "description": "StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource", + "filePath": "2025-03-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.json", + "parameters": [ + { + "$id": "1023", + "parameter": { + "$ref": "1005" + }, + "value": { + "$id": "1024", + "kind": "string", + "type": { + "$ref": "1006" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1025", + "parameter": { + "$ref": "1009" + }, + "value": { + "$id": "1026", + "kind": "string", + "type": { + "$ref": "1010" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1027", + "parameter": { + "$ref": "1012" + }, + "value": { + "$id": "1028", + "kind": "string", + "type": { + "$ref": "1013" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1029", + "parameter": { + "$ref": "1014" + }, + "value": { + "$id": "1030", + "kind": "string", + "type": { + "$ref": "1015" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1031", + "response": { + "$ref": "1019" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1032", + "kind": "model", + "type": { + "$ref": "438" + }, + "value": { + "$id": "1033", + "value": { + "$id": "1034", + "kind": "array", + "type": { + "$ref": "440" + }, + "value": [ + { + "$id": "1035", + "kind": "model", + "type": { + "$ref": "425" + }, + "value": { + "$id": "1036", + "properties": { + "$id": "1037", + "kind": "model", + "type": { + "$ref": "427" + }, + "value": { + "$id": "1038", + "virtualMachineResourceId": { + "$id": "1039", + "kind": "string", + "type": { + "$ref": "429" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachines/virtualMachine" + }, + "provisioningState": { + "$id": "1040", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + } + } + }, + "id": { + "$id": "1041", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/standbyVirtualMachines/virtualMachine" + }, + "name": { + "$id": "1042", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "1043", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/virtualMachines" + }, + "systemData": { + "$id": "1044", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "1045", + "createdBy": { + "$id": "1046", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1047", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "1048", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1049", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1050", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1051", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1052", + "kind": "string", + "type": { + "$ref": "444" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "parent": "StandbyPoolClient", + "parameters": [ + { + "$id": "1053", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "1054", + "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": "1055", + "type": { + "$id": "1056", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachines" + }, + { + "$id": "1057", + "name": "StandbyVirtualMachinePoolRuntimeViews", + "namespace": "Azure.ResourceManager.StandbyPool", + "operations": [ + { + "$id": "1058", + "name": "get", + "resourceName": "StandbyVirtualMachinePoolRuntimeViewResource", + "doc": "Get a StandbyVirtualMachinePoolRuntimeViewResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1059", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1060", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1061", + "type": { + "$id": "1062", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1063", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1064", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1065", + "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": "1066", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1067", + "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": "1068", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "1069", + "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": "1070", + "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": "1071", + "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": "1072", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1073", + "kind": "constant", + "valueType": { + "$id": "1074", + "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": "1075", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "361" + }, + "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": "1076", + "kind": "http", + "name": "StandbyVirtualMachinePoolRuntimeViews_Get", + "description": "StandbyVirtualMachinePoolRuntimeViews_Get", + "filePath": "2025-03-01/StandbyVirtualMachinePoolRuntimeViews_Get.json", + "parameters": [ + { + "$id": "1077", + "parameter": { + "$ref": "1059" + }, + "value": { + "$id": "1078", + "kind": "string", + "type": { + "$ref": "1060" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1079", + "parameter": { + "$ref": "1063" + }, + "value": { + "$id": "1080", + "kind": "string", + "type": { + "$ref": "1064" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1081", + "parameter": { + "$ref": "1066" + }, + "value": { + "$id": "1082", + "kind": "string", + "type": { + "$ref": "1067" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1083", + "parameter": { + "$ref": "1068" + }, + "value": { + "$id": "1084", + "kind": "string", + "type": { + "$ref": "1069" + }, + "value": "pool" + } + }, + { + "$id": "1085", + "parameter": { + "$ref": "1070" + }, + "value": { + "$id": "1086", + "kind": "string", + "type": { + "$ref": "1071" + }, + "value": "latest" + } + } + ], + "responses": [ + { + "$id": "1087", + "response": { + "$ref": "1075" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1088", + "kind": "model", + "type": { + "$ref": "361" + }, + "value": { + "$id": "1089", + "properties": { + "$id": "1090", + "kind": "model", + "type": { + "$ref": "363" + }, + "value": { + "$id": "1091", + "instanceCountSummary": { + "$id": "1092", + "kind": "array", + "type": { + "$ref": "365" + }, + "value": [ + { + "$id": "1093", + "kind": "model", + "type": { + "$ref": "366" + }, + "value": { + "$id": "1094", + "zone": { + "$id": "1095", + "kind": "number", + "type": { + "$ref": "368" + }, + "value": 1 + }, + "instanceCountsByState": { + "$id": "1096", + "kind": "array", + "type": { + "$ref": "372" + }, + "value": [ + { + "$id": "1097", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1098", + "state": { + "$id": "1099", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Creating" + }, + "count": { + "$id": "1100", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 100 + } + } + }, + { + "$id": "1101", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1102", + "state": { + "$id": "1103", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Running" + }, + "count": { + "$id": "1104", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 20 + } + } + }, + { + "$id": "1105", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1106", + "state": { + "$id": "1107", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deallocating" + }, + "count": { + "$id": "1108", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 10 + } + } + }, + { + "$id": "1109", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1110", + "state": { + "$id": "1111", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deallocated" + }, + "count": { + "$id": "1112", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 100 + } + } + }, + { + "$id": "1113", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1114", + "state": { + "$id": "1115", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Starting" + }, + "count": { + "$id": "1116", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1117", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1118", + "state": { + "$id": "1119", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deleting" + }, + "count": { + "$id": "1120", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1121", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1122", + "state": { + "$id": "1123", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Hibernating" + }, + "count": { + "$id": "1124", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1125", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1126", + "state": { + "$id": "1127", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Hibernated" + }, + "count": { + "$id": "1128", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "1129", + "kind": "model", + "type": { + "$ref": "366" + }, + "value": { + "$id": "1130", + "zone": { + "$id": "1131", + "kind": "number", + "type": { + "$ref": "368" + }, + "value": 2 + }, + "instanceCountsByState": { + "$id": "1132", + "kind": "array", + "type": { + "$ref": "372" + }, + "value": [ + { + "$id": "1133", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1134", + "state": { + "$id": "1135", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Creating" + }, + "count": { + "$id": "1136", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 100 + } + } + }, + { + "$id": "1137", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1138", + "state": { + "$id": "1139", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Running" + }, + "count": { + "$id": "1140", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 20 + } + } + }, + { + "$id": "1141", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1142", + "state": { + "$id": "1143", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deallocating" + }, + "count": { + "$id": "1144", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 10 + } + } + }, + { + "$id": "1145", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1146", + "state": { + "$id": "1147", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deallocated" + }, + "count": { + "$id": "1148", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 100 + } + } + }, + { + "$id": "1149", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1150", + "state": { + "$id": "1151", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Starting" + }, + "count": { + "$id": "1152", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1153", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1154", + "state": { + "$id": "1155", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deleting" + }, + "count": { + "$id": "1156", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1157", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1158", + "state": { + "$id": "1159", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Hibernating" + }, + "count": { + "$id": "1160", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1161", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1162", + "state": { + "$id": "1163", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Hibernated" + }, + "count": { + "$id": "1164", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "1165", + "kind": "model", + "type": { + "$ref": "366" + }, + "value": { + "$id": "1166", + "zone": { + "$id": "1167", + "kind": "number", + "type": { + "$ref": "368" + }, + "value": 3 + }, + "instanceCountsByState": { + "$id": "1168", + "kind": "array", + "type": { + "$ref": "372" + }, + "value": [ + { + "$id": "1169", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1170", + "state": { + "$id": "1171", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Creating" + }, + "count": { + "$id": "1172", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 100 + } + } + }, + { + "$id": "1173", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1174", + "state": { + "$id": "1175", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Running" + }, + "count": { + "$id": "1176", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 20 + } + } + }, + { + "$id": "1177", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1178", + "state": { + "$id": "1179", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deallocating" + }, + "count": { + "$id": "1180", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 10 + } + } + }, + { + "$id": "1181", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1182", + "state": { + "$id": "1183", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deallocated" + }, + "count": { + "$id": "1184", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 100 + } + } + }, + { + "$id": "1185", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1186", + "state": { + "$id": "1187", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Starting" + }, + "count": { + "$id": "1188", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1189", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1190", + "state": { + "$id": "1191", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deleting" + }, + "count": { + "$id": "1192", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1193", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1194", + "state": { + "$id": "1195", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Hibernating" + }, + "count": { + "$id": "1196", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1197", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1198", + "state": { + "$id": "1199", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Hibernated" + }, + "count": { + "$id": "1200", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "1201", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + }, + "status": { + "$id": "1202", + "kind": "model", + "type": { + "$ref": "161" + }, + "value": { + "$id": "1203", + "code": { + "$id": "1204", + "kind": "string", + "type": { + "$ref": "10" + }, + "value": "HealthState/healthy" + }, + "message": { + "$id": "1205", + "kind": "string", + "type": { + "$ref": "166" + }, + "value": "The pool is healthy." + } + } + }, + "prediction": { + "$id": "1206", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "1207", + "forecastValues": { + "$id": "1208", + "kind": "model", + "type": { + "$ref": "394" + }, + "value": { + "$id": "1209", + "instancesRequestedCount": { + "$id": "1210", + "kind": "array", + "type": { + "$ref": "396" + }, + "value": [ + { + "$id": "1211", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 24 + }, + { + "$id": "1212", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 10 + }, + { + "$id": "1213", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 200 + }, + { + "$id": "1214", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 12 + }, + { + "$id": "1215", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 5 + }, + { + "$id": "1216", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 10 + }, + { + "$id": "1217", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 15 + }, + { + "$id": "1218", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 23 + }, + { + "$id": "1219", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 56 + }, + { + "$id": "1220", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 38 + }, + { + "$id": "1221", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 12 + }, + { + "$id": "1222", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 19 + } + ] + } + } + }, + "forecastStartTime": { + "$id": "1223", + "kind": "string", + "type": { + "$ref": "403" + }, + "value": "2025-02-14T01:34:59.228Z" + }, + "forecastInfo": { + "$id": "1224", + "kind": "string", + "type": { + "$ref": "408" + }, + "value": "{\"forecastAccuracy\": 85, \"seriesUnitIntervalInMins\": 60, \"instancesRequestedCount_recentHistory\": \"[9, 4, 2, 8, 8, 2, 3, 6, 5, 3, 2, 6]\"}" + } + } + } + } + }, + "id": { + "$id": "1225", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/runtimeViews/latest" + }, + "name": { + "$id": "1226", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "1227", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/runtimeViews" + }, + "systemData": { + "$id": "1228", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "1229", + "createdBy": { + "$id": "1230", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1231", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "1232", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2024-02-14T23:31:59.679Z" + }, + "lastModifiedBy": { + "$id": "1233", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1234", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1235", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2024-02-14T23:31:59.679Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1236", + "name": "listByStandbyPool", + "resourceName": "StandbyVirtualMachinePoolRuntimeViewResource", + "doc": "List StandbyVirtualMachinePoolRuntimeViewResource resources by StandbyVirtualMachinePoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1237", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1238", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1239", + "type": { + "$id": "1240", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1241", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1242", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1243", + "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": "1244", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1245", + "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": "1246", + "name": "standbyVirtualMachinePoolName", + "nameInRequest": "standbyVirtualMachinePoolName", + "doc": "Name of the standby virtual machine pool", + "type": { + "$id": "1247", + "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": "1248", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1249", + "kind": "constant", + "valueType": { + "$id": "1250", + "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": "1251", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "415" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyVirtualMachinePoolName}/runtimeViews", + "bufferResponse": true, + "paging": { + "$id": "1252", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1253", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews.listByStandbyPool", + "decorators": [], + "examples": [ + { + "$id": "1254", + "kind": "http", + "name": "StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool", + "description": "StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool", + "filePath": "2025-03-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json", + "parameters": [ + { + "$id": "1255", + "parameter": { + "$ref": "1237" + }, + "value": { + "$id": "1256", + "kind": "string", + "type": { + "$ref": "1238" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1257", + "parameter": { + "$ref": "1241" + }, + "value": { + "$id": "1258", + "kind": "string", + "type": { + "$ref": "1242" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1259", + "parameter": { + "$ref": "1244" + }, + "value": { + "$id": "1260", + "kind": "string", + "type": { + "$ref": "1245" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1261", + "parameter": { + "$ref": "1246" + }, + "value": { + "$id": "1262", + "kind": "string", + "type": { + "$ref": "1247" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1263", + "response": { + "$ref": "1251" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1264", + "kind": "model", + "type": { + "$ref": "415" + }, + "value": { + "$id": "1265", + "value": { + "$id": "1266", + "kind": "array", + "type": { + "$ref": "417" + }, + "value": [ + { + "$id": "1267", + "kind": "model", + "type": { + "$ref": "361" + }, + "value": { + "$id": "1268", + "properties": { + "$id": "1269", + "kind": "model", + "type": { + "$ref": "363" + }, + "value": { + "$id": "1270", + "instanceCountSummary": { + "$id": "1271", + "kind": "array", + "type": { + "$ref": "365" + }, + "value": [ + { + "$id": "1272", + "kind": "model", + "type": { + "$ref": "366" + }, + "value": { + "$id": "1273", + "zone": { + "$id": "1274", + "kind": "number", + "type": { + "$ref": "368" + }, + "value": 1 + }, + "instanceCountsByState": { + "$id": "1275", + "kind": "array", + "type": { + "$ref": "372" + }, + "value": [ + { + "$id": "1276", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1277", + "state": { + "$id": "1278", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Creating" + }, + "count": { + "$id": "1279", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 100 + } + } + }, + { + "$id": "1280", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1281", + "state": { + "$id": "1282", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Running" + }, + "count": { + "$id": "1283", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 20 + } + } + }, + { + "$id": "1284", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1285", + "state": { + "$id": "1286", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deallocating" + }, + "count": { + "$id": "1287", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 10 + } + } + }, + { + "$id": "1288", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1289", + "state": { + "$id": "1290", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deallocated" + }, + "count": { + "$id": "1291", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 100 + } + } + }, + { + "$id": "1292", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1293", + "state": { + "$id": "1294", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Starting" + }, + "count": { + "$id": "1295", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1296", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1297", + "state": { + "$id": "1298", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deleting" + }, + "count": { + "$id": "1299", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1300", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1301", + "state": { + "$id": "1302", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Hibernating" + }, + "count": { + "$id": "1303", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1304", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1305", + "state": { + "$id": "1306", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Hibernated" + }, + "count": { + "$id": "1307", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "1308", + "kind": "model", + "type": { + "$ref": "366" + }, + "value": { + "$id": "1309", + "zone": { + "$id": "1310", + "kind": "number", + "type": { + "$ref": "368" + }, + "value": 2 + }, + "instanceCountsByState": { + "$id": "1311", + "kind": "array", + "type": { + "$ref": "372" + }, + "value": [ + { + "$id": "1312", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1313", + "state": { + "$id": "1314", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Creating" + }, + "count": { + "$id": "1315", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 100 + } + } + }, + { + "$id": "1316", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1317", + "state": { + "$id": "1318", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Running" + }, + "count": { + "$id": "1319", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 20 + } + } + }, + { + "$id": "1320", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1321", + "state": { + "$id": "1322", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deallocating" + }, + "count": { + "$id": "1323", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 10 + } + } + }, + { + "$id": "1324", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1325", + "state": { + "$id": "1326", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deallocated" + }, + "count": { + "$id": "1327", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 100 + } + } + }, + { + "$id": "1328", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1329", + "state": { + "$id": "1330", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Starting" + }, + "count": { + "$id": "1331", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1332", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1333", + "state": { + "$id": "1334", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deleting" + }, + "count": { + "$id": "1335", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1336", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1337", + "state": { + "$id": "1338", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Hibernating" + }, + "count": { + "$id": "1339", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1340", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1341", + "state": { + "$id": "1342", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Hibernated" + }, + "count": { + "$id": "1343", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + } + ] + } + } + }, + { + "$id": "1344", + "kind": "model", + "type": { + "$ref": "366" + }, + "value": { + "$id": "1345", + "zone": { + "$id": "1346", + "kind": "number", + "type": { + "$ref": "368" + }, + "value": 3 + }, + "instanceCountsByState": { + "$id": "1347", + "kind": "array", + "type": { + "$ref": "372" + }, + "value": [ + { + "$id": "1348", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1349", + "state": { + "$id": "1350", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Creating" + }, + "count": { + "$id": "1351", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 100 + } + } + }, + { + "$id": "1352", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1353", + "state": { + "$id": "1354", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Running" + }, + "count": { + "$id": "1355", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 20 + } + } + }, + { + "$id": "1356", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1357", + "state": { + "$id": "1358", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deallocating" + }, + "count": { + "$id": "1359", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 10 + } + } + }, + { + "$id": "1360", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1361", + "state": { + "$id": "1362", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deallocated" + }, + "count": { + "$id": "1363", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 100 + } + } + }, + { + "$id": "1364", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1365", + "state": { + "$id": "1366", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Starting" + }, + "count": { + "$id": "1367", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1368", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1369", + "state": { + "$id": "1370", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Deleting" + }, + "count": { + "$id": "1371", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1372", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1373", + "state": { + "$id": "1374", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Hibernating" + }, + "count": { + "$id": "1375", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + }, + { + "$id": "1376", + "kind": "model", + "type": { + "$ref": "373" + }, + "value": { + "$id": "1377", + "state": { + "$id": "1378", + "kind": "string", + "type": { + "$ref": "48" + }, + "value": "Hibernated" + }, + "count": { + "$id": "1379", + "kind": "number", + "type": { + "$ref": "378" + }, + "value": 0 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "1380", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + }, + "status": { + "$id": "1381", + "kind": "model", + "type": { + "$ref": "161" + }, + "value": { + "$id": "1382", + "code": { + "$id": "1383", + "kind": "string", + "type": { + "$ref": "10" + }, + "value": "HealthState/healthy" + }, + "message": { + "$id": "1384", + "kind": "string", + "type": { + "$ref": "166" + }, + "value": "The pool is healthy." + } + } + }, + "prediction": { + "$id": "1385", + "kind": "model", + "type": { + "$ref": "392" + }, + "value": { + "$id": "1386", + "forecastValues": { + "$id": "1387", + "kind": "model", + "type": { + "$ref": "394" + }, + "value": { + "$id": "1388", + "instancesRequestedCount": { + "$id": "1389", + "kind": "array", + "type": { + "$ref": "396" + }, + "value": [ + { + "$id": "1390", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 24 + }, + { + "$id": "1391", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 10 + }, + { + "$id": "1392", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 200 + }, + { + "$id": "1393", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 12 + }, + { + "$id": "1394", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 5 + }, + { + "$id": "1395", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 10 + }, + { + "$id": "1396", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 15 + }, + { + "$id": "1397", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 23 + }, + { + "$id": "1398", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 56 + }, + { + "$id": "1399", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 38 + }, + { + "$id": "1400", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 12 + }, + { + "$id": "1401", + "kind": "number", + "type": { + "$ref": "397" + }, + "value": 19 + } + ] + } + } + }, + "forecastStartTime": { + "$id": "1402", + "kind": "string", + "type": { + "$ref": "403" + }, + "value": "2025-02-14T01:34:59.228Z" + }, + "forecastInfo": { + "$id": "1403", + "kind": "string", + "type": { + "$ref": "408" + }, + "value": "{\"forecastAccuracy\": 85, \"seriesUnitIntervalInMins\": 60, \"instancesRequestedCount_recentHistory\": \"[9, 4, 2, 8, 8, 2, 3, 6, 5, 3, 2, 6]\"}" + } + } + } + } + }, + "id": { + "$id": "1404", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/pool/runtimeViews/latest" + }, + "name": { + "$id": "1405", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "1406", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyVirtualMachinePools/runtimeViews" + }, + "systemData": { + "$id": "1407", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "1408", + "createdBy": { + "$id": "1409", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1410", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "1411", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1412", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1413", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1414", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1415", + "kind": "string", + "type": { + "$ref": "421" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "parent": "StandbyPoolClient", + "parameters": [ + { + "$id": "1416", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "1417", + "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": "1418", + "type": { + "$id": "1419", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyVirtualMachinePoolRuntimeViews" + }, + { + "$id": "1420", + "name": "StandbyContainerGroupPools", + "namespace": "Azure.ResourceManager.StandbyPool", + "operations": [ + { + "$id": "1421", + "name": "get", + "resourceName": "StandbyContainerGroupPoolResource", + "doc": "Get a StandbyContainerGroupPoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1422", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1423", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1424", + "type": { + "$id": "1425", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1426", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1427", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1428", + "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": "1429", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1430", + "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": "1431", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "1432", + "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": "1433", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1434", + "kind": "constant", + "valueType": { + "$id": "1435", + "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": "1436", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "242" + }, + "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": "1437", + "kind": "http", + "name": "StandbyContainerGroupPools_Get", + "description": "StandbyContainerGroupPools_Get", + "filePath": "2025-03-01/StandbyContainerGroupPools_Get.json", + "parameters": [ + { + "$id": "1438", + "parameter": { + "$ref": "1422" + }, + "value": { + "$id": "1439", + "kind": "string", + "type": { + "$ref": "1423" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1440", + "parameter": { + "$ref": "1426" + }, + "value": { + "$id": "1441", + "kind": "string", + "type": { + "$ref": "1427" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1442", + "parameter": { + "$ref": "1429" + }, + "value": { + "$id": "1443", + "kind": "string", + "type": { + "$ref": "1430" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1444", + "parameter": { + "$ref": "1431" + }, + "value": { + "$id": "1445", + "kind": "string", + "type": { + "$ref": "1432" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1446", + "response": { + "$ref": "1436" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1447", + "kind": "model", + "type": { + "$ref": "242" + }, + "value": { + "$id": "1448", + "properties": { + "$id": "1449", + "kind": "model", + "type": { + "$ref": "255" + }, + "value": { + "$id": "1450", + "elasticityProfile": { + "$id": "1451", + "kind": "model", + "type": { + "$ref": "257" + }, + "value": { + "$id": "1452", + "maxReadyCapacity": { + "$id": "1453", + "kind": "number", + "type": { + "$ref": "259" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1454", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1455", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1456", + "kind": "model", + "type": { + "$ref": "268" + }, + "value": { + "$id": "1457", + "containerGroupProfile": { + "$id": "1458", + "kind": "model", + "type": { + "$ref": "270" + }, + "value": { + "$id": "1459", + "id": { + "$id": "1460", + "kind": "string", + "type": { + "$ref": "272" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1461", + "kind": "number", + "type": { + "$ref": "277" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1462", + "kind": "array", + "type": { + "$ref": "283" + }, + "value": [ + { + "$id": "1463", + "kind": "model", + "type": { + "$ref": "284" + }, + "value": { + "$id": "1464", + "id": { + "$id": "1465", + "kind": "string", + "type": { + "$ref": "286" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1466", + "kind": "array", + "type": { + "$ref": "295" + }, + "value": [ + { + "$id": "1467", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "1" + }, + { + "$id": "1468", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "2" + }, + { + "$id": "1469", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "3" + } + ] + } + } + }, + "tags": { + "$id": "1470", + "kind": "dict", + "type": { + "$ref": "245" + }, + "value": { + "$id": "1471" + } + }, + "location": { + "$id": "1472", + "kind": "string", + "type": { + "$ref": "251" + }, + "value": "West US" + }, + "id": { + "$id": "1473", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1474", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "1475", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1476", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "1477", + "createdBy": { + "$id": "1478", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1479", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "1480", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1481", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1482", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1483", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1484", + "name": "createOrUpdate", + "resourceName": "StandbyContainerGroupPoolResource", + "doc": "Create a StandbyContainerGroupPoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1485", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1486", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1487", + "type": { + "$id": "1488", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1489", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1490", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1491", + "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": "1492", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1493", + "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": "1494", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "1495", + "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": "1496", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "1497", + "kind": "constant", + "valueType": { + "$id": "1498", + "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": "1499", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1500", + "kind": "constant", + "valueType": { + "$id": "1501", + "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": "1502", + "name": "resource", + "nameInRequest": "resource", + "doc": "Resource create parameters.", + "type": { + "$ref": "242" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1503", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "242" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "$id": "1504", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "242" + }, + "headers": [ + { + "$id": "1505", + "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": "1506", + "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, + "longRunning": { + "$id": "1507", + "finalStateVia": 0, + "finalResponse": { + "$id": "1508", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "242" + } + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.createOrUpdate", + "decorators": [ + { + "$id": "1509", + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "$id": "1510", + "finalState": "azure-async-operation" + } + } + ], + "examples": [ + { + "$id": "1511", + "kind": "http", + "name": "StandbyContainerGroupPools_CreateOrUpdate", + "description": "StandbyContainerGroupPools_CreateOrUpdate", + "filePath": "2025-03-01/StandbyContainerGroupPools_CreateOrUpdate.json", + "parameters": [ + { + "$id": "1512", + "parameter": { + "$ref": "1485" + }, + "value": { + "$id": "1513", + "kind": "string", + "type": { + "$ref": "1486" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1514", + "parameter": { + "$ref": "1489" + }, + "value": { + "$id": "1515", + "kind": "string", + "type": { + "$ref": "1490" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1516", + "parameter": { + "$ref": "1492" + }, + "value": { + "$id": "1517", + "kind": "string", + "type": { + "$ref": "1493" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1518", + "parameter": { + "$ref": "1494" + }, + "value": { + "$id": "1519", + "kind": "string", + "type": { + "$ref": "1495" + }, + "value": "pool" + } + }, + { + "$id": "1520", + "parameter": { + "$ref": "1502" + }, + "value": { + "$id": "1521", + "kind": "model", + "type": { + "$ref": "242" + }, + "value": { + "$id": "1522", + "properties": { + "$id": "1523", + "kind": "model", + "type": { + "$ref": "255" + }, + "value": { + "$id": "1524", + "elasticityProfile": { + "$id": "1525", + "kind": "model", + "type": { + "$ref": "257" + }, + "value": { + "$id": "1526", + "maxReadyCapacity": { + "$id": "1527", + "kind": "number", + "type": { + "$ref": "259" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1528", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "always" + } + } + }, + "containerGroupProperties": { + "$id": "1529", + "kind": "model", + "type": { + "$ref": "268" + }, + "value": { + "$id": "1530", + "containerGroupProfile": { + "$id": "1531", + "kind": "model", + "type": { + "$ref": "270" + }, + "value": { + "$id": "1532", + "id": { + "$id": "1533", + "kind": "string", + "type": { + "$ref": "272" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1534", + "kind": "number", + "type": { + "$ref": "277" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1535", + "kind": "array", + "type": { + "$ref": "283" + }, + "value": [ + { + "$id": "1536", + "kind": "model", + "type": { + "$ref": "284" + }, + "value": { + "$id": "1537", + "id": { + "$id": "1538", + "kind": "string", + "type": { + "$ref": "286" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1539", + "kind": "array", + "type": { + "$ref": "295" + }, + "value": [ + { + "$id": "1540", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "1" + }, + { + "$id": "1541", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "2" + }, + { + "$id": "1542", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "3" + } + ] + } + } + }, + "tags": { + "$id": "1543", + "kind": "dict", + "type": { + "$ref": "245" + }, + "value": { + "$id": "1544" + } + }, + "location": { + "$id": "1545", + "kind": "string", + "type": { + "$ref": "251" + }, + "value": "West US" + } + } + } + } + ], + "responses": [ + { + "$id": "1546", + "response": { + "$ref": "1503" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1547", + "kind": "model", + "type": { + "$ref": "242" + }, + "value": { + "$id": "1548", + "properties": { + "$id": "1549", + "kind": "model", + "type": { + "$ref": "255" + }, + "value": { + "$id": "1550", + "elasticityProfile": { + "$id": "1551", + "kind": "model", + "type": { + "$ref": "257" + }, + "value": { + "$id": "1552", + "maxReadyCapacity": { + "$id": "1553", + "kind": "number", + "type": { + "$ref": "259" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1554", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1555", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1556", + "kind": "model", + "type": { + "$ref": "268" + }, + "value": { + "$id": "1557", + "containerGroupProfile": { + "$id": "1558", + "kind": "model", + "type": { + "$ref": "270" + }, + "value": { + "$id": "1559", + "id": { + "$id": "1560", + "kind": "string", + "type": { + "$ref": "272" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1561", + "kind": "number", + "type": { + "$ref": "277" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1562", + "kind": "array", + "type": { + "$ref": "283" + }, + "value": [ + { + "$id": "1563", + "kind": "model", + "type": { + "$ref": "284" + }, + "value": { + "$id": "1564", + "id": { + "$id": "1565", + "kind": "string", + "type": { + "$ref": "286" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1566", + "kind": "array", + "type": { + "$ref": "295" + }, + "value": [ + { + "$id": "1567", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "1" + }, + { + "$id": "1568", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "2" + }, + { + "$id": "1569", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "3" + } + ] + } + } + }, + "tags": { + "$id": "1570", + "kind": "dict", + "type": { + "$ref": "245" + }, + "value": { + "$id": "1571" + } + }, + "location": { + "$id": "1572", + "kind": "string", + "type": { + "$ref": "251" + }, + "value": "West US" + }, + "id": { + "$id": "1573", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1574", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "1575", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1576", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "1577", + "createdBy": { + "$id": "1578", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1579", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "1580", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1581", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1582", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1583", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + }, + { + "$id": "1584", + "response": { + "$ref": "1504" + }, + "statusCode": 201, + "bodyValue": { + "$id": "1585", + "kind": "model", + "type": { + "$ref": "242" + }, + "value": { + "$id": "1586", + "properties": { + "$id": "1587", + "kind": "model", + "type": { + "$ref": "255" + }, + "value": { + "$id": "1588", + "elasticityProfile": { + "$id": "1589", + "kind": "model", + "type": { + "$ref": "257" + }, + "value": { + "$id": "1590", + "maxReadyCapacity": { + "$id": "1591", + "kind": "number", + "type": { + "$ref": "259" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1592", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1593", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1594", + "kind": "model", + "type": { + "$ref": "268" + }, + "value": { + "$id": "1595", + "containerGroupProfile": { + "$id": "1596", + "kind": "model", + "type": { + "$ref": "270" + }, + "value": { + "$id": "1597", + "id": { + "$id": "1598", + "kind": "string", + "type": { + "$ref": "272" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1599", + "kind": "number", + "type": { + "$ref": "277" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1600", + "kind": "array", + "type": { + "$ref": "283" + }, + "value": [ + { + "$id": "1601", + "kind": "model", + "type": { + "$ref": "284" + }, + "value": { + "$id": "1602", + "id": { + "$id": "1603", + "kind": "string", + "type": { + "$ref": "286" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1604", + "kind": "array", + "type": { + "$ref": "295" + }, + "value": [ + { + "$id": "1605", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "1" + }, + { + "$id": "1606", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "2" + }, + { + "$id": "1607", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "3" + } + ] + } + } + }, + "tags": { + "$id": "1608", + "kind": "dict", + "type": { + "$ref": "245" + }, + "value": { + "$id": "1609" + } + }, + "location": { + "$id": "1610", + "kind": "string", + "type": { + "$ref": "251" + }, + "value": "West US" + }, + "id": { + "$id": "1611", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1612", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "1613", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1614", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "1615", + "createdBy": { + "$id": "1616", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1617", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "1618", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1619", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1620", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1621", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1622", + "name": "delete", + "resourceName": "StandbyContainerGroupPoolResource", + "doc": "Delete a StandbyContainerGroupPoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1623", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1624", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1625", + "type": { + "$id": "1626", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1627", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1628", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1629", + "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": "1630", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1631", + "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": "1632", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "1633", + "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": "1634", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1635", + "kind": "constant", + "valueType": { + "$id": "1636", + "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": "1637", + "statusCodes": [ + 202 + ], + "headers": [ + { + "$id": "1638", + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "1639", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1640", + "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": "1641", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "$id": "1642", + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}", + "bufferResponse": true, + "longRunning": { + "$id": "1643", + "finalStateVia": 1, + "finalResponse": { + "$id": "1644", + "statusCodes": [ + 204 + ] + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.delete", + "decorators": [], + "examples": [ + { + "$id": "1645", + "kind": "http", + "name": "StandbyContainerGroupPools_Delete", + "description": "StandbyContainerGroupPools_Delete", + "filePath": "2025-03-01/StandbyContainerGroupPools_Delete.json", + "parameters": [ + { + "$id": "1646", + "parameter": { + "$ref": "1623" + }, + "value": { + "$id": "1647", + "kind": "string", + "type": { + "$ref": "1624" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1648", + "parameter": { + "$ref": "1627" + }, + "value": { + "$id": "1649", + "kind": "string", + "type": { + "$ref": "1628" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1650", + "parameter": { + "$ref": "1630" + }, + "value": { + "$id": "1651", + "kind": "string", + "type": { + "$ref": "1631" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1652", + "parameter": { + "$ref": "1632" + }, + "value": { + "$id": "1653", + "kind": "string", + "type": { + "$ref": "1633" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "1654", + "response": { + "$ref": "1637" + }, + "statusCode": 202 + }, + { + "$id": "1655", + "response": { + "$ref": "1642" + }, + "statusCode": 204 + } + ] + } + ] + }, + { + "$id": "1656", + "name": "update", + "resourceName": "StandbyContainerGroupPoolResource", + "doc": "Update a StandbyContainerGroupPoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1657", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1658", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1659", + "type": { + "$id": "1660", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1661", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1662", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1663", + "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": "1664", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1665", + "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": "1666", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "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": "contentType", + "nameInRequest": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "1669", + "kind": "constant", + "valueType": { + "$id": "1670", + "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": "1671", + "name": "accept", + "nameInRequest": "Accept", + "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": "properties", + "nameInRequest": "properties", + "doc": "The resource properties to be updated.", + "type": { + "$ref": "329" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1675", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "242" + }, + "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": "1676", + "kind": "http", + "name": "StandbyContainerGroupPools_Update", + "description": "StandbyContainerGroupPools_Update", + "filePath": "2025-03-01/StandbyContainerGroupPools_Update.json", + "parameters": [ + { + "$id": "1677", + "parameter": { + "$ref": "1657" + }, + "value": { + "$id": "1678", + "kind": "string", + "type": { + "$ref": "1658" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1679", + "parameter": { + "$ref": "1661" + }, + "value": { + "$id": "1680", + "kind": "string", + "type": { + "$ref": "1662" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1681", + "parameter": { + "$ref": "1664" + }, + "value": { + "$id": "1682", + "kind": "string", + "type": { + "$ref": "1665" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1683", + "parameter": { + "$ref": "1666" + }, + "value": { + "$id": "1684", + "kind": "string", + "type": { + "$ref": "1667" + }, + "value": "pool" + } + }, + { + "$id": "1685", + "parameter": { + "$ref": "1674" + }, + "value": { + "$id": "1686", + "kind": "model", + "type": { + "$ref": "329" + }, + "value": { + "$id": "1687", + "tags": { + "$id": "1688", + "kind": "dict", + "type": { + "$ref": "331" + }, + "value": { + "$id": "1689" + } + }, + "properties": { + "$id": "1690", + "kind": "model", + "type": { + "$ref": "337" + }, + "value": { + "$id": "1691", + "elasticityProfile": { + "$id": "1692", + "kind": "model", + "type": { + "$ref": "257" + }, + "value": { + "$id": "1693", + "maxReadyCapacity": { + "$id": "1694", + "kind": "number", + "type": { + "$ref": "259" + }, + "value": 1743 + }, + "refillPolicy": { + "$id": "1695", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "always" + } + } + }, + "containerGroupProperties": { + "$id": "1696", + "kind": "model", + "type": { + "$ref": "268" + }, + "value": { + "$id": "1697", + "containerGroupProfile": { + "$id": "1698", + "kind": "model", + "type": { + "$ref": "270" + }, + "value": { + "$id": "1699", + "id": { + "$id": "1700", + "kind": "string", + "type": { + "$ref": "272" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1701", + "kind": "number", + "type": { + "$ref": "277" + }, + "value": 2 + } + } + }, + "subnetIds": { + "$id": "1702", + "kind": "array", + "type": { + "$ref": "283" + }, + "value": [ + { + "$id": "1703", + "kind": "model", + "type": { + "$ref": "284" + }, + "value": { + "$id": "1704", + "id": { + "$id": "1705", + "kind": "string", + "type": { + "$ref": "286" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1706", + "kind": "array", + "type": { + "$ref": "345" + }, + "value": [ + { + "$id": "1707", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "1" + }, + { + "$id": "1708", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "2" + }, + { + "$id": "1709", + "kind": "string", + "type": { + "$ref": "346" + }, + "value": "3" + } + ] + } + } + } + } + } + } + ], + "responses": [ + { + "$id": "1710", + "response": { + "$ref": "1675" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1711", + "kind": "model", + "type": { + "$ref": "242" + }, + "value": { + "$id": "1712", + "properties": { + "$id": "1713", + "kind": "model", + "type": { + "$ref": "255" + }, + "value": { + "$id": "1714", + "elasticityProfile": { + "$id": "1715", + "kind": "model", + "type": { + "$ref": "257" + }, + "value": { + "$id": "1716", + "maxReadyCapacity": { + "$id": "1717", + "kind": "number", + "type": { + "$ref": "259" + }, + "value": 1743 + }, + "refillPolicy": { + "$id": "1718", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1719", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1720", + "kind": "model", + "type": { + "$ref": "268" + }, + "value": { + "$id": "1721", + "containerGroupProfile": { + "$id": "1722", + "kind": "model", + "type": { + "$ref": "270" + }, + "value": { + "$id": "1723", + "id": { + "$id": "1724", + "kind": "string", + "type": { + "$ref": "272" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1725", + "kind": "number", + "type": { + "$ref": "277" + }, + "value": 2 + } + } + }, + "subnetIds": { + "$id": "1726", + "kind": "array", + "type": { + "$ref": "283" + }, + "value": [ + { + "$id": "1727", + "kind": "model", + "type": { + "$ref": "284" + }, + "value": { + "$id": "1728", + "id": { + "$id": "1729", + "kind": "string", + "type": { + "$ref": "286" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1730", + "kind": "array", + "type": { + "$ref": "295" + }, + "value": [ + { + "$id": "1731", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "1" + }, + { + "$id": "1732", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "2" + }, + { + "$id": "1733", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "3" + } + ] + } + } + }, + "tags": { + "$id": "1734", + "kind": "dict", + "type": { + "$ref": "245" + }, + "value": { + "$id": "1735" + } + }, + "location": { + "$id": "1736", + "kind": "string", + "type": { + "$ref": "251" + }, + "value": "West US" + }, + "id": { + "$id": "1737", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1738", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "1739", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1740", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "1741", + "createdBy": { + "$id": "1742", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1743", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "1744", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1745", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1746", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1747", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1748", + "name": "listByResourceGroup", + "resourceName": "StandbyContainerGroupPoolResource", + "doc": "List StandbyContainerGroupPoolResource resources by resource group", + "accessibility": "public", + "parameters": [ + { + "$id": "1749", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1750", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1751", + "type": { + "$id": "1752", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1753", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1754", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1755", + "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": "1756", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1757", + "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": "1758", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1759", + "kind": "constant", + "valueType": { + "$id": "1760", + "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": "1761", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "351" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools", + "bufferResponse": true, + "paging": { + "$id": "1762", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1763", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.listByResourceGroup", + "decorators": [], + "examples": [ + { + "$id": "1764", + "kind": "http", + "name": "StandbyContainerGroupPools_ListByResourceGroup", + "description": "StandbyContainerGroupPools_ListByResourceGroup", + "filePath": "2025-03-01/StandbyContainerGroupPools_ListByResourceGroup.json", + "parameters": [ + { + "$id": "1765", + "parameter": { + "$ref": "1749" + }, + "value": { + "$id": "1766", + "kind": "string", + "type": { + "$ref": "1750" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1767", + "parameter": { + "$ref": "1753" + }, + "value": { + "$id": "1768", + "kind": "string", + "type": { + "$ref": "1754" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1769", + "parameter": { + "$ref": "1756" + }, + "value": { + "$id": "1770", + "kind": "string", + "type": { + "$ref": "1757" + }, + "value": "rgstandbypool" + } + } + ], + "responses": [ + { + "$id": "1771", + "response": { + "$ref": "1761" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1772", + "kind": "model", + "type": { + "$ref": "351" + }, + "value": { + "$id": "1773", + "value": { + "$id": "1774", + "kind": "array", + "type": { + "$ref": "353" + }, + "value": [ + { + "$id": "1775", + "kind": "model", + "type": { + "$ref": "242" + }, + "value": { + "$id": "1776", + "properties": { + "$id": "1777", + "kind": "model", + "type": { + "$ref": "255" + }, + "value": { + "$id": "1778", + "elasticityProfile": { + "$id": "1779", + "kind": "model", + "type": { + "$ref": "257" + }, + "value": { + "$id": "1780", + "maxReadyCapacity": { + "$id": "1781", + "kind": "number", + "type": { + "$ref": "259" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1782", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1783", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1784", + "kind": "model", + "type": { + "$ref": "268" + }, + "value": { + "$id": "1785", + "containerGroupProfile": { + "$id": "1786", + "kind": "model", + "type": { + "$ref": "270" + }, + "value": { + "$id": "1787", + "id": { + "$id": "1788", + "kind": "string", + "type": { + "$ref": "272" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1789", + "kind": "number", + "type": { + "$ref": "277" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1790", + "kind": "array", + "type": { + "$ref": "283" + }, + "value": [ + { + "$id": "1791", + "kind": "model", + "type": { + "$ref": "284" + }, + "value": { + "$id": "1792", + "id": { + "$id": "1793", + "kind": "string", + "type": { + "$ref": "286" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1794", + "kind": "array", + "type": { + "$ref": "295" + }, + "value": [ + { + "$id": "1795", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "1" + }, + { + "$id": "1796", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "2" + }, + { + "$id": "1797", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "3" + } + ] + } + } + }, + "tags": { + "$id": "1798", + "kind": "dict", + "type": { + "$ref": "245" + }, + "value": { + "$id": "1799" + } + }, + "location": { + "$id": "1800", + "kind": "string", + "type": { + "$ref": "251" + }, + "value": "West US" + }, + "id": { + "$id": "1801", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1802", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "1803", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1804", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "1805", + "createdBy": { + "$id": "1806", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1807", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "1808", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1809", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1810", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1811", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1812", + "kind": "string", + "type": { + "$ref": "357" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + }, + { + "$id": "1813", + "name": "listBySubscription", + "resourceName": "StandbyContainerGroupPoolResource", + "doc": "List StandbyContainerGroupPoolResource resources by subscription ID", + "accessibility": "public", + "parameters": [ + { + "$id": "1814", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1815", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1816", + "type": { + "$id": "1817", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1818", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1819", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1820", + "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": "1821", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1822", + "kind": "constant", + "valueType": { + "$id": "1823", + "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": "1824", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "351" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyContainerGroupPools", + "bufferResponse": true, + "paging": { + "$id": "1825", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "1826", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools.listBySubscription", + "decorators": [], + "examples": [ + { + "$id": "1827", + "kind": "http", + "name": "StandbyContainerGroupPools_ListBySubscription", + "description": "StandbyContainerGroupPools_ListBySubscription", + "filePath": "2025-03-01/StandbyContainerGroupPools_ListBySubscription.json", + "parameters": [ + { + "$id": "1828", + "parameter": { + "$ref": "1814" + }, + "value": { + "$id": "1829", + "kind": "string", + "type": { + "$ref": "1815" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1830", + "parameter": { + "$ref": "1818" + }, + "value": { + "$id": "1831", + "kind": "string", + "type": { + "$ref": "1819" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + } + ], + "responses": [ + { + "$id": "1832", + "response": { + "$ref": "1824" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1833", + "kind": "model", + "type": { + "$ref": "351" + }, + "value": { + "$id": "1834", + "value": { + "$id": "1835", + "kind": "array", + "type": { + "$ref": "353" + }, + "value": [ + { + "$id": "1836", + "kind": "model", + "type": { + "$ref": "242" + }, + "value": { + "$id": "1837", + "properties": { + "$id": "1838", + "kind": "model", + "type": { + "$ref": "255" + }, + "value": { + "$id": "1839", + "elasticityProfile": { + "$id": "1840", + "kind": "model", + "type": { + "$ref": "257" + }, + "value": { + "$id": "1841", + "maxReadyCapacity": { + "$id": "1842", + "kind": "number", + "type": { + "$ref": "259" + }, + "value": 688 + }, + "refillPolicy": { + "$id": "1843", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "always" + } + } + }, + "provisioningState": { + "$id": "1844", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + }, + "containerGroupProperties": { + "$id": "1845", + "kind": "model", + "type": { + "$ref": "268" + }, + "value": { + "$id": "1846", + "containerGroupProfile": { + "$id": "1847", + "kind": "model", + "type": { + "$ref": "270" + }, + "value": { + "$id": "1848", + "id": { + "$id": "1849", + "kind": "string", + "type": { + "$ref": "272" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile" + }, + "revision": { + "$id": "1850", + "kind": "number", + "type": { + "$ref": "277" + }, + "value": 1 + } + } + }, + "subnetIds": { + "$id": "1851", + "kind": "array", + "type": { + "$ref": "283" + }, + "value": [ + { + "$id": "1852", + "kind": "model", + "type": { + "$ref": "284" + }, + "value": { + "$id": "1853", + "id": { + "$id": "1854", + "kind": "string", + "type": { + "$ref": "286" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet" + } + } + } + ] + } + } + }, + "zones": { + "$id": "1855", + "kind": "array", + "type": { + "$ref": "295" + }, + "value": [ + { + "$id": "1856", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "1" + }, + { + "$id": "1857", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "2" + }, + { + "$id": "1858", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "3" + } + ] + } + } + }, + "tags": { + "$id": "1859", + "kind": "dict", + "type": { + "$ref": "245" + }, + "value": { + "$id": "1860" + } + }, + "location": { + "$id": "1861", + "kind": "string", + "type": { + "$ref": "251" + }, + "value": "West US" + }, + "id": { + "$id": "1862", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool" + }, + "name": { + "$id": "1863", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "1864", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools" + }, + "systemData": { + "$id": "1865", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "1866", + "createdBy": { + "$id": "1867", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1868", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "1869", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1870", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1871", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1872", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "1873", + "kind": "string", + "type": { + "$ref": "357" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "parent": "StandbyPoolClient", + "parameters": [ + { + "$id": "1874", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "1875", + "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": "1876", + "type": { + "$id": "1877", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPools" + }, + { + "$id": "1878", + "name": "StandbyContainerGroupPoolRuntimeViews", + "namespace": "Azure.ResourceManager.StandbyPool", + "operations": [ + { + "$id": "1879", + "name": "get", + "resourceName": "StandbyContainerGroupPoolRuntimeViewResource", + "doc": "Get a StandbyContainerGroupPoolRuntimeViewResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1880", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1881", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1882", + "type": { + "$id": "1883", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1884", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1885", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1886", + "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": "1887", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "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": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "1890", + "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": "1891", + "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": "1892", + "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": "1893", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1894", + "kind": "constant", + "valueType": { + "$id": "1895", + "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": "1896", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "92" + }, + "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": "1897", + "kind": "http", + "name": "StandbyContainerGroupPoolRuntimeViews_Get", + "description": "StandbyContainerGroupPoolRuntimeViews_Get", + "filePath": "2025-03-01/StandbyContainerGroupPoolRuntimeViews_Get.json", + "parameters": [ + { + "$id": "1898", + "parameter": { + "$ref": "1880" + }, + "value": { + "$id": "1899", + "kind": "string", + "type": { + "$ref": "1881" + }, + "value": "2025-03-01" + } + }, + { + "$id": "1900", + "parameter": { + "$ref": "1884" + }, + "value": { + "$id": "1901", + "kind": "string", + "type": { + "$ref": "1885" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "1902", + "parameter": { + "$ref": "1887" + }, + "value": { + "$id": "1903", + "kind": "string", + "type": { + "$ref": "1888" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "1904", + "parameter": { + "$ref": "1889" + }, + "value": { + "$id": "1905", + "kind": "string", + "type": { + "$ref": "1890" + }, + "value": "pool" + } + }, + { + "$id": "1906", + "parameter": { + "$ref": "1891" + }, + "value": { + "$id": "1907", + "kind": "string", + "type": { + "$ref": "1892" + }, + "value": "latest" + } + } + ], + "responses": [ + { + "$id": "1908", + "response": { + "$ref": "1896" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1909", + "kind": "model", + "type": { + "$ref": "92" + }, + "value": { + "$id": "1910", + "properties": { + "$id": "1911", + "kind": "model", + "type": { + "$ref": "138" + }, + "value": { + "$id": "1912", + "instanceCountSummary": { + "$id": "1913", + "kind": "array", + "type": { + "$ref": "140" + }, + "value": [ + { + "$id": "1914", + "kind": "model", + "type": { + "$ref": "141" + }, + "value": { + "$id": "1915", + "zone": { + "$id": "1916", + "kind": "number", + "type": { + "$ref": "143" + }, + "value": 1 + }, + "instanceCountsByState": { + "$id": "1917", + "kind": "array", + "type": { + "$ref": "147" + }, + "value": [ + { + "$id": "1918", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "1919", + "state": { + "$id": "1920", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Creating" + }, + "count": { + "$id": "1921", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 100 + } + } + }, + { + "$id": "1922", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "1923", + "state": { + "$id": "1924", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Running" + }, + "count": { + "$id": "1925", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 20 + } + } + }, + { + "$id": "1926", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "1927", + "state": { + "$id": "1928", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Deleting" + }, + "count": { + "$id": "1929", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 21 + } + } + } + ] + } + } + }, + { + "$id": "1930", + "kind": "model", + "type": { + "$ref": "141" + }, + "value": { + "$id": "1931", + "zone": { + "$id": "1932", + "kind": "number", + "type": { + "$ref": "143" + }, + "value": 2 + }, + "instanceCountsByState": { + "$id": "1933", + "kind": "array", + "type": { + "$ref": "147" + }, + "value": [ + { + "$id": "1934", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "1935", + "state": { + "$id": "1936", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Creating" + }, + "count": { + "$id": "1937", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 100 + } + } + }, + { + "$id": "1938", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "1939", + "state": { + "$id": "1940", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Running" + }, + "count": { + "$id": "1941", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 500 + } + } + }, + { + "$id": "1942", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "1943", + "state": { + "$id": "1944", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Deleting" + }, + "count": { + "$id": "1945", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 20 + } + } + } + ] + } + } + }, + { + "$id": "1946", + "kind": "model", + "type": { + "$ref": "141" + }, + "value": { + "$id": "1947", + "zone": { + "$id": "1948", + "kind": "number", + "type": { + "$ref": "143" + }, + "value": 3 + }, + "instanceCountsByState": { + "$id": "1949", + "kind": "array", + "type": { + "$ref": "147" + }, + "value": [ + { + "$id": "1950", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "1951", + "state": { + "$id": "1952", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Creating" + }, + "count": { + "$id": "1953", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 100 + } + } + }, + { + "$id": "1954", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "1955", + "state": { + "$id": "1956", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Running" + }, + "count": { + "$id": "1957", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 20 + } + } + }, + { + "$id": "1958", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "1959", + "state": { + "$id": "1960", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Deleting" + }, + "count": { + "$id": "1961", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 7 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "1962", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + }, + "status": { + "$id": "1963", + "kind": "model", + "type": { + "$ref": "161" + }, + "value": { + "$id": "1964", + "code": { + "$id": "1965", + "kind": "string", + "type": { + "$ref": "10" + }, + "value": "HealthState/healthy" + }, + "message": { + "$id": "1966", + "kind": "string", + "type": { + "$ref": "166" + }, + "value": "The pool is healthy." + } + } + }, + "prediction": { + "$id": "1967", + "kind": "model", + "type": { + "$ref": "175" + }, + "value": { + "$id": "1968", + "forecastValues": { + "$id": "1969", + "kind": "model", + "type": { + "$ref": "177" + }, + "value": { + "$id": "1970", + "instancesRequestedCount": { + "$id": "1971", + "kind": "array", + "type": { + "$ref": "179" + }, + "value": [ + { + "$id": "1972", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 24 + }, + { + "$id": "1973", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 10 + }, + { + "$id": "1974", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 200 + }, + { + "$id": "1975", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 12 + }, + { + "$id": "1976", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 5 + }, + { + "$id": "1977", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 10 + }, + { + "$id": "1978", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 15 + }, + { + "$id": "1979", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 23 + }, + { + "$id": "1980", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 56 + }, + { + "$id": "1981", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 38 + }, + { + "$id": "1982", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 12 + }, + { + "$id": "1983", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 19 + } + ] + } + } + }, + "forecastStartTime": { + "$id": "1984", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "2025-02-14T01:34:59.228Z" + }, + "forecastInfo": { + "$id": "1985", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "{\"forecastAccuracy\": 85, \"seriesUnitIntervalInMins\": 60, \"instancesRequestedCount_recentHistory\": \"[9, 4, 2, 8, 8, 2, 3, 6, 5, 3, 2, 6]\"}" + } + } + } + } + }, + "id": { + "$id": "1986", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool/runtimeViews/latest" + }, + "name": { + "$id": "1987", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "1988", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools/runtimeViews" + }, + "systemData": { + "$id": "1989", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "1990", + "createdBy": { + "$id": "1991", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "1992", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "1993", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "1994", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "1995", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1996", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + } + ] + } + ] + }, + { + "$id": "1997", + "name": "listByStandbyPool", + "resourceName": "StandbyContainerGroupPoolRuntimeViewResource", + "doc": "List StandbyContainerGroupPoolRuntimeViewResource resources by StandbyContainerGroupPoolResource", + "accessibility": "public", + "parameters": [ + { + "$id": "1998", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1999", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "2000", + "type": { + "$id": "2001", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "2002", + "name": "subscriptionId", + "nameInRequest": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "2003", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "2004", + "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": "2005", + "name": "resourceGroupName", + "nameInRequest": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "2006", + "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": "2007", + "name": "standbyContainerGroupPoolName", + "nameInRequest": "standbyContainerGroupPoolName", + "doc": "Name of the standby container group pool", + "type": { + "$id": "2008", + "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": "2009", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "2010", + "kind": "constant", + "valueType": { + "$id": "2011", + "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": "2012", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "232" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}/runtimeViews", + "bufferResponse": true, + "paging": { + "$id": "2013", + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "$id": "2014", + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + }, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews.listByStandbyPool", + "decorators": [], + "examples": [ + { + "$id": "2015", + "kind": "http", + "name": "StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool", + "description": "StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool", + "filePath": "2025-03-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json", + "parameters": [ + { + "$id": "2016", + "parameter": { + "$ref": "1998" + }, + "value": { + "$id": "2017", + "kind": "string", + "type": { + "$ref": "1999" + }, + "value": "2025-03-01" + } + }, + { + "$id": "2018", + "parameter": { + "$ref": "2002" + }, + "value": { + "$id": "2019", + "kind": "string", + "type": { + "$ref": "2003" + }, + "value": "00000000-0000-0000-0000-000000000009" + } + }, + { + "$id": "2020", + "parameter": { + "$ref": "2005" + }, + "value": { + "$id": "2021", + "kind": "string", + "type": { + "$ref": "2006" + }, + "value": "rgstandbypool" + } + }, + { + "$id": "2022", + "parameter": { + "$ref": "2007" + }, + "value": { + "$id": "2023", + "kind": "string", + "type": { + "$ref": "2008" + }, + "value": "pool" + } + } + ], + "responses": [ + { + "$id": "2024", + "response": { + "$ref": "2012" + }, + "statusCode": 200, + "bodyValue": { + "$id": "2025", + "kind": "model", + "type": { + "$ref": "232" + }, + "value": { + "$id": "2026", + "value": { + "$id": "2027", + "kind": "array", + "type": { + "$ref": "234" + }, + "value": [ + { + "$id": "2028", + "kind": "model", + "type": { + "$ref": "92" + }, + "value": { + "$id": "2029", + "properties": { + "$id": "2030", + "kind": "model", + "type": { + "$ref": "138" + }, + "value": { + "$id": "2031", + "instanceCountSummary": { + "$id": "2032", + "kind": "array", + "type": { + "$ref": "140" + }, + "value": [ + { + "$id": "2033", + "kind": "model", + "type": { + "$ref": "141" + }, + "value": { + "$id": "2034", + "zone": { + "$id": "2035", + "kind": "number", + "type": { + "$ref": "143" + }, + "value": 1 + }, + "instanceCountsByState": { + "$id": "2036", + "kind": "array", + "type": { + "$ref": "147" + }, + "value": [ + { + "$id": "2037", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "2038", + "state": { + "$id": "2039", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Creating" + }, + "count": { + "$id": "2040", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 100 + } + } + }, + { + "$id": "2041", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "2042", + "state": { + "$id": "2043", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Running" + }, + "count": { + "$id": "2044", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 20 + } + } + }, + { + "$id": "2045", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "2046", + "state": { + "$id": "2047", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Deleting" + }, + "count": { + "$id": "2048", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 21 + } + } + } + ] + } + } + }, + { + "$id": "2049", + "kind": "model", + "type": { + "$ref": "141" + }, + "value": { + "$id": "2050", + "zone": { + "$id": "2051", + "kind": "number", + "type": { + "$ref": "143" + }, + "value": 2 + }, + "instanceCountsByState": { + "$id": "2052", + "kind": "array", + "type": { + "$ref": "147" + }, + "value": [ + { + "$id": "2053", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "2054", + "state": { + "$id": "2055", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Creating" + }, + "count": { + "$id": "2056", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 100 + } + } + }, + { + "$id": "2057", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "2058", + "state": { + "$id": "2059", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Running" + }, + "count": { + "$id": "2060", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 500 + } + } + }, + { + "$id": "2061", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "2062", + "state": { + "$id": "2063", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Deleting" + }, + "count": { + "$id": "2064", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 20 + } + } + } + ] + } + } + }, + { + "$id": "2065", + "kind": "model", + "type": { + "$ref": "141" + }, + "value": { + "$id": "2066", + "zone": { + "$id": "2067", + "kind": "number", + "type": { + "$ref": "143" + }, + "value": 3 + }, + "instanceCountsByState": { + "$id": "2068", + "kind": "array", + "type": { + "$ref": "147" + }, + "value": [ + { + "$id": "2069", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "2070", + "state": { + "$id": "2071", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Creating" + }, + "count": { + "$id": "2072", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 100 + } + } + }, + { + "$id": "2073", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "2074", + "state": { + "$id": "2075", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Running" + }, + "count": { + "$id": "2076", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 20 + } + } + }, + { + "$id": "2077", + "kind": "model", + "type": { + "$ref": "148" + }, + "value": { + "$id": "2078", + "state": { + "$id": "2079", + "kind": "string", + "type": { + "$ref": "2" + }, + "value": "Deleting" + }, + "count": { + "$id": "2080", + "kind": "number", + "type": { + "$ref": "153" + }, + "value": 7 + } + } + } + ] + } + } + } + ] + }, + "provisioningState": { + "$id": "2081", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "Succeeded" + }, + "status": { + "$id": "2082", + "kind": "model", + "type": { + "$ref": "161" + }, + "value": { + "$id": "2083", + "code": { + "$id": "2084", + "kind": "string", + "type": { + "$ref": "10" + }, + "value": "HealthState/healthy" + }, + "message": { + "$id": "2085", + "kind": "string", + "type": { + "$ref": "166" + }, + "value": "The pool is healthy." + } + } + }, + "prediction": { + "$id": "2086", + "kind": "model", + "type": { + "$ref": "175" + }, + "value": { + "$id": "2087", + "forecastValues": { + "$id": "2088", + "kind": "model", + "type": { + "$ref": "177" + }, + "value": { + "$id": "2089", + "instancesRequestedCount": { + "$id": "2090", + "kind": "array", + "type": { + "$ref": "179" + }, + "value": [ + { + "$id": "2091", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 24 + }, + { + "$id": "2092", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 10 + }, + { + "$id": "2093", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 200 + }, + { + "$id": "2094", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 12 + }, + { + "$id": "2095", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 5 + }, + { + "$id": "2096", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 10 + }, + { + "$id": "2097", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 15 + }, + { + "$id": "2098", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 23 + }, + { + "$id": "2099", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 56 + }, + { + "$id": "2100", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 38 + }, + { + "$id": "2101", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 12 + }, + { + "$id": "2102", + "kind": "number", + "type": { + "$ref": "180" + }, + "value": 19 + } + ] + } + } + }, + "forecastStartTime": { + "$id": "2103", + "kind": "string", + "type": { + "$ref": "186" + }, + "value": "2025-02-14T01:34:59.228Z" + }, + "forecastInfo": { + "$id": "2104", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "{\"forecastAccuracy\": 85, \"seriesUnitIntervalInMins\": 60, \"instancesRequestedCount_recentHistory\": \"[9, 4, 2, 8, 8, 2, 3, 6, 5, 3, 2, 6]\"}" + } + } + } + } + }, + "id": { + "$id": "2105", + "kind": "string", + "type": { + "$ref": "96" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.StandbyPool/standbyContainerGroupPools/pool/runtimeViews/latest" + }, + "name": { + "$id": "2106", + "kind": "string", + "type": { + "$ref": "101" + }, + "value": "pool" + }, + "type": { + "$id": "2107", + "kind": "string", + "type": { + "$ref": "105" + }, + "value": "Microsoft.StandbyPool/standbyContainerGroupPools/runtimeViews" + }, + "systemData": { + "$id": "2108", + "kind": "model", + "type": { + "$ref": "110" + }, + "value": { + "$id": "2109", + "createdBy": { + "$id": "2110", + "kind": "string", + "type": { + "$ref": "112" + }, + "value": "pooluser@microsoft.com" + }, + "createdByType": { + "$id": "2111", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "createdAt": { + "$id": "2112", + "kind": "string", + "type": { + "$ref": "119" + }, + "value": "2023-09-07T16:33:22.210Z" + }, + "lastModifiedBy": { + "$id": "2113", + "kind": "string", + "type": { + "$ref": "124" + }, + "value": "pooluser@microsoft.com" + }, + "lastModifiedByType": { + "$id": "2114", + "kind": "string", + "type": { + "$ref": "26" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "2115", + "kind": "string", + "type": { + "$ref": "131" + }, + "value": "2023-09-07T16:33:22.210Z" + } + } + } + } + } + ] + }, + "nextLink": { + "$id": "2116", + "kind": "string", + "type": { + "$ref": "238" + }, + "value": "https://microsoft.com/a" + } + } + } + } + ] + } + ] + } + ], + "parent": "StandbyPoolClient", + "parameters": [ + { + "$id": "2117", + "name": "endpoint", + "nameInRequest": "endpoint", + "doc": "Service host", + "type": { + "$id": "2118", + "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": "2119", + "type": { + "$id": "2120", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + } + } + ], + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.StandbyPool.StandbyContainerGroupPoolRuntimeViews" + } + ], + "auth": { + "$id": "2121", + "oAuth2": { + "$id": "2122", + "scopes": [ + "user_impersonation" + ] + } + } +} diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..85d4fb9f75a5 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -11,7 +11,11 @@ trigger: - sdk/storage/ - sdk/storage/Azure.Storage.DataMovement/ - 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/vision/Azure.AI.Vision.ImageAnalysis/tsp-location.yaml b/sdk/vision/Azure.AI.Vision.ImageAnalysis/tsp-location.yaml index 778808fd0289..517d1992d6d2 100644 --- a/sdk/vision/Azure.AI.Vision.ImageAnalysis/tsp-location.yaml +++ b/sdk/vision/Azure.AI.Vision.ImageAnalysis/tsp-location.yaml @@ -1,4 +1,4 @@ -directory: specification/ai/ImageAnalysis/ -additionalDirectories: [] +directory: specification/ai/ImageAnalysis +commit: 216cc05a932c0770a40b19ebafd0c76a5c17809b repo: Azure/azure-rest-api-specs -commit: 462574dbd02088c209bb1da3eef0d93f699e8de2 +additionalDirectories: