From 1aab48ef65c2a193067021e7fa2b0c2c72bdb3b3 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Fri, 9 May 2025 10:17:04 +0000 Subject: [PATCH] Configurations: 'specification/purestorage/PureStorage.Block.Management/tspconfig.yaml', API Version: 2024-11-01-preview, SDK Release Type: beta, and CommitSHA: '6c18d6b7e414f9077bea45a930d07c91d6d949dc' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' --- ...Azure.ResourceManager.PureStorageBlock.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 80 + ...ResourceManager.PureStorageBlock.net8.0.cs | 1123 +++++++++++++ ...Manager.PureStorageBlock.netstandard2.0.cs | 1123 +++++++++++++ .../assets.json | 7 + ...rceManager.PureStorageBlock.Samples.csproj | 13 + .../Sample_AvsStorageContainerCollection.cs | 160 ++ .../Sample_AvsStorageContainerResource.cs | 76 + ...ple_AvsStorageContainerVolumeCollection.cs | 164 ++ ...ample_AvsStorageContainerVolumeResource.cs | 116 ++ .../Samples/Sample_AvsVmCollection.cs | 160 ++ .../Generated/Samples/Sample_AvsVmResource.cs | 113 ++ .../Samples/Sample_AvsVmVolumeCollection.cs | 164 ++ .../Samples/Sample_AvsVmVolumeResource.cs | 116 ++ .../Samples/Sample_ReservationResource.cs | 97 ++ .../Samples/Sample_StoragePoolCollection.cs | 208 +++ .../Samples/Sample_StoragePoolResource.cs | 316 ++++ .../Sample_SubscriptionResourceExtensions.cs | 50 + ...re.ResourceManager.PureStorageBlock.csproj | 8 + .../ArmPureStorageBlockModelFactory.cs | 535 +++++++ .../AvsStorageContainerCollection.cs | 395 +++++ .../AvsStorageContainerData.Serialization.cs | 155 ++ .../src/Generated/AvsStorageContainerData.cs | 75 + ...sStorageContainerResource.Serialization.cs | 26 + .../Generated/AvsStorageContainerResource.cs | 324 ++++ .../AvsStorageContainerVolumeCollection.cs | 395 +++++ ...torageContainerVolumeData.Serialization.cs | 155 ++ .../AvsStorageContainerVolumeData.cs | 75 + ...geContainerVolumeResource.Serialization.cs | 26 + .../AvsStorageContainerVolumeResource.cs | 349 ++++ .../src/Generated/AvsVmCollection.cs | 395 +++++ .../src/Generated/AvsVmData.Serialization.cs | 155 ++ .../src/Generated/AvsVmData.cs | 75 + .../Generated/AvsVmResource.Serialization.cs | 26 + .../src/Generated/AvsVmResource.cs | 417 +++++ .../src/Generated/AvsVmVolumeCollection.cs | 395 +++++ .../AvsVmVolumeData.Serialization.cs | 155 ++ .../src/Generated/AvsVmVolumeData.cs | 75 + .../AvsVmVolumeResource.Serialization.cs | 26 + .../src/Generated/AvsVmVolumeResource.cs | 349 ++++ .../MockablePureStorageBlockArmClient.cs | 109 ++ ...lePureStorageBlockResourceGroupResource.cs | 174 ++ ...blePureStorageBlockSubscriptionResource.cs | 166 ++ .../Extensions/PureStorageBlockExtensions.cs | 479 ++++++ .../src/Generated/Internal/Argument.cs | 129 ++ .../Internal/ChangeTrackingDictionary.cs | 167 ++ .../Generated/Internal/ChangeTrackingList.cs | 153 ++ .../Internal/ModelSerializationExtensions.cs | 407 +++++ .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + ...vsStorageContainerVolumeOperationSource.cs | 36 + .../AvsVmOperationSource.cs | 36 + .../AvsVmVolumeOperationSource.cs | 36 + .../PureStorageBlockArmOperation.cs | 94 ++ .../PureStorageBlockArmOperationOfT.cs | 100 ++ .../ReservationOperationSource.cs | 36 + .../StoragePoolOperationSource.cs | 36 + .../Generated/Models/Address.Serialization.cs | 176 ++ .../src/Generated/Models/Address.cs | 107 ++ .../Generated/Models/Alert.Serialization.cs | 134 ++ .../src/Generated/Models/Alert.cs | 81 + .../src/Generated/Models/AlertLevel.cs | 54 + .../Models/AvsConnection.Serialization.cs | 152 ++ .../src/Generated/Models/AvsConnection.cs | 80 + .../Models/AvsDiskDetails.Serialization.cs | 182 +++ .../src/Generated/Models/AvsDiskDetails.cs | 117 ++ .../Models/AvsStatus.Serialization.cs | 145 ++ .../src/Generated/Models/AvsStatus.cs | 85 + ...torageContainerListResult.Serialization.cs | 151 ++ .../Models/AvsStorageContainerListResult.cs | 80 + ...torageContainerProperties.Serialization.cs | 191 +++ .../Models/AvsStorageContainerProperties.cs | 88 + ...ContainerVolumeListResult.Serialization.cs | 151 ++ .../AvsStorageContainerVolumeListResult.cs | 80 + ...orageContainerVolumePatch.Serialization.cs | 133 ++ .../Models/AvsStorageContainerVolumePatch.cs | 76 + ...nerVolumeUpdateProperties.Serialization.cs | 133 ++ ...sStorageContainerVolumeUpdateProperties.cs | 65 + .../Models/AvsVmDetails.Serialization.cs | 150 ++ .../src/Generated/Models/AvsVmDetails.cs | 95 ++ .../Models/AvsVmListResult.Serialization.cs | 151 ++ .../src/Generated/Models/AvsVmListResult.cs | 80 + .../Models/AvsVmPatch.Serialization.cs | 133 ++ .../src/Generated/Models/AvsVmPatch.cs | 76 + .../Models/AvsVmProperties.Serialization.cs | 247 +++ .../src/Generated/Models/AvsVmProperties.cs | 97 ++ .../AvsVmUpdateProperties.Serialization.cs | 133 ++ .../Generated/Models/AvsVmUpdateProperties.cs | 65 + .../AvsVmVolumeListResult.Serialization.cs | 151 ++ .../Generated/Models/AvsVmVolumeListResult.cs | 80 + .../Models/AvsVmVolumePatch.Serialization.cs | 133 ++ .../src/Generated/Models/AvsVmVolumePatch.cs | 76 + ...sVmVolumeUpdateProperties.Serialization.cs | 133 ++ .../Models/AvsVmVolumeUpdateProperties.cs | 65 + ...eResourceManagerPureStorageBlockContext.cs | 19 + .../AzureVmwareService.Serialization.cs | 137 ++ .../Generated/Models/AzureVmwareService.cs | 76 + .../Models/BandwidthUsage.Serialization.cs | 142 ++ .../src/Generated/Models/BandwidthUsage.cs | 84 + .../BillingUsageProperty.Serialization.cs | 205 +++ .../Generated/Models/BillingUsageProperty.cs | 108 ++ .../Models/CompanyDetails.Serialization.cs | 141 ++ .../src/Generated/Models/CompanyDetails.cs | 79 + .../Models/HealthDetails.Serialization.cs | 173 ++ .../src/Generated/Models/HealthDetails.cs | 107 ++ .../Models/IopsUsage.Serialization.cs | 142 ++ .../src/Generated/Models/IopsUsage.cs | 84 + .../Models/LimitDetails.Serialization.cs | 150 ++ .../src/Generated/Models/LimitDetails.cs | 102 ++ .../MarketplaceDetails.Serialization.cs | 152 ++ .../Generated/Models/MarketplaceDetails.cs | 83 + .../Models/MarketplaceSubscriptionStatus.cs | 57 + .../Models/OfferDetails.Serialization.cs | 182 +++ .../src/Generated/Models/OfferDetails.cs | 101 ++ .../PerformancePolicyLimits.Serialization.cs | 134 ++ .../Models/PerformancePolicyLimits.cs | 82 + .../ProtectionPolicyLimits.Serialization.cs | 134 ++ .../Models/ProtectionPolicyLimits.cs | 82 + .../src/Generated/Models/ProvisioningState.cs | 60 + .../Models/RangeLimits.Serialization.cs | 134 ++ .../src/Generated/Models/RangeLimits.cs | 78 + .../ReservationBillingStatus.Serialization.cs | 245 +++ .../Models/ReservationBillingStatus.cs | 153 ++ ...rvationBillingUsageReport.Serialization.cs | 152 ++ .../Models/ReservationBillingUsageReport.cs | 90 ++ .../ReservationListResult.Serialization.cs | 151 ++ .../Generated/Models/ReservationListResult.cs | 80 + .../Models/ReservationPatch.Serialization.cs | 159 ++ .../src/Generated/Models/ReservationPatch.cs | 81 + ...iesBaseResourceProperties.Serialization.cs | 160 ++ ...rvationPropertiesBaseResourceProperties.cs | 90 ++ ...servationUpdateProperties.Serialization.cs | 133 ++ .../Models/ReservationUpdateProperties.cs | 65 + .../Models/ResourceProvisioningState.cs | 54 + ...rviceInitializationHandle.Serialization.cs | 140 ++ .../Models/ServiceInitializationHandle.cs | 69 + ...ServiceInitializationInfo.Serialization.cs | 162 ++ .../Models/ServiceInitializationInfo.cs | 77 + .../Models/SoftDeletion.Serialization.cs | 137 ++ .../src/Generated/Models/SoftDeletion.cs | 76 + .../Generated/Models/Space.Serialization.cs | 150 ++ .../src/Generated/Models/Space.cs | 90 ++ ...olEnableAvsConnectionPost.Serialization.cs | 126 ++ .../StoragePoolEnableAvsConnectionPost.cs | 75 + ...FinalizeAvsConnectionPost.Serialization.cs | 144 ++ .../StoragePoolFinalizeAvsConnectionPost.cs | 69 + .../StoragePoolHealthInfo.Serialization.cs | 144 ++ .../Generated/Models/StoragePoolHealthInfo.cs | 83 + .../Models/StoragePoolLimits.Serialization.cs | 152 ++ .../src/Generated/Models/StoragePoolLimits.cs | 90 ++ .../StoragePoolListResult.Serialization.cs | 151 ++ .../Generated/Models/StoragePoolListResult.cs | 80 + .../Models/StoragePoolPatch.Serialization.cs | 177 ++ .../src/Generated/Models/StoragePoolPatch.cs | 86 + .../StoragePoolProperties.Serialization.cs | 231 +++ .../Generated/Models/StoragePoolProperties.cs | 115 ++ ...oragePoolUpdateProperties.Serialization.cs | 133 ++ .../Models/StoragePoolUpdateProperties.cs | 65 + .../src/Generated/Models/UsageSeverity.cs | 57 + .../Models/UserDetails.Serialization.cs | 186 +++ .../src/Generated/Models/UserDetails.cs | 101 ++ .../src/Generated/Models/VmType.cs | 48 + .../Models/VnetInjection.Serialization.cs | 134 ++ .../src/Generated/Models/VnetInjection.cs | 82 + .../Generated/Models/VolumeContainerType.cs | 48 + .../Models/VolumeLimits.Serialization.cs | 126 ++ .../src/Generated/Models/VolumeLimits.cs | 75 + .../Models/VolumeProperties.Serialization.cs | 268 ++++ .../src/Generated/Models/VolumeProperties.cs | 115 ++ .../src/Generated/Models/VolumeType.cs | 48 + .../src/Generated/ProviderConstants.cs | 16 + .../src/Generated/ReservationCollection.cs | 494 ++++++ .../ReservationData.Serialization.cs | 178 ++ .../src/Generated/ReservationData.cs | 83 + .../ReservationResource.Serialization.cs | 26 + .../src/Generated/ReservationResource.cs | 935 +++++++++++ ...vsStorageContainerVolumesRestOperations.cs | 549 +++++++ .../AvsStorageContainersRestOperations.cs | 413 +++++ .../AvsVmVolumesRestOperations.cs | 549 +++++++ .../RestOperations/AvsVmsRestOperations.cs | 513 ++++++ .../ReservationsRestOperations.cs | 1005 ++++++++++++ .../StoragePoolsRestOperations.cs | 1357 ++++++++++++++++ .../src/Generated/StoragePoolCollection.cs | 494 ++++++ .../StoragePoolData.Serialization.cs | 196 +++ .../src/Generated/StoragePoolData.cs | 87 + .../StoragePoolResource.Serialization.cs | 26 + .../src/Generated/StoragePoolResource.cs | 1425 +++++++++++++++++ .../src/Properties/AssemblyInfo.cs | 11 + ...ourceManager.PureStorageBlock.Tests.csproj | 8 + .../PureStorageBlockManagementTestBase.cs | 45 + ...reStorageBlockManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 4 + sdk/purestorageblock/ci.mgmt.yml | 26 + sdk/resourcemanager/ci.mgmt.yml | 2 + sdk/storage/ci.yml | 2 + 197 files changed, 32541 insertions(+) create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/Azure.ResourceManager.PureStorageBlock.sln create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/CHANGELOG.md create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/Directory.Build.props create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/README.md create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/api/Azure.ResourceManager.PureStorageBlock.net8.0.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/api/Azure.ResourceManager.PureStorageBlock.netstandard2.0.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/assets.json create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Azure.ResourceManager.PureStorageBlock.Samples.csproj create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerCollection.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerResource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerVolumeCollection.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerVolumeResource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmCollection.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmResource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmVolumeCollection.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmVolumeResource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_ReservationResource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_StoragePoolCollection.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_StoragePoolResource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Azure.ResourceManager.PureStorageBlock.csproj create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ArmPureStorageBlockModelFactory.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerCollection.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerData.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerData.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerResource.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerResource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeCollection.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeData.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeData.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeResource.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeResource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmCollection.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmData.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmData.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmResource.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmResource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeCollection.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeData.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeData.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeResource.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeResource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/MockablePureStorageBlockArmClient.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/MockablePureStorageBlockResourceGroupResource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/MockablePureStorageBlockSubscriptionResource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/PureStorageBlockExtensions.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/Argument.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/Optional.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/AvsStorageContainerVolumeOperationSource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/AvsVmOperationSource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/AvsVmVolumeOperationSource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/PureStorageBlockArmOperation.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/PureStorageBlockArmOperationOfT.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/ReservationOperationSource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/StoragePoolOperationSource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Address.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Address.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Alert.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Alert.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AlertLevel.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsConnection.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsConnection.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsDiskDetails.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsDiskDetails.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStatus.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStatus.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerListResult.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerListResult.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerProperties.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerProperties.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeListResult.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeListResult.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumePatch.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumePatch.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeUpdateProperties.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeUpdateProperties.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmDetails.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmDetails.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmListResult.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmListResult.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmPatch.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmPatch.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmProperties.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmProperties.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmUpdateProperties.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmUpdateProperties.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeListResult.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeListResult.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumePatch.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumePatch.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeUpdateProperties.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeUpdateProperties.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AzureResourceManagerPureStorageBlockContext.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AzureVmwareService.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AzureVmwareService.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BandwidthUsage.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BandwidthUsage.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BillingUsageProperty.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BillingUsageProperty.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/CompanyDetails.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/CompanyDetails.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/HealthDetails.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/HealthDetails.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/IopsUsage.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/IopsUsage.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/LimitDetails.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/LimitDetails.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/MarketplaceDetails.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/MarketplaceDetails.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/MarketplaceSubscriptionStatus.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/OfferDetails.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/OfferDetails.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/PerformancePolicyLimits.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/PerformancePolicyLimits.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ProtectionPolicyLimits.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ProtectionPolicyLimits.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ProvisioningState.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/RangeLimits.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/RangeLimits.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingStatus.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingStatus.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingUsageReport.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingUsageReport.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationListResult.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationListResult.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPatch.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPatch.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPropertiesBaseResourceProperties.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPropertiesBaseResourceProperties.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationUpdateProperties.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationUpdateProperties.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ResourceProvisioningState.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationHandle.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationHandle.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationInfo.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationInfo.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/SoftDeletion.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/SoftDeletion.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Space.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Space.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolEnableAvsConnectionPost.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolEnableAvsConnectionPost.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolFinalizeAvsConnectionPost.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolFinalizeAvsConnectionPost.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolHealthInfo.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolHealthInfo.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolLimits.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolLimits.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolListResult.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolListResult.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolPatch.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolPatch.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolProperties.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolProperties.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolUpdateProperties.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolUpdateProperties.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/UsageSeverity.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/UserDetails.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/UserDetails.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VmType.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VnetInjection.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VnetInjection.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeContainerType.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeLimits.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeLimits.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeProperties.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeProperties.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeType.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ProviderConstants.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationCollection.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationData.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationData.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationResource.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationResource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsStorageContainerVolumesRestOperations.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsStorageContainersRestOperations.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsVmVolumesRestOperations.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsVmsRestOperations.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/ReservationsRestOperations.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/StoragePoolsRestOperations.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolCollection.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolData.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolData.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolResource.Serialization.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolResource.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Properties/AssemblyInfo.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tests/Azure.ResourceManager.PureStorageBlock.Tests.csproj create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tests/PureStorageBlockManagementTestBase.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tests/PureStorageBlockManagementTestEnvironment.cs create mode 100644 sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tsp-location.yaml create mode 100644 sdk/purestorageblock/ci.mgmt.yml diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/Azure.ResourceManager.PureStorageBlock.sln b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/Azure.ResourceManager.PureStorageBlock.sln new file mode 100644 index 000000000000..70e40fe181ae --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/Azure.ResourceManager.PureStorageBlock.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.PureStorageBlock.Samples", "samples\Azure.ResourceManager.PureStorageBlock.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.PureStorageBlock", "src\Azure.ResourceManager.PureStorageBlock.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.PureStorageBlock.Tests", "tests\Azure.ResourceManager.PureStorageBlock.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/purestorageblock/Azure.ResourceManager.PureStorageBlock/CHANGELOG.md b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/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/purestorageblock/Azure.ResourceManager.PureStorageBlock/Directory.Build.props b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/README.md b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/README.md new file mode 100644 index 000000000000..d258df3e7bf9 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure PureStorageBlock 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 PureStorageBlock management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.PureStorageBlock --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/purestorageblock/Azure.ResourceManager.PureStorageBlock/api/Azure.ResourceManager.PureStorageBlock.net8.0.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/api/Azure.ResourceManager.PureStorageBlock.net8.0.cs new file mode 100644 index 000000000000..e7ac19f72ee3 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/api/Azure.ResourceManager.PureStorageBlock.net8.0.cs @@ -0,0 +1,1123 @@ +namespace Azure.ResourceManager.PureStorageBlock +{ + public partial class AvsStorageContainerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AvsStorageContainerCollection() { } + public virtual Azure.Response Exists(string storageContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string storageContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string storageContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string storageContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string storageContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string storageContainerName, 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 AvsStorageContainerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsStorageContainerData() { } + public Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsStorageContainerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsStorageContainerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsStorageContainerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AvsStorageContainerResource() { } + public virtual Azure.ResourceManager.PureStorageBlock.AvsStorageContainerData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName) { 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 GetAvsStorageContainerVolume(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAvsStorageContainerVolumeAsync(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeCollection GetAvsStorageContainerVolumes() { throw null; } + Azure.ResourceManager.PureStorageBlock.AvsStorageContainerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsStorageContainerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsStorageContainerVolumeCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AvsStorageContainerVolumeCollection() { } + public virtual Azure.Response Exists(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string volumeId, 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 AvsStorageContainerVolumeData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsStorageContainerVolumeData() { } + public Azure.ResourceManager.PureStorageBlock.Models.VolumeProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsStorageContainerVolumeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AvsStorageContainerVolumeResource() { } + public virtual Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName, string volumeId) { 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.PureStorageBlock.AvsStorageContainerVolumeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.PureStorageBlock.Models.AvsStorageContainerVolumePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerVolumePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AvsVmCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AvsVmCollection() { } + public virtual Azure.Response Exists(string avsVmId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string avsVmId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string avsVmId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string avsVmId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string avsVmId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string avsVmId, 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 AvsVmData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsVmData() { } + public Azure.ResourceManager.PureStorageBlock.Models.AvsVmProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsVmData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsVmData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsVmResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AvsVmResource() { } + public virtual Azure.ResourceManager.PureStorageBlock.AvsVmData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId) { 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 GetAvsVmVolume(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAvsVmVolumeAsync(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.AvsVmVolumeCollection GetAvsVmVolumes() { throw null; } + Azure.ResourceManager.PureStorageBlock.AvsVmData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsVmData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.PureStorageBlock.Models.AvsVmPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.AvsVmPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AvsVmVolumeCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AvsVmVolumeCollection() { } + public virtual Azure.Response Exists(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string volumeId, 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 AvsVmVolumeData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsVmVolumeData() { } + public Azure.ResourceManager.PureStorageBlock.Models.VolumeProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsVmVolumeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsVmVolumeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsVmVolumeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AvsVmVolumeResource() { } + public virtual Azure.ResourceManager.PureStorageBlock.AvsVmVolumeData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, string volumeId) { 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.PureStorageBlock.AvsVmVolumeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsVmVolumeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.PureStorageBlock.Models.AvsVmVolumePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.AvsVmVolumePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AzureResourceManagerPureStorageBlockContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerPureStorageBlockContext() { } + public static Azure.ResourceManager.PureStorageBlock.AzureResourceManagerPureStorageBlockContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } + public static partial class PureStorageBlockExtensions + { + public static Azure.ResourceManager.PureStorageBlock.AvsStorageContainerResource GetAvsStorageContainerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeResource GetAvsStorageContainerVolumeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.AvsVmResource GetAvsVmResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.AvsVmVolumeResource GetAvsVmVolumeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetReservation(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetReservationAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.ReservationResource GetReservationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.ReservationCollection GetReservations(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetReservations(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetReservationsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetStoragePool(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetStoragePoolAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.StoragePoolResource GetStoragePoolResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.StoragePoolCollection GetStoragePools(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetStoragePools(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetStoragePoolsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ReservationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ReservationCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string reservationName, Azure.ResourceManager.PureStorageBlock.ReservationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string reservationName, Azure.ResourceManager.PureStorageBlock.ReservationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string reservationName, 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 ReservationData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReservationData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.PureStorageBlock.Models.ReservationPropertiesBaseResourceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.ReservationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.ReservationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReservationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ReservationResource() { } + public virtual Azure.ResourceManager.PureStorageBlock.ReservationData 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 reservationName) { 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 GetBillingReport(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBillingReportAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBillingStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBillingStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetResourceLimits(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetResourceLimitsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.PureStorageBlock.ReservationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.ReservationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.PureStorageBlock.Models.ReservationPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.ReservationPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class StoragePoolCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected StoragePoolCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string storagePoolName, Azure.ResourceManager.PureStorageBlock.StoragePoolData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string storagePoolName, Azure.ResourceManager.PureStorageBlock.StoragePoolData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string storagePoolName, 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 StoragePoolData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StoragePoolData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.PureStorageBlock.Models.StoragePoolProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.StoragePoolData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.StoragePoolData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StoragePoolResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected StoragePoolResource() { } + public virtual Azure.ResourceManager.PureStorageBlock.StoragePoolData 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 storagePoolName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation DisableAvsConnection(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DisableAvsConnectionAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation EnableAvsConnection(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.StoragePoolEnableAvsConnectionPost properties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task EnableAvsConnectionAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.StoragePoolEnableAvsConnectionPost properties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation FinalizeAvsConnection(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.StoragePoolFinalizeAvsConnectionPost properties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task FinalizeAvsConnectionAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.StoragePoolFinalizeAvsConnectionPost properties, 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 GetAvsConnection(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAvsConnectionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAvsStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAvsStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAvsStorageContainer(string storageContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAvsStorageContainerAsync(string storageContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.AvsStorageContainerCollection GetAvsStorageContainers() { throw null; } + public virtual Azure.Response GetAvsVm(string avsVmId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAvsVmAsync(string avsVmId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.AvsVmCollection GetAvsVms() { throw null; } + public virtual Azure.Response GetHealthStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetHealthStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation RepairAvsConnection(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RepairAvsConnectionAsync(Azure.WaitUntil waitUntil, 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.PureStorageBlock.StoragePoolData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.StoragePoolData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.PureStorageBlock.Models.StoragePoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.StoragePoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.PureStorageBlock.Mocking +{ + public partial class MockablePureStorageBlockArmClient : Azure.ResourceManager.ArmResource + { + protected MockablePureStorageBlockArmClient() { } + public virtual Azure.ResourceManager.PureStorageBlock.AvsStorageContainerResource GetAvsStorageContainerResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeResource GetAvsStorageContainerVolumeResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.AvsVmResource GetAvsVmResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.AvsVmVolumeResource GetAvsVmVolumeResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.ReservationResource GetReservationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.StoragePoolResource GetStoragePoolResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockablePureStorageBlockResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockablePureStorageBlockResourceGroupResource() { } + public virtual Azure.Response GetReservation(string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetReservationAsync(string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.ReservationCollection GetReservations() { throw null; } + public virtual Azure.Response GetStoragePool(string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetStoragePoolAsync(string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.StoragePoolCollection GetStoragePools() { throw null; } + } + public partial class MockablePureStorageBlockSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockablePureStorageBlockSubscriptionResource() { } + public virtual Azure.Pageable GetReservations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetReservationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetStoragePools(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetStoragePoolsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class Address : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Address(string addressLine1, string city, string state, string country, string postalCode) { } + public string AddressLine1 { get { throw null; } set { } } + public string AddressLine2 { get { throw null; } set { } } + public string City { get { throw null; } set { } } + public string Country { get { throw null; } set { } } + public string PostalCode { get { throw null; } set { } } + public string State { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.Address System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.Address System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class Alert : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal Alert() { } + public Azure.ResourceManager.PureStorageBlock.Models.AlertLevel Level { get { throw null; } } + public string Message { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.Alert System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.Alert System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AlertLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AlertLevel(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AlertLevel Error { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.AlertLevel Info { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.AlertLevel Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.AlertLevel 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.PureStorageBlock.Models.AlertLevel left, Azure.ResourceManager.PureStorageBlock.Models.AlertLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.AlertLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.AlertLevel left, Azure.ResourceManager.PureStorageBlock.Models.AlertLevel right) { throw null; } + public override string ToString() { throw null; } + } + public static partial class ArmPureStorageBlockModelFactory + { + public static Azure.ResourceManager.PureStorageBlock.Models.Alert Alert(Azure.ResourceManager.PureStorageBlock.Models.AlertLevel level = default(Azure.ResourceManager.PureStorageBlock.Models.AlertLevel), string message = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AvsConnection AvsConnection(bool serviceInitializationCompleted = false, string serviceInitializationHandleEnc = null, Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationHandle serviceInitializationHandle = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AvsDiskDetails AvsDiskDetails(string diskId = null, string diskName = null, string folder = null, string avsVmInternalId = null, string avsVmResourceId = null, string avsVmName = null, string avsStorageContainerResourceId = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AvsStatus AvsStatus(bool avsEnabled = false, string currentConnectionStatus = null, string clusterResourceId = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.AvsStorageContainerData AvsStorageContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerProperties properties = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerProperties AvsStorageContainerProperties(Azure.ResourceManager.PureStorageBlock.Models.Space space = null, string resourceName = null, long? provisionedLimit = default(long?), string datastore = null, bool? mounted = default(bool?)) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeData AvsStorageContainerVolumeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.PureStorageBlock.Models.VolumeProperties properties = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.AvsVmData AvsVmData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.PureStorageBlock.Models.AvsVmProperties properties = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AvsVmDetails AvsVmDetails(string vmId = null, string vmName = null, Azure.ResourceManager.PureStorageBlock.Models.VmType vmType = default(Azure.ResourceManager.PureStorageBlock.Models.VmType), string avsVmInternalId = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AvsVmProperties AvsVmProperties(string storagePoolInternalId = null, string storagePoolResourceId = null, string displayName = null, string createdTimestamp = null, Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion softDeletion = null, Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType? volumeContainerType = default(Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType?), Azure.ResourceManager.PureStorageBlock.Models.AvsVmDetails avs = null, Azure.ResourceManager.PureStorageBlock.Models.Space space = null, Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState?)) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.AvsVmVolumeData AvsVmVolumeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.PureStorageBlock.Models.VolumeProperties properties = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AzureVmwareService AzureVmwareService(bool avsEnabled = false, string clusterResourceId = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.BandwidthUsage BandwidthUsage(long current = (long)0, long provisioned = (long)0, long max = (long)0) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.BillingUsageProperty BillingUsageProperty(string propertyId = null, string propertyName = null, string currentValue = null, string previousValue = null, Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity severity = default(Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity), string statusMessage = null, System.Collections.Generic.IEnumerable subProperties = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.HealthDetails HealthDetails(double usedCapacityPercentage = 0, Azure.ResourceManager.PureStorageBlock.Models.BandwidthUsage bandwidthUsage = null, Azure.ResourceManager.PureStorageBlock.Models.IopsUsage iopsUsage = null, Azure.ResourceManager.PureStorageBlock.Models.Space space = null, double dataReductionRatio = 0, long estimatedMaxCapacity = (long)0) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.IopsUsage IopsUsage(long current = (long)0, long provisioned = (long)0, long max = (long)0) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.LimitDetails LimitDetails(Azure.ResourceManager.PureStorageBlock.Models.StoragePoolLimits storagePool = null, Azure.ResourceManager.PureStorageBlock.Models.RangeLimits volumeProvisionedSize = null, Azure.ResourceManager.PureStorageBlock.Models.ProtectionPolicyLimits protectionPolicy = null, Azure.ResourceManager.PureStorageBlock.Models.PerformancePolicyLimits performancePolicy = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.MarketplaceDetails MarketplaceDetails(string subscriptionId = null, Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus? subscriptionStatus = default(Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus?), Azure.ResourceManager.PureStorageBlock.Models.OfferDetails offerDetails = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.PerformancePolicyLimits PerformancePolicyLimits(Azure.ResourceManager.PureStorageBlock.Models.RangeLimits iopsLimit = null, Azure.ResourceManager.PureStorageBlock.Models.RangeLimits bandwidthLimit = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.ProtectionPolicyLimits ProtectionPolicyLimits(Azure.ResourceManager.PureStorageBlock.Models.RangeLimits frequency = null, Azure.ResourceManager.PureStorageBlock.Models.RangeLimits retention = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.RangeLimits RangeLimits(long min = (long)0, long max = (long)0) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.ReservationBillingStatus ReservationBillingStatus(string timestamp = null, long totalUsedCapacityReported = (long)0, int lowDrrPoolCount = 0, double drrWeightedAverage = 0, long totalNonReducibleReported = (long)0, long extraUsedCapacityNonReducible = (long)0, long extraUsedCapacityLowUsageRounding = (long)0, long extraUsedCapacityNonReduciblePlanDiscount = (long)0, long totalUsedCapacityBilled = (long)0, long totalUsedCapacityIncludedPlan = (long)0, long totalUsedCapacityOverage = (long)0, long totalPerformanceReported = (long)0, long totalPerformanceIncludedPlan = (long)0, long totalPerformanceOverage = (long)0) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.ReservationBillingUsageReport ReservationBillingUsageReport(string timestamp = null, System.Collections.Generic.IEnumerable billingUsageProperties = null, string overallStatusMessage = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.ReservationData ReservationData(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.PureStorageBlock.Models.ReservationPropertiesBaseResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.ReservationPropertiesBaseResourceProperties ReservationPropertiesBaseResourceProperties(string reservationInternalId = null, Azure.ResourceManager.PureStorageBlock.Models.MarketplaceDetails marketplace = null, Azure.ResourceManager.PureStorageBlock.Models.UserDetails user = null, Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationHandle ServiceInitializationHandle(string clusterResourceId = null, string serviceAccountUsername = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion SoftDeletion(bool destroyed = false, string eradicationTimestamp = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.Space Space(long totalUsed = (long)0, long unique = (long)0, long snapshots = (long)0, long shared = (long)0) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.StoragePoolData StoragePoolData(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.PureStorageBlock.Models.StoragePoolProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.StoragePoolHealthInfo StoragePoolHealthInfo(Azure.ResourceManager.PureStorageBlock.Models.HealthDetails health = null, System.Collections.Generic.IEnumerable alerts = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.StoragePoolLimits StoragePoolLimits(Azure.ResourceManager.PureStorageBlock.Models.RangeLimits provisionedBandwidthMbPerSec = null, Azure.ResourceManager.PureStorageBlock.Models.RangeLimits provisionedIops = null, System.Collections.Generic.IEnumerable physicalAvailabilityZones = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.StoragePoolProperties StoragePoolProperties(string storagePoolInternalId = null, string availabilityZone = null, Azure.ResourceManager.PureStorageBlock.Models.VnetInjection vnetInjection = null, long? dataRetentionPeriod = default(long?), long provisionedBandwidthMbPerSec = (long)0, long? provisionedIops = default(long?), Azure.ResourceManager.PureStorageBlock.Models.AzureVmwareService avs = null, Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState?), string reservationResourceId = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.VolumeProperties VolumeProperties(string storagePoolInternalId = null, string storagePoolResourceId = null, string volumeInternalId = null, string displayName = null, Azure.ResourceManager.PureStorageBlock.Models.Space space = null, Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion softDeletion = null, string createdTimestamp = null, long? provisionedSize = default(long?), Azure.ResourceManager.PureStorageBlock.Models.VolumeType? volumeType = default(Azure.ResourceManager.PureStorageBlock.Models.VolumeType?), Azure.ResourceManager.PureStorageBlock.Models.AvsDiskDetails avs = null, Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState?)) { throw null; } + } + public partial class AvsConnection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsConnection() { } + public bool ServiceInitializationCompleted { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationHandle ServiceInitializationHandle { get { throw null; } } + public string ServiceInitializationHandleEnc { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsConnection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsConnection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsDiskDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsDiskDetails() { } + public string AvsStorageContainerResourceId { get { throw null; } } + public string AvsVmInternalId { get { throw null; } } + public string AvsVmName { get { throw null; } } + public string AvsVmResourceId { get { throw null; } } + public string DiskId { get { throw null; } } + public string DiskName { get { throw null; } } + public string Folder { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsDiskDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsDiskDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsStatus() { } + public bool AvsEnabled { get { throw null; } } + public string ClusterResourceId { get { throw null; } } + public string CurrentConnectionStatus { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsStorageContainerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsStorageContainerProperties() { } + public string Datastore { get { throw null; } } + public bool? Mounted { get { throw null; } } + public long? ProvisionedLimit { get { throw null; } } + public string ResourceName { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.Space Space { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsStorageContainerVolumePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AvsStorageContainerVolumePatch() { } + public Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion AvsStorageContainerVolumeUpdateSoftDeletion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerVolumePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerVolumePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsVmDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsVmDetails() { } + public string AvsVmInternalId { get { throw null; } } + public string VmId { get { throw null; } } + public string VmName { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.VmType VmType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsVmPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AvsVmPatch() { } + public Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion AvsVmUpdateSoftDeletion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsVmProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsVmProperties() { } + public Azure.ResourceManager.PureStorageBlock.Models.AvsVmDetails Avs { get { throw null; } } + public string CreatedTimestamp { get { throw null; } } + public string DisplayName { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion SoftDeletion { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.Space Space { get { throw null; } } + public string StoragePoolInternalId { get { throw null; } } + public string StoragePoolResourceId { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType? VolumeContainerType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsVmVolumePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AvsVmVolumePatch() { } + public Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion AvsVmVolumeUpdateSoftDeletion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmVolumePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmVolumePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzureVmwareService : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AzureVmwareService() { } + public bool AvsEnabled { get { throw null; } } + public string ClusterResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AzureVmwareService System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AzureVmwareService System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BandwidthUsage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal BandwidthUsage() { } + public long Current { get { throw null; } } + public long Max { get { throw null; } } + public long Provisioned { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.BandwidthUsage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.BandwidthUsage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BillingUsageProperty : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal BillingUsageProperty() { } + public string CurrentValue { get { throw null; } } + public string PreviousValue { get { throw null; } } + public string PropertyId { get { throw null; } } + public string PropertyName { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity Severity { get { throw null; } } + public string StatusMessage { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SubProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.BillingUsageProperty System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.BillingUsageProperty System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CompanyDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CompanyDetails(string companyName) { } + public Azure.ResourceManager.PureStorageBlock.Models.Address Address { get { throw null; } set { } } + public string CompanyName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.CompanyDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.CompanyDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HealthDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HealthDetails() { } + public Azure.ResourceManager.PureStorageBlock.Models.BandwidthUsage BandwidthUsage { get { throw null; } } + public double DataReductionRatio { get { throw null; } } + public long EstimatedMaxCapacity { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.IopsUsage IopsUsage { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.Space Space { get { throw null; } } + public double UsedCapacityPercentage { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.HealthDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.HealthDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IopsUsage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal IopsUsage() { } + public long Current { get { throw null; } } + public long Max { get { throw null; } } + public long Provisioned { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.IopsUsage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.IopsUsage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LimitDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal LimitDetails() { } + public Azure.ResourceManager.PureStorageBlock.Models.PerformancePolicyLimits PerformancePolicy { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.ProtectionPolicyLimits ProtectionPolicy { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.StoragePoolLimits StoragePool { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.RangeLimits VolumeProvisionedSize { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.LimitDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.LimitDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MarketplaceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MarketplaceDetails(Azure.ResourceManager.PureStorageBlock.Models.OfferDetails offerDetails) { } + public Azure.ResourceManager.PureStorageBlock.Models.OfferDetails OfferDetails { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus? SubscriptionStatus { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.MarketplaceDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.MarketplaceDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 MarketplaceSubscriptionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MarketplaceSubscriptionStatus(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus PendingFulfillmentStart { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus Subscribed { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus Suspended { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus Unsubscribed { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus 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.PureStorageBlock.Models.MarketplaceSubscriptionStatus left, Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus left, Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OfferDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OfferDetails(string publisherId, string offerId, string planId) { } + public string OfferId { get { throw null; } set { } } + public string PlanId { get { throw null; } set { } } + public string PlanName { get { throw null; } set { } } + public string PublisherId { get { throw null; } set { } } + public string TermId { get { throw null; } set { } } + public string TermUnit { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.OfferDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.OfferDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PerformancePolicyLimits : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PerformancePolicyLimits() { } + public Azure.ResourceManager.PureStorageBlock.Models.RangeLimits BandwidthLimit { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.RangeLimits IopsLimit { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.PerformancePolicyLimits System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.PerformancePolicyLimits System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProtectionPolicyLimits : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProtectionPolicyLimits() { } + public Azure.ResourceManager.PureStorageBlock.Models.RangeLimits Frequency { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.RangeLimits Retention { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ProtectionPolicyLimits System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ProtectionPolicyLimits System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState left, Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState left, Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RangeLimits : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RangeLimits() { } + public long Max { get { throw null; } } + public long Min { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.RangeLimits System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.RangeLimits System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReservationBillingStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ReservationBillingStatus() { } + public double DrrWeightedAverage { get { throw null; } } + public long ExtraUsedCapacityLowUsageRounding { get { throw null; } } + public long ExtraUsedCapacityNonReducible { get { throw null; } } + public long ExtraUsedCapacityNonReduciblePlanDiscount { get { throw null; } } + public int LowDrrPoolCount { get { throw null; } } + public string Timestamp { get { throw null; } } + public long TotalNonReducibleReported { get { throw null; } } + public long TotalPerformanceIncludedPlan { get { throw null; } } + public long TotalPerformanceOverage { get { throw null; } } + public long TotalPerformanceReported { get { throw null; } } + public long TotalUsedCapacityBilled { get { throw null; } } + public long TotalUsedCapacityIncludedPlan { get { throw null; } } + public long TotalUsedCapacityOverage { get { throw null; } } + public long TotalUsedCapacityReported { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ReservationBillingStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ReservationBillingStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReservationBillingUsageReport : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ReservationBillingUsageReport() { } + public System.Collections.Generic.IReadOnlyList BillingUsageProperties { get { throw null; } } + public string OverallStatusMessage { get { throw null; } } + public string Timestamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ReservationBillingUsageReport System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ReservationBillingUsageReport System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReservationPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReservationPatch() { } + public Azure.ResourceManager.PureStorageBlock.Models.UserDetails ReservationUpdateUser { 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.PureStorageBlock.Models.ReservationPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ReservationPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReservationPropertiesBaseResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReservationPropertiesBaseResourceProperties(Azure.ResourceManager.PureStorageBlock.Models.MarketplaceDetails marketplace, Azure.ResourceManager.PureStorageBlock.Models.UserDetails user) { } + public Azure.ResourceManager.PureStorageBlock.Models.MarketplaceDetails Marketplace { get { throw null; } set { } } + public Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ReservationInternalId { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.UserDetails User { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ReservationPropertiesBaseResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ReservationPropertiesBaseResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResourceProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState left, Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState left, Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ServiceInitializationHandle : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ServiceInitializationHandle() { } + public string ClusterResourceId { get { throw null; } } + public string ServiceAccountUsername { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationHandle System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationHandle System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServiceInitializationInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServiceInitializationInfo() { } + public string ServiceAccountPassword { get { throw null; } set { } } + public string ServiceAccountUsername { get { throw null; } set { } } + public string VSphereCertificate { get { throw null; } set { } } + public string VSphereIP { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SoftDeletion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SoftDeletion(bool destroyed) { } + public bool Destroyed { get { throw null; } set { } } + public string EradicationTimestamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class Space : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal Space() { } + public long Shared { get { throw null; } } + public long Snapshots { get { throw null; } } + public long TotalUsed { get { throw null; } } + public long Unique { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.Space System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.Space System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StoragePoolEnableAvsConnectionPost : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StoragePoolEnableAvsConnectionPost(string clusterResourceId) { } + public string ClusterResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolEnableAvsConnectionPost System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolEnableAvsConnectionPost System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StoragePoolFinalizeAvsConnectionPost : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StoragePoolFinalizeAvsConnectionPost() { } + public Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationInfo ServiceInitializationData { get { throw null; } set { } } + public string ServiceInitializationDataEnc { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolFinalizeAvsConnectionPost System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolFinalizeAvsConnectionPost System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StoragePoolHealthInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal StoragePoolHealthInfo() { } + public System.Collections.Generic.IReadOnlyList Alerts { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.HealthDetails Health { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolHealthInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolHealthInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StoragePoolLimits : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal StoragePoolLimits() { } + public System.Collections.Generic.IReadOnlyList PhysicalAvailabilityZones { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.RangeLimits ProvisionedBandwidthMbPerSec { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.RangeLimits ProvisionedIops { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolLimits System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolLimits System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StoragePoolPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StoragePoolPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public long? StoragePoolUpdateProvisionedBandwidthMbPerSec { 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.PureStorageBlock.Models.StoragePoolPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StoragePoolProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StoragePoolProperties(string availabilityZone, Azure.ResourceManager.PureStorageBlock.Models.VnetInjection vnetInjection, long provisionedBandwidthMbPerSec, string reservationResourceId) { } + public string AvailabilityZone { get { throw null; } set { } } + public Azure.ResourceManager.PureStorageBlock.Models.AzureVmwareService Avs { get { throw null; } } + public long? DataRetentionPeriod { get { throw null; } } + public long ProvisionedBandwidthMbPerSec { get { throw null; } set { } } + public long? ProvisionedIops { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ReservationResourceId { get { throw null; } set { } } + public string StoragePoolInternalId { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.VnetInjection VnetInjection { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 UsageSeverity : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public UsageSeverity(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity ALERT { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity INFORMATION { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity NONE { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity WARNING { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity 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.PureStorageBlock.Models.UsageSeverity left, Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity left, Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UserDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UserDetails(string firstName, string lastName, string emailAddress) { } + public Azure.ResourceManager.PureStorageBlock.Models.CompanyDetails CompanyDetails { get { throw null; } set { } } + public string EmailAddress { get { throw null; } set { } } + public string FirstName { get { throw null; } set { } } + public string LastName { get { throw null; } set { } } + public string PhoneNumber { get { throw null; } set { } } + public string Upn { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.UserDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.UserDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 VmType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VmType(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.VmType VVol { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.VmType 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.PureStorageBlock.Models.VmType left, Azure.ResourceManager.PureStorageBlock.Models.VmType right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.VmType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.VmType left, Azure.ResourceManager.PureStorageBlock.Models.VmType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VnetInjection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VnetInjection(string subnetId, string vnetId) { } + public string SubnetId { get { throw null; } set { } } + public string VnetId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.VnetInjection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.VnetInjection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 VolumeContainerType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VolumeContainerType(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType AVS { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType 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.PureStorageBlock.Models.VolumeContainerType left, Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType left, Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VolumeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VolumeProperties() { } + public Azure.ResourceManager.PureStorageBlock.Models.AvsDiskDetails Avs { get { throw null; } } + public string CreatedTimestamp { get { throw null; } } + public string DisplayName { get { throw null; } } + public long? ProvisionedSize { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion SoftDeletion { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.Space Space { get { throw null; } } + public string StoragePoolInternalId { get { throw null; } } + public string StoragePoolResourceId { get { throw null; } } + public string VolumeInternalId { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.VolumeType? VolumeType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.VolumeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.VolumeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 VolumeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VolumeType(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.VolumeType AVS { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.VolumeType 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.PureStorageBlock.Models.VolumeType left, Azure.ResourceManager.PureStorageBlock.Models.VolumeType right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.VolumeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.VolumeType left, Azure.ResourceManager.PureStorageBlock.Models.VolumeType right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/api/Azure.ResourceManager.PureStorageBlock.netstandard2.0.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/api/Azure.ResourceManager.PureStorageBlock.netstandard2.0.cs new file mode 100644 index 000000000000..e7ac19f72ee3 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/api/Azure.ResourceManager.PureStorageBlock.netstandard2.0.cs @@ -0,0 +1,1123 @@ +namespace Azure.ResourceManager.PureStorageBlock +{ + public partial class AvsStorageContainerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AvsStorageContainerCollection() { } + public virtual Azure.Response Exists(string storageContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string storageContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string storageContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string storageContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string storageContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string storageContainerName, 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 AvsStorageContainerData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsStorageContainerData() { } + public Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsStorageContainerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsStorageContainerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsStorageContainerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AvsStorageContainerResource() { } + public virtual Azure.ResourceManager.PureStorageBlock.AvsStorageContainerData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName) { 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 GetAvsStorageContainerVolume(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAvsStorageContainerVolumeAsync(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeCollection GetAvsStorageContainerVolumes() { throw null; } + Azure.ResourceManager.PureStorageBlock.AvsStorageContainerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsStorageContainerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsStorageContainerVolumeCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AvsStorageContainerVolumeCollection() { } + public virtual Azure.Response Exists(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string volumeId, 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 AvsStorageContainerVolumeData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsStorageContainerVolumeData() { } + public Azure.ResourceManager.PureStorageBlock.Models.VolumeProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsStorageContainerVolumeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AvsStorageContainerVolumeResource() { } + public virtual Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName, string volumeId) { 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.PureStorageBlock.AvsStorageContainerVolumeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.PureStorageBlock.Models.AvsStorageContainerVolumePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerVolumePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AvsVmCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AvsVmCollection() { } + public virtual Azure.Response Exists(string avsVmId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string avsVmId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string avsVmId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string avsVmId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string avsVmId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string avsVmId, 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 AvsVmData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsVmData() { } + public Azure.ResourceManager.PureStorageBlock.Models.AvsVmProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsVmData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsVmData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsVmResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AvsVmResource() { } + public virtual Azure.ResourceManager.PureStorageBlock.AvsVmData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId) { 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 GetAvsVmVolume(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAvsVmVolumeAsync(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.AvsVmVolumeCollection GetAvsVmVolumes() { throw null; } + Azure.ResourceManager.PureStorageBlock.AvsVmData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsVmData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.PureStorageBlock.Models.AvsVmPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.AvsVmPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AvsVmVolumeCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AvsVmVolumeCollection() { } + public virtual Azure.Response Exists(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string volumeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string volumeId, 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 AvsVmVolumeData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsVmVolumeData() { } + public Azure.ResourceManager.PureStorageBlock.Models.VolumeProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsVmVolumeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsVmVolumeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsVmVolumeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AvsVmVolumeResource() { } + public virtual Azure.ResourceManager.PureStorageBlock.AvsVmVolumeData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, string volumeId) { 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.PureStorageBlock.AvsVmVolumeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.AvsVmVolumeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.PureStorageBlock.Models.AvsVmVolumePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.AvsVmVolumePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AzureResourceManagerPureStorageBlockContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerPureStorageBlockContext() { } + public static Azure.ResourceManager.PureStorageBlock.AzureResourceManagerPureStorageBlockContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } + public static partial class PureStorageBlockExtensions + { + public static Azure.ResourceManager.PureStorageBlock.AvsStorageContainerResource GetAvsStorageContainerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeResource GetAvsStorageContainerVolumeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.AvsVmResource GetAvsVmResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.AvsVmVolumeResource GetAvsVmVolumeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetReservation(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetReservationAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.ReservationResource GetReservationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.ReservationCollection GetReservations(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetReservations(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetReservationsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetStoragePool(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetStoragePoolAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.StoragePoolResource GetStoragePoolResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.StoragePoolCollection GetStoragePools(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetStoragePools(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetStoragePoolsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ReservationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ReservationCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string reservationName, Azure.ResourceManager.PureStorageBlock.ReservationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string reservationName, Azure.ResourceManager.PureStorageBlock.ReservationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string reservationName, 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 ReservationData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReservationData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.PureStorageBlock.Models.ReservationPropertiesBaseResourceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.ReservationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.ReservationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReservationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ReservationResource() { } + public virtual Azure.ResourceManager.PureStorageBlock.ReservationData 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 reservationName) { 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 GetBillingReport(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBillingReportAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBillingStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBillingStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetResourceLimits(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetResourceLimitsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.PureStorageBlock.ReservationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.ReservationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.PureStorageBlock.Models.ReservationPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.ReservationPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class StoragePoolCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected StoragePoolCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string storagePoolName, Azure.ResourceManager.PureStorageBlock.StoragePoolData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string storagePoolName, Azure.ResourceManager.PureStorageBlock.StoragePoolData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string storagePoolName, 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 StoragePoolData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StoragePoolData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.PureStorageBlock.Models.StoragePoolProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.StoragePoolData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.StoragePoolData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StoragePoolResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected StoragePoolResource() { } + public virtual Azure.ResourceManager.PureStorageBlock.StoragePoolData 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 storagePoolName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation DisableAvsConnection(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DisableAvsConnectionAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation EnableAvsConnection(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.StoragePoolEnableAvsConnectionPost properties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task EnableAvsConnectionAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.StoragePoolEnableAvsConnectionPost properties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation FinalizeAvsConnection(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.StoragePoolFinalizeAvsConnectionPost properties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task FinalizeAvsConnectionAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.StoragePoolFinalizeAvsConnectionPost properties, 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 GetAvsConnection(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAvsConnectionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAvsStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAvsStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAvsStorageContainer(string storageContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAvsStorageContainerAsync(string storageContainerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.AvsStorageContainerCollection GetAvsStorageContainers() { throw null; } + public virtual Azure.Response GetAvsVm(string avsVmId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAvsVmAsync(string avsVmId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.AvsVmCollection GetAvsVms() { throw null; } + public virtual Azure.Response GetHealthStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetHealthStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation RepairAvsConnection(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RepairAvsConnectionAsync(Azure.WaitUntil waitUntil, 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.PureStorageBlock.StoragePoolData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.StoragePoolData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.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.PureStorageBlock.Models.StoragePoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PureStorageBlock.Models.StoragePoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.PureStorageBlock.Mocking +{ + public partial class MockablePureStorageBlockArmClient : Azure.ResourceManager.ArmResource + { + protected MockablePureStorageBlockArmClient() { } + public virtual Azure.ResourceManager.PureStorageBlock.AvsStorageContainerResource GetAvsStorageContainerResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeResource GetAvsStorageContainerVolumeResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.AvsVmResource GetAvsVmResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.AvsVmVolumeResource GetAvsVmVolumeResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.ReservationResource GetReservationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.StoragePoolResource GetStoragePoolResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockablePureStorageBlockResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockablePureStorageBlockResourceGroupResource() { } + public virtual Azure.Response GetReservation(string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetReservationAsync(string reservationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.ReservationCollection GetReservations() { throw null; } + public virtual Azure.Response GetStoragePool(string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetStoragePoolAsync(string storagePoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PureStorageBlock.StoragePoolCollection GetStoragePools() { throw null; } + } + public partial class MockablePureStorageBlockSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockablePureStorageBlockSubscriptionResource() { } + public virtual Azure.Pageable GetReservations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetReservationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetStoragePools(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetStoragePoolsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class Address : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Address(string addressLine1, string city, string state, string country, string postalCode) { } + public string AddressLine1 { get { throw null; } set { } } + public string AddressLine2 { get { throw null; } set { } } + public string City { get { throw null; } set { } } + public string Country { get { throw null; } set { } } + public string PostalCode { get { throw null; } set { } } + public string State { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.Address System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.Address System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class Alert : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal Alert() { } + public Azure.ResourceManager.PureStorageBlock.Models.AlertLevel Level { get { throw null; } } + public string Message { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.Alert System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.Alert System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AlertLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AlertLevel(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AlertLevel Error { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.AlertLevel Info { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.AlertLevel Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.AlertLevel 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.PureStorageBlock.Models.AlertLevel left, Azure.ResourceManager.PureStorageBlock.Models.AlertLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.AlertLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.AlertLevel left, Azure.ResourceManager.PureStorageBlock.Models.AlertLevel right) { throw null; } + public override string ToString() { throw null; } + } + public static partial class ArmPureStorageBlockModelFactory + { + public static Azure.ResourceManager.PureStorageBlock.Models.Alert Alert(Azure.ResourceManager.PureStorageBlock.Models.AlertLevel level = default(Azure.ResourceManager.PureStorageBlock.Models.AlertLevel), string message = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AvsConnection AvsConnection(bool serviceInitializationCompleted = false, string serviceInitializationHandleEnc = null, Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationHandle serviceInitializationHandle = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AvsDiskDetails AvsDiskDetails(string diskId = null, string diskName = null, string folder = null, string avsVmInternalId = null, string avsVmResourceId = null, string avsVmName = null, string avsStorageContainerResourceId = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AvsStatus AvsStatus(bool avsEnabled = false, string currentConnectionStatus = null, string clusterResourceId = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.AvsStorageContainerData AvsStorageContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerProperties properties = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerProperties AvsStorageContainerProperties(Azure.ResourceManager.PureStorageBlock.Models.Space space = null, string resourceName = null, long? provisionedLimit = default(long?), string datastore = null, bool? mounted = default(bool?)) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.AvsStorageContainerVolumeData AvsStorageContainerVolumeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.PureStorageBlock.Models.VolumeProperties properties = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.AvsVmData AvsVmData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.PureStorageBlock.Models.AvsVmProperties properties = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AvsVmDetails AvsVmDetails(string vmId = null, string vmName = null, Azure.ResourceManager.PureStorageBlock.Models.VmType vmType = default(Azure.ResourceManager.PureStorageBlock.Models.VmType), string avsVmInternalId = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AvsVmProperties AvsVmProperties(string storagePoolInternalId = null, string storagePoolResourceId = null, string displayName = null, string createdTimestamp = null, Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion softDeletion = null, Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType? volumeContainerType = default(Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType?), Azure.ResourceManager.PureStorageBlock.Models.AvsVmDetails avs = null, Azure.ResourceManager.PureStorageBlock.Models.Space space = null, Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState?)) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.AvsVmVolumeData AvsVmVolumeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.PureStorageBlock.Models.VolumeProperties properties = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.AzureVmwareService AzureVmwareService(bool avsEnabled = false, string clusterResourceId = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.BandwidthUsage BandwidthUsage(long current = (long)0, long provisioned = (long)0, long max = (long)0) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.BillingUsageProperty BillingUsageProperty(string propertyId = null, string propertyName = null, string currentValue = null, string previousValue = null, Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity severity = default(Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity), string statusMessage = null, System.Collections.Generic.IEnumerable subProperties = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.HealthDetails HealthDetails(double usedCapacityPercentage = 0, Azure.ResourceManager.PureStorageBlock.Models.BandwidthUsage bandwidthUsage = null, Azure.ResourceManager.PureStorageBlock.Models.IopsUsage iopsUsage = null, Azure.ResourceManager.PureStorageBlock.Models.Space space = null, double dataReductionRatio = 0, long estimatedMaxCapacity = (long)0) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.IopsUsage IopsUsage(long current = (long)0, long provisioned = (long)0, long max = (long)0) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.LimitDetails LimitDetails(Azure.ResourceManager.PureStorageBlock.Models.StoragePoolLimits storagePool = null, Azure.ResourceManager.PureStorageBlock.Models.RangeLimits volumeProvisionedSize = null, Azure.ResourceManager.PureStorageBlock.Models.ProtectionPolicyLimits protectionPolicy = null, Azure.ResourceManager.PureStorageBlock.Models.PerformancePolicyLimits performancePolicy = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.MarketplaceDetails MarketplaceDetails(string subscriptionId = null, Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus? subscriptionStatus = default(Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus?), Azure.ResourceManager.PureStorageBlock.Models.OfferDetails offerDetails = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.PerformancePolicyLimits PerformancePolicyLimits(Azure.ResourceManager.PureStorageBlock.Models.RangeLimits iopsLimit = null, Azure.ResourceManager.PureStorageBlock.Models.RangeLimits bandwidthLimit = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.ProtectionPolicyLimits ProtectionPolicyLimits(Azure.ResourceManager.PureStorageBlock.Models.RangeLimits frequency = null, Azure.ResourceManager.PureStorageBlock.Models.RangeLimits retention = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.RangeLimits RangeLimits(long min = (long)0, long max = (long)0) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.ReservationBillingStatus ReservationBillingStatus(string timestamp = null, long totalUsedCapacityReported = (long)0, int lowDrrPoolCount = 0, double drrWeightedAverage = 0, long totalNonReducibleReported = (long)0, long extraUsedCapacityNonReducible = (long)0, long extraUsedCapacityLowUsageRounding = (long)0, long extraUsedCapacityNonReduciblePlanDiscount = (long)0, long totalUsedCapacityBilled = (long)0, long totalUsedCapacityIncludedPlan = (long)0, long totalUsedCapacityOverage = (long)0, long totalPerformanceReported = (long)0, long totalPerformanceIncludedPlan = (long)0, long totalPerformanceOverage = (long)0) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.ReservationBillingUsageReport ReservationBillingUsageReport(string timestamp = null, System.Collections.Generic.IEnumerable billingUsageProperties = null, string overallStatusMessage = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.ReservationData ReservationData(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.PureStorageBlock.Models.ReservationPropertiesBaseResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.ReservationPropertiesBaseResourceProperties ReservationPropertiesBaseResourceProperties(string reservationInternalId = null, Azure.ResourceManager.PureStorageBlock.Models.MarketplaceDetails marketplace = null, Azure.ResourceManager.PureStorageBlock.Models.UserDetails user = null, Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationHandle ServiceInitializationHandle(string clusterResourceId = null, string serviceAccountUsername = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion SoftDeletion(bool destroyed = false, string eradicationTimestamp = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.Space Space(long totalUsed = (long)0, long unique = (long)0, long snapshots = (long)0, long shared = (long)0) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.StoragePoolData StoragePoolData(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.PureStorageBlock.Models.StoragePoolProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.StoragePoolHealthInfo StoragePoolHealthInfo(Azure.ResourceManager.PureStorageBlock.Models.HealthDetails health = null, System.Collections.Generic.IEnumerable alerts = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.StoragePoolLimits StoragePoolLimits(Azure.ResourceManager.PureStorageBlock.Models.RangeLimits provisionedBandwidthMbPerSec = null, Azure.ResourceManager.PureStorageBlock.Models.RangeLimits provisionedIops = null, System.Collections.Generic.IEnumerable physicalAvailabilityZones = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.StoragePoolProperties StoragePoolProperties(string storagePoolInternalId = null, string availabilityZone = null, Azure.ResourceManager.PureStorageBlock.Models.VnetInjection vnetInjection = null, long? dataRetentionPeriod = default(long?), long provisionedBandwidthMbPerSec = (long)0, long? provisionedIops = default(long?), Azure.ResourceManager.PureStorageBlock.Models.AzureVmwareService avs = null, Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState?), string reservationResourceId = null) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.VolumeProperties VolumeProperties(string storagePoolInternalId = null, string storagePoolResourceId = null, string volumeInternalId = null, string displayName = null, Azure.ResourceManager.PureStorageBlock.Models.Space space = null, Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion softDeletion = null, string createdTimestamp = null, long? provisionedSize = default(long?), Azure.ResourceManager.PureStorageBlock.Models.VolumeType? volumeType = default(Azure.ResourceManager.PureStorageBlock.Models.VolumeType?), Azure.ResourceManager.PureStorageBlock.Models.AvsDiskDetails avs = null, Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState? provisioningState = default(Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState?)) { throw null; } + } + public partial class AvsConnection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsConnection() { } + public bool ServiceInitializationCompleted { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationHandle ServiceInitializationHandle { get { throw null; } } + public string ServiceInitializationHandleEnc { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsConnection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsConnection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsDiskDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsDiskDetails() { } + public string AvsStorageContainerResourceId { get { throw null; } } + public string AvsVmInternalId { get { throw null; } } + public string AvsVmName { get { throw null; } } + public string AvsVmResourceId { get { throw null; } } + public string DiskId { get { throw null; } } + public string DiskName { get { throw null; } } + public string Folder { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsDiskDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsDiskDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsStatus() { } + public bool AvsEnabled { get { throw null; } } + public string ClusterResourceId { get { throw null; } } + public string CurrentConnectionStatus { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsStorageContainerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsStorageContainerProperties() { } + public string Datastore { get { throw null; } } + public bool? Mounted { get { throw null; } } + public long? ProvisionedLimit { get { throw null; } } + public string ResourceName { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.Space Space { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsStorageContainerVolumePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AvsStorageContainerVolumePatch() { } + public Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion AvsStorageContainerVolumeUpdateSoftDeletion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerVolumePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsStorageContainerVolumePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsVmDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsVmDetails() { } + public string AvsVmInternalId { get { throw null; } } + public string VmId { get { throw null; } } + public string VmName { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.VmType VmType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsVmPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AvsVmPatch() { } + public Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion AvsVmUpdateSoftDeletion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsVmProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsVmProperties() { } + public Azure.ResourceManager.PureStorageBlock.Models.AvsVmDetails Avs { get { throw null; } } + public string CreatedTimestamp { get { throw null; } } + public string DisplayName { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion SoftDeletion { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.Space Space { get { throw null; } } + public string StoragePoolInternalId { get { throw null; } } + public string StoragePoolResourceId { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType? VolumeContainerType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsVmVolumePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AvsVmVolumePatch() { } + public Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion AvsVmVolumeUpdateSoftDeletion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmVolumePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AvsVmVolumePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzureVmwareService : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AzureVmwareService() { } + public bool AvsEnabled { get { throw null; } } + public string ClusterResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AzureVmwareService System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.AzureVmwareService System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BandwidthUsage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal BandwidthUsage() { } + public long Current { get { throw null; } } + public long Max { get { throw null; } } + public long Provisioned { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.BandwidthUsage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.BandwidthUsage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BillingUsageProperty : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal BillingUsageProperty() { } + public string CurrentValue { get { throw null; } } + public string PreviousValue { get { throw null; } } + public string PropertyId { get { throw null; } } + public string PropertyName { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity Severity { get { throw null; } } + public string StatusMessage { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SubProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.BillingUsageProperty System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.BillingUsageProperty System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CompanyDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CompanyDetails(string companyName) { } + public Azure.ResourceManager.PureStorageBlock.Models.Address Address { get { throw null; } set { } } + public string CompanyName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.CompanyDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.CompanyDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HealthDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HealthDetails() { } + public Azure.ResourceManager.PureStorageBlock.Models.BandwidthUsage BandwidthUsage { get { throw null; } } + public double DataReductionRatio { get { throw null; } } + public long EstimatedMaxCapacity { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.IopsUsage IopsUsage { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.Space Space { get { throw null; } } + public double UsedCapacityPercentage { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.HealthDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.HealthDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IopsUsage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal IopsUsage() { } + public long Current { get { throw null; } } + public long Max { get { throw null; } } + public long Provisioned { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.IopsUsage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.IopsUsage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LimitDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal LimitDetails() { } + public Azure.ResourceManager.PureStorageBlock.Models.PerformancePolicyLimits PerformancePolicy { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.ProtectionPolicyLimits ProtectionPolicy { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.StoragePoolLimits StoragePool { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.RangeLimits VolumeProvisionedSize { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.LimitDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.LimitDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MarketplaceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MarketplaceDetails(Azure.ResourceManager.PureStorageBlock.Models.OfferDetails offerDetails) { } + public Azure.ResourceManager.PureStorageBlock.Models.OfferDetails OfferDetails { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus? SubscriptionStatus { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.MarketplaceDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.MarketplaceDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 MarketplaceSubscriptionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MarketplaceSubscriptionStatus(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus PendingFulfillmentStart { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus Subscribed { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus Suspended { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus Unsubscribed { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus 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.PureStorageBlock.Models.MarketplaceSubscriptionStatus left, Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus left, Azure.ResourceManager.PureStorageBlock.Models.MarketplaceSubscriptionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class OfferDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OfferDetails(string publisherId, string offerId, string planId) { } + public string OfferId { get { throw null; } set { } } + public string PlanId { get { throw null; } set { } } + public string PlanName { get { throw null; } set { } } + public string PublisherId { get { throw null; } set { } } + public string TermId { get { throw null; } set { } } + public string TermUnit { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.OfferDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.OfferDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PerformancePolicyLimits : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PerformancePolicyLimits() { } + public Azure.ResourceManager.PureStorageBlock.Models.RangeLimits BandwidthLimit { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.RangeLimits IopsLimit { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.PerformancePolicyLimits System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.PerformancePolicyLimits System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProtectionPolicyLimits : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProtectionPolicyLimits() { } + public Azure.ResourceManager.PureStorageBlock.Models.RangeLimits Frequency { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.RangeLimits Retention { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ProtectionPolicyLimits System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ProtectionPolicyLimits System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState left, Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState left, Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RangeLimits : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RangeLimits() { } + public long Max { get { throw null; } } + public long Min { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.RangeLimits System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.RangeLimits System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReservationBillingStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ReservationBillingStatus() { } + public double DrrWeightedAverage { get { throw null; } } + public long ExtraUsedCapacityLowUsageRounding { get { throw null; } } + public long ExtraUsedCapacityNonReducible { get { throw null; } } + public long ExtraUsedCapacityNonReduciblePlanDiscount { get { throw null; } } + public int LowDrrPoolCount { get { throw null; } } + public string Timestamp { get { throw null; } } + public long TotalNonReducibleReported { get { throw null; } } + public long TotalPerformanceIncludedPlan { get { throw null; } } + public long TotalPerformanceOverage { get { throw null; } } + public long TotalPerformanceReported { get { throw null; } } + public long TotalUsedCapacityBilled { get { throw null; } } + public long TotalUsedCapacityIncludedPlan { get { throw null; } } + public long TotalUsedCapacityOverage { get { throw null; } } + public long TotalUsedCapacityReported { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ReservationBillingStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ReservationBillingStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReservationBillingUsageReport : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ReservationBillingUsageReport() { } + public System.Collections.Generic.IReadOnlyList BillingUsageProperties { get { throw null; } } + public string OverallStatusMessage { get { throw null; } } + public string Timestamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ReservationBillingUsageReport System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ReservationBillingUsageReport System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReservationPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReservationPatch() { } + public Azure.ResourceManager.PureStorageBlock.Models.UserDetails ReservationUpdateUser { 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.PureStorageBlock.Models.ReservationPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ReservationPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReservationPropertiesBaseResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReservationPropertiesBaseResourceProperties(Azure.ResourceManager.PureStorageBlock.Models.MarketplaceDetails marketplace, Azure.ResourceManager.PureStorageBlock.Models.UserDetails user) { } + public Azure.ResourceManager.PureStorageBlock.Models.MarketplaceDetails Marketplace { get { throw null; } set { } } + public Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ReservationInternalId { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.UserDetails User { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ReservationPropertiesBaseResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ReservationPropertiesBaseResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResourceProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState left, Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState left, Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ServiceInitializationHandle : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ServiceInitializationHandle() { } + public string ClusterResourceId { get { throw null; } } + public string ServiceAccountUsername { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationHandle System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationHandle System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServiceInitializationInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServiceInitializationInfo() { } + public string ServiceAccountPassword { get { throw null; } set { } } + public string ServiceAccountUsername { get { throw null; } set { } } + public string VSphereCertificate { get { throw null; } set { } } + public string VSphereIP { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SoftDeletion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SoftDeletion(bool destroyed) { } + public bool Destroyed { get { throw null; } set { } } + public string EradicationTimestamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class Space : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal Space() { } + public long Shared { get { throw null; } } + public long Snapshots { get { throw null; } } + public long TotalUsed { get { throw null; } } + public long Unique { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.Space System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.Space System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StoragePoolEnableAvsConnectionPost : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StoragePoolEnableAvsConnectionPost(string clusterResourceId) { } + public string ClusterResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolEnableAvsConnectionPost System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolEnableAvsConnectionPost System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StoragePoolFinalizeAvsConnectionPost : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StoragePoolFinalizeAvsConnectionPost() { } + public Azure.ResourceManager.PureStorageBlock.Models.ServiceInitializationInfo ServiceInitializationData { get { throw null; } set { } } + public string ServiceInitializationDataEnc { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolFinalizeAvsConnectionPost System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolFinalizeAvsConnectionPost System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StoragePoolHealthInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal StoragePoolHealthInfo() { } + public System.Collections.Generic.IReadOnlyList Alerts { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.HealthDetails Health { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolHealthInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolHealthInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StoragePoolLimits : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal StoragePoolLimits() { } + public System.Collections.Generic.IReadOnlyList PhysicalAvailabilityZones { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.RangeLimits ProvisionedBandwidthMbPerSec { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.RangeLimits ProvisionedIops { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolLimits System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolLimits System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StoragePoolPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StoragePoolPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public long? StoragePoolUpdateProvisionedBandwidthMbPerSec { 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.PureStorageBlock.Models.StoragePoolPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StoragePoolProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StoragePoolProperties(string availabilityZone, Azure.ResourceManager.PureStorageBlock.Models.VnetInjection vnetInjection, long provisionedBandwidthMbPerSec, string reservationResourceId) { } + public string AvailabilityZone { get { throw null; } set { } } + public Azure.ResourceManager.PureStorageBlock.Models.AzureVmwareService Avs { get { throw null; } } + public long? DataRetentionPeriod { get { throw null; } } + public long ProvisionedBandwidthMbPerSec { get { throw null; } set { } } + public long? ProvisionedIops { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ReservationResourceId { get { throw null; } set { } } + public string StoragePoolInternalId { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.VnetInjection VnetInjection { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.StoragePoolProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 UsageSeverity : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public UsageSeverity(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity ALERT { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity INFORMATION { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity NONE { get { throw null; } } + public static Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity WARNING { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity 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.PureStorageBlock.Models.UsageSeverity left, Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity left, Azure.ResourceManager.PureStorageBlock.Models.UsageSeverity right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UserDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UserDetails(string firstName, string lastName, string emailAddress) { } + public Azure.ResourceManager.PureStorageBlock.Models.CompanyDetails CompanyDetails { get { throw null; } set { } } + public string EmailAddress { get { throw null; } set { } } + public string FirstName { get { throw null; } set { } } + public string LastName { get { throw null; } set { } } + public string PhoneNumber { get { throw null; } set { } } + public string Upn { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.UserDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.UserDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 VmType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VmType(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.VmType VVol { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.VmType 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.PureStorageBlock.Models.VmType left, Azure.ResourceManager.PureStorageBlock.Models.VmType right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.VmType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.VmType left, Azure.ResourceManager.PureStorageBlock.Models.VmType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VnetInjection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VnetInjection(string subnetId, string vnetId) { } + public string SubnetId { get { throw null; } set { } } + public string VnetId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.VnetInjection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.VnetInjection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 VolumeContainerType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VolumeContainerType(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType AVS { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType 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.PureStorageBlock.Models.VolumeContainerType left, Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType left, Azure.ResourceManager.PureStorageBlock.Models.VolumeContainerType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VolumeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VolumeProperties() { } + public Azure.ResourceManager.PureStorageBlock.Models.AvsDiskDetails Avs { get { throw null; } } + public string CreatedTimestamp { get { throw null; } } + public string DisplayName { get { throw null; } } + public long? ProvisionedSize { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.ResourceProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.SoftDeletion SoftDeletion { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.Space Space { get { throw null; } } + public string StoragePoolInternalId { get { throw null; } } + public string StoragePoolResourceId { get { throw null; } } + public string VolumeInternalId { get { throw null; } } + public Azure.ResourceManager.PureStorageBlock.Models.VolumeType? VolumeType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.VolumeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PureStorageBlock.Models.VolumeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 VolumeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VolumeType(string value) { throw null; } + public static Azure.ResourceManager.PureStorageBlock.Models.VolumeType AVS { get { throw null; } } + public bool Equals(Azure.ResourceManager.PureStorageBlock.Models.VolumeType 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.PureStorageBlock.Models.VolumeType left, Azure.ResourceManager.PureStorageBlock.Models.VolumeType right) { throw null; } + public static implicit operator Azure.ResourceManager.PureStorageBlock.Models.VolumeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PureStorageBlock.Models.VolumeType left, Azure.ResourceManager.PureStorageBlock.Models.VolumeType right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/assets.json b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/assets.json new file mode 100644 index 000000000000..6514a64c2411 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/purestorageblock/Azure.ResourceManager.PureStorageBlock", + "Tag": "" +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Azure.ResourceManager.PureStorageBlock.Samples.csproj b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Azure.ResourceManager.PureStorageBlock.Samples.csproj new file mode 100644 index 000000000000..70d5c9f46c03 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Azure.ResourceManager.PureStorageBlock.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerCollection.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerCollection.cs new file mode 100644 index 000000000000..1d3003e34048 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.PureStorageBlock.Samples +{ + public partial class Sample_AvsStorageContainerCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsStorageContainersGet() + { + // Generated from example definition: 2024-11-01-preview/AvsStorageContainers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsStorageContainer_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolName"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // get the collection of this AvsStorageContainerResource + AvsStorageContainerCollection collection = storagePool.GetAvsStorageContainers(); + + // invoke the operation + string storageContainerName = "storageContainerName"; + AvsStorageContainerResource result = await collection.GetAsync(storageContainerName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsStorageContainerData resourceData = result.Data; + // for 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_AvsStorageContainersListByStoragePool() + { + // Generated from example definition: 2024-11-01-preview/AvsStorageContainers_ListByStoragePool_MaximumSet_Gen.json + // this example is just showing the usage of "AvsStorageContainer_ListByStoragePool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "spName"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // get the collection of this AvsStorageContainerResource + AvsStorageContainerCollection collection = storagePool.GetAvsStorageContainers(); + + // invoke the operation and iterate over the result + await foreach (AvsStorageContainerResource 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 + AvsStorageContainerData 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_AvsStorageContainersGet() + { + // Generated from example definition: 2024-11-01-preview/AvsStorageContainers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsStorageContainer_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolName"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // get the collection of this AvsStorageContainerResource + AvsStorageContainerCollection collection = storagePool.GetAvsStorageContainers(); + + // invoke the operation + string storageContainerName = "storageContainerName"; + bool result = await collection.ExistsAsync(storageContainerName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsStorageContainersGet() + { + // Generated from example definition: 2024-11-01-preview/AvsStorageContainers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsStorageContainer_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolName"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // get the collection of this AvsStorageContainerResource + AvsStorageContainerCollection collection = storagePool.GetAvsStorageContainers(); + + // invoke the operation + string storageContainerName = "storageContainerName"; + NullableResponse response = await collection.GetIfExistsAsync(storageContainerName); + AvsStorageContainerResource 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 + AvsStorageContainerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerResource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerResource.cs new file mode 100644 index 000000000000..351f7a75dd51 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerResource.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.PureStorageBlock.Samples +{ + public partial class Sample_AvsStorageContainerResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsStorageContainersGet() + { + // Generated from example definition: 2024-11-01-preview/AvsStorageContainers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsStorageContainer_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsStorageContainerResource created on azure + // for more information of creating AvsStorageContainerResource, please refer to the document of AvsStorageContainerResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolName"; + string storageContainerName = "storageContainerName"; + ResourceIdentifier avsStorageContainerResourceId = AvsStorageContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, storageContainerName); + AvsStorageContainerResource avsStorageContainer = client.GetAvsStorageContainerResource(avsStorageContainerResourceId); + + // invoke the operation + AvsStorageContainerResource result = await avsStorageContainer.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 + AvsStorageContainerData resourceData = result.Data; + // for 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_AvsStorageContainersDelete() + { + // Generated from example definition: 2024-11-01-preview/AvsStorageContainers_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AvsStorageContainer_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 AvsStorageContainerResource created on azure + // for more information of creating AvsStorageContainerResource, please refer to the document of AvsStorageContainerResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolName"; + string storageContainerName = "storageContainerName"; + ResourceIdentifier avsStorageContainerResourceId = AvsStorageContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, storageContainerName); + AvsStorageContainerResource avsStorageContainer = client.GetAvsStorageContainerResource(avsStorageContainerResourceId); + + // invoke the operation + await avsStorageContainer.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerVolumeCollection.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerVolumeCollection.cs new file mode 100644 index 000000000000..3968e321b309 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerVolumeCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.PureStorageBlock.Samples +{ + public partial class Sample_AvsStorageContainerVolumeCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsStorageContainerVolumesGet() + { + // Generated from example definition: 2024-11-01-preview/AvsStorageContainerVolumes_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsStorageContainerVolume_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsStorageContainerResource created on azure + // for more information of creating AvsStorageContainerResource, please refer to the document of AvsStorageContainerResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string storageContainerName = "name"; + ResourceIdentifier avsStorageContainerResourceId = AvsStorageContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, storageContainerName); + AvsStorageContainerResource avsStorageContainer = client.GetAvsStorageContainerResource(avsStorageContainerResourceId); + + // get the collection of this AvsStorageContainerVolumeResource + AvsStorageContainerVolumeCollection collection = avsStorageContainer.GetAvsStorageContainerVolumes(); + + // invoke the operation + string volumeId = "cbdec-ddbb"; + AvsStorageContainerVolumeResource result = await collection.GetAsync(volumeId); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsStorageContainerVolumeData resourceData = result.Data; + // for 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_AvsStorageContainerVolumesListByAvsStorageContainer() + { + // Generated from example definition: 2024-11-01-preview/AvsStorageContainerVolumes_ListByAvsStorageContainer_MaximumSet_Gen.json + // this example is just showing the usage of "AvsStorageContainerVolume_ListByAvsStorageContainer" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsStorageContainerResource created on azure + // for more information of creating AvsStorageContainerResource, please refer to the document of AvsStorageContainerResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string storageContainerName = "name"; + ResourceIdentifier avsStorageContainerResourceId = AvsStorageContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, storageContainerName); + AvsStorageContainerResource avsStorageContainer = client.GetAvsStorageContainerResource(avsStorageContainerResourceId); + + // get the collection of this AvsStorageContainerVolumeResource + AvsStorageContainerVolumeCollection collection = avsStorageContainer.GetAvsStorageContainerVolumes(); + + // invoke the operation and iterate over the result + await foreach (AvsStorageContainerVolumeResource 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 + AvsStorageContainerVolumeData 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_AvsStorageContainerVolumesGet() + { + // Generated from example definition: 2024-11-01-preview/AvsStorageContainerVolumes_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsStorageContainerVolume_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsStorageContainerResource created on azure + // for more information of creating AvsStorageContainerResource, please refer to the document of AvsStorageContainerResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string storageContainerName = "name"; + ResourceIdentifier avsStorageContainerResourceId = AvsStorageContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, storageContainerName); + AvsStorageContainerResource avsStorageContainer = client.GetAvsStorageContainerResource(avsStorageContainerResourceId); + + // get the collection of this AvsStorageContainerVolumeResource + AvsStorageContainerVolumeCollection collection = avsStorageContainer.GetAvsStorageContainerVolumes(); + + // invoke the operation + string volumeId = "cbdec-ddbb"; + bool result = await collection.ExistsAsync(volumeId); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsStorageContainerVolumesGet() + { + // Generated from example definition: 2024-11-01-preview/AvsStorageContainerVolumes_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsStorageContainerVolume_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsStorageContainerResource created on azure + // for more information of creating AvsStorageContainerResource, please refer to the document of AvsStorageContainerResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string storageContainerName = "name"; + ResourceIdentifier avsStorageContainerResourceId = AvsStorageContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, storageContainerName); + AvsStorageContainerResource avsStorageContainer = client.GetAvsStorageContainerResource(avsStorageContainerResourceId); + + // get the collection of this AvsStorageContainerVolumeResource + AvsStorageContainerVolumeCollection collection = avsStorageContainer.GetAvsStorageContainerVolumes(); + + // invoke the operation + string volumeId = "cbdec-ddbb"; + NullableResponse response = await collection.GetIfExistsAsync(volumeId); + AvsStorageContainerVolumeResource 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 + AvsStorageContainerVolumeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerVolumeResource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerVolumeResource.cs new file mode 100644 index 000000000000..d9ca5c2dffcb --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsStorageContainerVolumeResource.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.PureStorageBlock.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.PureStorageBlock.Samples +{ + public partial class Sample_AvsStorageContainerVolumeResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsStorageContainerVolumesGet() + { + // Generated from example definition: 2024-11-01-preview/AvsStorageContainerVolumes_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsStorageContainerVolume_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsStorageContainerVolumeResource created on azure + // for more information of creating AvsStorageContainerVolumeResource, please refer to the document of AvsStorageContainerVolumeResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string storageContainerName = "name"; + string volumeId = "cbdec-ddbb"; + ResourceIdentifier avsStorageContainerVolumeResourceId = AvsStorageContainerVolumeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, storageContainerName, volumeId); + AvsStorageContainerVolumeResource avsStorageContainerVolume = client.GetAvsStorageContainerVolumeResource(avsStorageContainerVolumeResourceId); + + // invoke the operation + AvsStorageContainerVolumeResource result = await avsStorageContainerVolume.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 + AvsStorageContainerVolumeData resourceData = result.Data; + // for 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_AvsStorageContainerVolumesDelete() + { + // Generated from example definition: 2024-11-01-preview/AvsStorageContainerVolumes_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AvsStorageContainerVolume_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 AvsStorageContainerVolumeResource created on azure + // for more information of creating AvsStorageContainerVolumeResource, please refer to the document of AvsStorageContainerVolumeResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string storageContainerName = "name"; + string volumeId = "cbdec-ddbb"; + ResourceIdentifier avsStorageContainerVolumeResourceId = AvsStorageContainerVolumeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, storageContainerName, volumeId); + AvsStorageContainerVolumeResource avsStorageContainerVolume = client.GetAvsStorageContainerVolumeResource(avsStorageContainerVolumeResourceId); + + // invoke the operation + await avsStorageContainerVolume.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AvsStorageContainerVolumesUpdate() + { + // Generated from example definition: 2024-11-01-preview/AvsStorageContainerVolumes_Update_MaximumSet_Gen.json + // this example is just showing the usage of "AvsStorageContainerVolume_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 AvsStorageContainerVolumeResource created on azure + // for more information of creating AvsStorageContainerVolumeResource, please refer to the document of AvsStorageContainerVolumeResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string storageContainerName = "name"; + string volumeId = "cbdec-ddbb"; + ResourceIdentifier avsStorageContainerVolumeResourceId = AvsStorageContainerVolumeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, storageContainerName, volumeId); + AvsStorageContainerVolumeResource avsStorageContainerVolume = client.GetAvsStorageContainerVolumeResource(avsStorageContainerVolumeResourceId); + + // invoke the operation + AvsStorageContainerVolumePatch patch = new AvsStorageContainerVolumePatch + { + AvsStorageContainerVolumeUpdateSoftDeletion = new SoftDeletion(true), + }; + ArmOperation lro = await avsStorageContainerVolume.UpdateAsync(WaitUntil.Completed, patch); + AvsStorageContainerVolumeResource 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 + AvsStorageContainerVolumeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmCollection.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmCollection.cs new file mode 100644 index 000000000000..77f69e6d790f --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.PureStorageBlock.Samples +{ + public partial class Sample_AvsVmCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsVmsGet() + { + // Generated from example definition: 2024-11-01-preview/AvsVms_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsVm_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // get the collection of this AvsVmResource + AvsVmCollection collection = storagePool.GetAvsVms(); + + // invoke the operation + string avsVmId = "cbdec-ddbb"; + AvsVmResource result = await collection.GetAsync(avsVmId); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsVmData resourceData = result.Data; + // for 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_AvsVmsListByStoragePool() + { + // Generated from example definition: 2024-11-01-preview/AvsVms_ListByStoragePool_MaximumSet_Gen.json + // this example is just showing the usage of "AvsVm_ListByStoragePool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // get the collection of this AvsVmResource + AvsVmCollection collection = storagePool.GetAvsVms(); + + // invoke the operation and iterate over the result + await foreach (AvsVmResource 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 + AvsVmData 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_AvsVmsGet() + { + // Generated from example definition: 2024-11-01-preview/AvsVms_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsVm_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // get the collection of this AvsVmResource + AvsVmCollection collection = storagePool.GetAvsVms(); + + // invoke the operation + string avsVmId = "cbdec-ddbb"; + bool result = await collection.ExistsAsync(avsVmId); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsVmsGet() + { + // Generated from example definition: 2024-11-01-preview/AvsVms_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsVm_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // get the collection of this AvsVmResource + AvsVmCollection collection = storagePool.GetAvsVms(); + + // invoke the operation + string avsVmId = "cbdec-ddbb"; + NullableResponse response = await collection.GetIfExistsAsync(avsVmId); + AvsVmResource 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 + AvsVmData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmResource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmResource.cs new file mode 100644 index 000000000000..8800faf72dfa --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmResource.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.PureStorageBlock.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.PureStorageBlock.Samples +{ + public partial class Sample_AvsVmResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsVmsGet() + { + // Generated from example definition: 2024-11-01-preview/AvsVms_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsVm_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsVmResource created on azure + // for more information of creating AvsVmResource, please refer to the document of AvsVmResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string avsVmId = "cbdec-ddbb"; + ResourceIdentifier avsVmResourceId = AvsVmResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, avsVmId); + AvsVmResource avsVm = client.GetAvsVmResource(avsVmResourceId); + + // invoke the operation + AvsVmResource result = await avsVm.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 + AvsVmData resourceData = result.Data; + // for 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_AvsVmsDelete() + { + // Generated from example definition: 2024-11-01-preview/AvsVms_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AvsVm_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 AvsVmResource created on azure + // for more information of creating AvsVmResource, please refer to the document of AvsVmResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string avsVmId = "cbdec-ddbb"; + ResourceIdentifier avsVmResourceId = AvsVmResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, avsVmId); + AvsVmResource avsVm = client.GetAvsVmResource(avsVmResourceId); + + // invoke the operation + await avsVm.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AvsVmsUpdate() + { + // Generated from example definition: 2024-11-01-preview/AvsVms_Update_MaximumSet_Gen.json + // this example is just showing the usage of "AvsVm_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 AvsVmResource created on azure + // for more information of creating AvsVmResource, please refer to the document of AvsVmResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string avsVmId = "cbdec-ddbb"; + ResourceIdentifier avsVmResourceId = AvsVmResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, avsVmId); + AvsVmResource avsVm = client.GetAvsVmResource(avsVmResourceId); + + // invoke the operation + AvsVmPatch patch = new AvsVmPatch + { + AvsVmUpdateSoftDeletion = new SoftDeletion(true), + }; + ArmOperation lro = await avsVm.UpdateAsync(WaitUntil.Completed, patch); + AvsVmResource 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 + AvsVmData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmVolumeCollection.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmVolumeCollection.cs new file mode 100644 index 000000000000..57e5246ce3f5 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmVolumeCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.PureStorageBlock.Samples +{ + public partial class Sample_AvsVmVolumeCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsVmVolumesGet() + { + // Generated from example definition: 2024-11-01-preview/AvsVmVolumes_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsVmVolume_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsVmResource created on azure + // for more information of creating AvsVmResource, please refer to the document of AvsVmResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string avsVmId = "cbdec-ddbb"; + ResourceIdentifier avsVmResourceId = AvsVmResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, avsVmId); + AvsVmResource avsVm = client.GetAvsVmResource(avsVmResourceId); + + // get the collection of this AvsVmVolumeResource + AvsVmVolumeCollection collection = avsVm.GetAvsVmVolumes(); + + // invoke the operation + string volumeId = "cbdec-ddbb"; + AvsVmVolumeResource result = await collection.GetAsync(volumeId); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsVmVolumeData resourceData = result.Data; + // for 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_AvsVmVolumesListByAvsVm() + { + // Generated from example definition: 2024-11-01-preview/AvsVmVolumes_ListByAvsVm_MaximumSet_Gen.json + // this example is just showing the usage of "AvsVmVolume_ListByAvsVm" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsVmResource created on azure + // for more information of creating AvsVmResource, please refer to the document of AvsVmResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string avsVmId = "cbdec-ddbb"; + ResourceIdentifier avsVmResourceId = AvsVmResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, avsVmId); + AvsVmResource avsVm = client.GetAvsVmResource(avsVmResourceId); + + // get the collection of this AvsVmVolumeResource + AvsVmVolumeCollection collection = avsVm.GetAvsVmVolumes(); + + // invoke the operation and iterate over the result + await foreach (AvsVmVolumeResource 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 + AvsVmVolumeData 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_AvsVmVolumesGet() + { + // Generated from example definition: 2024-11-01-preview/AvsVmVolumes_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsVmVolume_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsVmResource created on azure + // for more information of creating AvsVmResource, please refer to the document of AvsVmResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string avsVmId = "cbdec-ddbb"; + ResourceIdentifier avsVmResourceId = AvsVmResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, avsVmId); + AvsVmResource avsVm = client.GetAvsVmResource(avsVmResourceId); + + // get the collection of this AvsVmVolumeResource + AvsVmVolumeCollection collection = avsVm.GetAvsVmVolumes(); + + // invoke the operation + string volumeId = "cbdec-ddbb"; + bool result = await collection.ExistsAsync(volumeId); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsVmVolumesGet() + { + // Generated from example definition: 2024-11-01-preview/AvsVmVolumes_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsVmVolume_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsVmResource created on azure + // for more information of creating AvsVmResource, please refer to the document of AvsVmResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string avsVmId = "cbdec-ddbb"; + ResourceIdentifier avsVmResourceId = AvsVmResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, avsVmId); + AvsVmResource avsVm = client.GetAvsVmResource(avsVmResourceId); + + // get the collection of this AvsVmVolumeResource + AvsVmVolumeCollection collection = avsVm.GetAvsVmVolumes(); + + // invoke the operation + string volumeId = "cbdec-ddbb"; + NullableResponse response = await collection.GetIfExistsAsync(volumeId); + AvsVmVolumeResource 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 + AvsVmVolumeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmVolumeResource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmVolumeResource.cs new file mode 100644 index 000000000000..91b6ffa2fe27 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_AvsVmVolumeResource.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.PureStorageBlock.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.PureStorageBlock.Samples +{ + public partial class Sample_AvsVmVolumeResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsVmVolumesGet() + { + // Generated from example definition: 2024-11-01-preview/AvsVmVolumes_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsVmVolume_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsVmVolumeResource created on azure + // for more information of creating AvsVmVolumeResource, please refer to the document of AvsVmVolumeResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string avsVmId = "cbdec-ddbb"; + string volumeId = "cbdec-ddbb"; + ResourceIdentifier avsVmVolumeResourceId = AvsVmVolumeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, avsVmId, volumeId); + AvsVmVolumeResource avsVmVolume = client.GetAvsVmVolumeResource(avsVmVolumeResourceId); + + // invoke the operation + AvsVmVolumeResource result = await avsVmVolume.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 + AvsVmVolumeData resourceData = result.Data; + // for 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_AvsVmVolumesDelete() + { + // Generated from example definition: 2024-11-01-preview/AvsVmVolumes_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AvsVmVolume_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 AvsVmVolumeResource created on azure + // for more information of creating AvsVmVolumeResource, please refer to the document of AvsVmVolumeResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string avsVmId = "cbdec-ddbb"; + string volumeId = "cbdec-ddbb"; + ResourceIdentifier avsVmVolumeResourceId = AvsVmVolumeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, avsVmId, volumeId); + AvsVmVolumeResource avsVmVolume = client.GetAvsVmVolumeResource(avsVmVolumeResourceId); + + // invoke the operation + await avsVmVolume.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AvsVmVolumesUpdate() + { + // Generated from example definition: 2024-11-01-preview/AvsVmVolumes_Update_MaximumSet_Gen.json + // this example is just showing the usage of "AvsVmVolume_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 AvsVmVolumeResource created on azure + // for more information of creating AvsVmVolumeResource, please refer to the document of AvsVmVolumeResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + string avsVmId = "cbdec-ddbb"; + string volumeId = "cbdec-ddbb"; + ResourceIdentifier avsVmVolumeResourceId = AvsVmVolumeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName, avsVmId, volumeId); + AvsVmVolumeResource avsVmVolume = client.GetAvsVmVolumeResource(avsVmVolumeResourceId); + + // invoke the operation + AvsVmVolumePatch patch = new AvsVmVolumePatch + { + AvsVmVolumeUpdateSoftDeletion = new SoftDeletion(true), + }; + ArmOperation lro = await avsVmVolume.UpdateAsync(WaitUntil.Completed, patch); + AvsVmVolumeResource 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 + AvsVmVolumeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_ReservationResource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_ReservationResource.cs new file mode 100644 index 000000000000..d6abb91ed7f1 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_ReservationResource.cs @@ -0,0 +1,97 @@ +// 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.PureStorageBlock.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.PureStorageBlock.Samples +{ + public partial class Sample_ReservationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetResourceLimits_ReservationsGetResourceLimits() + { + // Generated from example definition: 2024-11-01-preview/Reservations_GetResourceLimits_MaximumSet_Gen.json + // this example is just showing the usage of "Reservations_GetResourceLimits" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ReservationResource created on azure + // for more information of creating ReservationResource, please refer to the document of ReservationResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string reservationName = "storagePoolname"; + ResourceIdentifier reservationResourceId = ReservationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, reservationName); + ReservationResource reservation = client.GetReservationResource(reservationResourceId); + + // invoke the operation + LimitDetails result = await reservation.GetResourceLimitsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetBillingStatus_ReservationsGetBillingStatusMaximumSet() + { + // Generated from example definition: 2024-11-01-preview/Reservations_GetBillingStatus_MaximumSet_Gen.json + // this example is just showing the usage of "Reservations_GetBillingStatus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ReservationResource created on azure + // for more information of creating ReservationResource, please refer to the document of ReservationResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string reservationName = "reservationname"; + ResourceIdentifier reservationResourceId = ReservationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, reservationName); + ReservationResource reservation = client.GetReservationResource(reservationResourceId); + + // invoke the operation + ReservationBillingStatus result = await reservation.GetBillingStatusAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetBillingReport_ReservationsGetBillingReportMaximumSet() + { + // Generated from example definition: 2024-11-01-preview/Reservations_GetBillingReport_MaximumSet_Gen.json + // this example is just showing the usage of "Reservations_GetBillingReport" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ReservationResource created on azure + // for more information of creating ReservationResource, please refer to the document of ReservationResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string reservationName = "reservationname"; + ResourceIdentifier reservationResourceId = ReservationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, reservationName); + ReservationResource reservation = client.GetReservationResource(reservationResourceId); + + // invoke the operation + ReservationBillingUsageReport result = await reservation.GetBillingReportAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_StoragePoolCollection.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_StoragePoolCollection.cs new file mode 100644 index 000000000000..dea1efd9a6b4 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_StoragePoolCollection.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PureStorageBlock.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.PureStorageBlock.Samples +{ + public partial class Sample_StoragePoolCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_StoragePoolsCreate() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_Create_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePool_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this StoragePoolResource + StoragePoolCollection collection = resourceGroupResource.GetStoragePools(); + + // invoke the operation + string storagePoolName = "storagePoolname"; + StoragePoolData data = new StoragePoolData(new AzureLocation("lonlc")) + { + Properties = new StoragePoolProperties("vknyl", new VnetInjection("tnlctolrxdvnkjiphlrdxq", "zbumtytyqwewjcyckwqchiypshv"), 17L, "xiowoxnbtcotutcmmrofvgdi"), + Identity = new ManagedServiceIdentity("None") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("key4211")] = new UserAssignedIdentity() +}, + }, + Tags = +{ +["key7593"] = "vsyiygyurvwlfaezpuqu" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, storagePoolName, data); + StoragePoolResource 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 + StoragePoolData resourceData = result.Data; + // for 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_StoragePoolsGet() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_Get_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePool_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this StoragePoolResource + StoragePoolCollection collection = resourceGroupResource.GetStoragePools(); + + // invoke the operation + string storagePoolName = "storagePoolname"; + StoragePoolResource result = await collection.GetAsync(storagePoolName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StoragePoolData resourceData = result.Data; + // for 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_StoragePoolsListByResourceGroup() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePool_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 = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this StoragePoolResource + StoragePoolCollection collection = resourceGroupResource.GetStoragePools(); + + // invoke the operation and iterate over the result + await foreach (StoragePoolResource 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 + StoragePoolData 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_StoragePoolsGet() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_Get_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePool_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this StoragePoolResource + StoragePoolCollection collection = resourceGroupResource.GetStoragePools(); + + // invoke the operation + string storagePoolName = "storagePoolname"; + bool result = await collection.ExistsAsync(storagePoolName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_StoragePoolsGet() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_Get_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePool_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this StoragePoolResource + StoragePoolCollection collection = resourceGroupResource.GetStoragePools(); + + // invoke the operation + string storagePoolName = "storagePoolname"; + NullableResponse response = await collection.GetIfExistsAsync(storagePoolName); + StoragePoolResource 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 + StoragePoolData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_StoragePoolResource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_StoragePoolResource.cs new file mode 100644 index 000000000000..93d509500e16 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_StoragePoolResource.cs @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PureStorageBlock.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.PureStorageBlock.Samples +{ + public partial class Sample_StoragePoolResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_StoragePoolsGet() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_Get_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePool_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // invoke the operation + StoragePoolResource result = await storagePool.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 + StoragePoolData resourceData = result.Data; + // for 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_StoragePoolsDelete() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePool_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 StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // invoke the operation + await storagePool.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_StoragePoolsUpdate() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_Update_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePool_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 StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // invoke the operation + StoragePoolPatch patch = new StoragePoolPatch + { + Identity = new ManagedServiceIdentity("None") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("key4211")] = new UserAssignedIdentity() +}, + }, + Tags = +{ +["key9065"] = "ebgmkwxqewe" +}, + StoragePoolUpdateProvisionedBandwidthMbPerSec = 23L, + }; + ArmOperation lro = await storagePool.UpdateAsync(WaitUntil.Completed, patch); + StoragePoolResource 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 + StoragePoolData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetHealthStatus_StoragePoolsGetHealthStatus() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_GetHealthStatus_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePools_GetHealthStatus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // invoke the operation + StoragePoolHealthInfo result = await storagePool.GetHealthStatusAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAvsConnection_StoragePoolsGetAvsConnection() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_GetAvsConnection_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePools_GetAvsConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // invoke the operation + AvsConnection result = await storagePool.GetAvsConnectionAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAvsStatus_StoragePoolsGetAvsStatus() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_GetAvsStatus_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePools_GetAvsStatus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // invoke the operation + AvsStatus result = await storagePool.GetAvsStatusAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task EnableAvsConnection_StoragePoolsEnableAvsConnection() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_EnableAvsConnection_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePools_EnableAvsConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // invoke the operation + StoragePoolEnableAvsConnectionPost properties = new StoragePoolEnableAvsConnectionPost("tghkgktlddwlszbeh"); + await storagePool.EnableAvsConnectionAsync(WaitUntil.Completed, properties); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DisableAvsConnection_StoragePoolsDisableAvsConnection() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_DisableAvsConnection_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePools_DisableAvsConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // invoke the operation + await storagePool.DisableAvsConnectionAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task FinalizeAvsConnection_StoragePoolsFinalizeAvsConnection() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_FinalizeAvsConnection_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePools_FinalizeAvsConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // invoke the operation + StoragePoolFinalizeAvsConnectionPost properties = new StoragePoolFinalizeAvsConnectionPost + { + ServiceInitializationDataEnc = "hlgzaxrohv", + ServiceInitializationData = new ServiceInitializationInfo + { + ServiceAccountUsername = "axchgm", + ServiceAccountPassword = "i", + VSphereIP = "lhbajnykbznxnxpxozyfdjaciennks", + VSphereCertificate = "s", + }, + }; + await storagePool.FinalizeAvsConnectionAsync(WaitUntil.Completed, properties); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task RepairAvsConnection_StoragePoolsRepairAvsConnection() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_RepairAvsConnection_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePools_RepairAvsConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StoragePoolResource created on azure + // for more information of creating StoragePoolResource, please refer to the document of StoragePoolResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + string resourceGroupName = "rgpurestorage"; + string storagePoolName = "storagePoolname"; + ResourceIdentifier storagePoolResourceId = StoragePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, storagePoolName); + StoragePoolResource storagePool = client.GetStoragePoolResource(storagePoolResourceId); + + // invoke the operation + await storagePool.RepairAvsConnectionAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..b4feb81b5265 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/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.PureStorageBlock.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetStoragePools_StoragePoolsListBySubscription() + { + // Generated from example definition: 2024-11-01-preview/StoragePools_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "StoragePool_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "BC47D6CC-AA80-4374-86F8-19D94EC70666"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (StoragePoolResource item in subscriptionResource.GetStoragePoolsAsync()) + { + // 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 + StoragePoolData 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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Azure.ResourceManager.PureStorageBlock.csproj b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Azure.ResourceManager.PureStorageBlock.csproj new file mode 100644 index 000000000000..fd783d26fdf9 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Azure.ResourceManager.PureStorageBlock.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider PureStorageBlock. + 1.0.0-beta.1 + azure;management;arm;resource manager;purestorageblock + Azure.ResourceManager.PureStorageBlock + + diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ArmPureStorageBlockModelFactory.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ArmPureStorageBlockModelFactory.cs new file mode 100644 index 000000000000..386d2fe35f33 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ArmPureStorageBlockModelFactory.cs @@ -0,0 +1,535 @@ +// 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.PureStorageBlock.Models +{ + /// Model factory for models. + public static partial class ArmPureStorageBlockModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static ReservationData ReservationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ReservationPropertiesBaseResourceProperties properties = null) + { + tags ??= new Dictionary(); + + return new ReservationData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Pure Storage's internal ID for the reservation. + /// Marketplace details. + /// User details. + /// Provisioning state of the resource. + /// A new instance for mocking. + public static ReservationPropertiesBaseResourceProperties ReservationPropertiesBaseResourceProperties(string reservationInternalId = null, MarketplaceDetails marketplace = null, UserDetails user = null, ProvisioningState? provisioningState = null) + { + return new ReservationPropertiesBaseResourceProperties(reservationInternalId, marketplace, user, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Marketplace subscription ID. + /// Marketplace subscription status. + /// Offer details of the marketplace subscription. + /// A new instance for mocking. + public static MarketplaceDetails MarketplaceDetails(string subscriptionId = null, MarketplaceSubscriptionStatus? subscriptionStatus = null, OfferDetails offerDetails = null) + { + return new MarketplaceDetails(subscriptionId, subscriptionStatus, offerDetails, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Limits used for storage pool resources. + /// Limits used for volume resources. + /// internal. + /// internal. + /// A new instance for mocking. + public static LimitDetails LimitDetails(StoragePoolLimits storagePool = null, RangeLimits volumeProvisionedSize = null, ProtectionPolicyLimits protectionPolicy = null, PerformancePolicyLimits performancePolicy = null) + { + return new LimitDetails(storagePool, volumeProvisionedSize != null ? new VolumeLimits(volumeProvisionedSize, serializedAdditionalRawData: null) : null, protectionPolicy, performancePolicy, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Allowed provisioned bandwidth range for a storage pool, in MB/s. + /// Allowed provisioned IOPS range for a storage pool, as a number of operations. + /// List of physical availability zones in the region in which storage pools can be deployed; some Azure regions do not support the necessary resources in all availability zones. + /// A new instance for mocking. + public static StoragePoolLimits StoragePoolLimits(RangeLimits provisionedBandwidthMbPerSec = null, RangeLimits provisionedIops = null, IEnumerable physicalAvailabilityZones = null) + { + physicalAvailabilityZones ??= new List(); + + return new StoragePoolLimits(provisionedBandwidthMbPerSec, provisionedIops, physicalAvailabilityZones?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Minimum value of the property. + /// Maximum value of the property. + /// A new instance for mocking. + public static RangeLimits RangeLimits(long min = default, long max = default) + { + return new RangeLimits(min, max, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// internal. + /// internal. + /// A new instance for mocking. + public static ProtectionPolicyLimits ProtectionPolicyLimits(RangeLimits frequency = null, RangeLimits retention = null) + { + return new ProtectionPolicyLimits(frequency, retention, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// internal. + /// internal. + /// A new instance for mocking. + public static PerformancePolicyLimits PerformancePolicyLimits(RangeLimits iopsLimit = null, RangeLimits bandwidthLimit = null) + { + return new PerformancePolicyLimits(iopsLimit, bandwidthLimit, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Timestamp for the latest update of this billing status, in RFC 3339 format. + /// Total used capacity as reported by associated storage pools. In bytes. + /// How many associated storage pools reported low data reduction ratio (DRR). + /// Weighted average of the data-reduction ratio for all associated pools. + /// The sum of total used capacity for all pools with low DRR, if the DRR penalty applies. In bytes. + /// Extra capacity added because of low DRR storage pools; In bytes. + /// Extra capacity added when rounding up low-usage pools to 30TiB. In bytes. + /// Extra capacity discounted due to plan forgiving some low-DRR usage. In bytes. + /// Total used capacity actually billed. In bytes. + /// Total used capacity included in plan. In bytes. + /// Total used capacity reported at on-demand price. In bytes. + /// The sum of all performance settings across the pools under this reservation. In MB per second. + /// Total performance amount included in plan. In bytes per second. + /// Total performance amount reported at on-demand price. In MB per second. + /// A new instance for mocking. + public static ReservationBillingStatus ReservationBillingStatus(string timestamp = null, long totalUsedCapacityReported = default, int lowDrrPoolCount = default, double drrWeightedAverage = default, long totalNonReducibleReported = default, long extraUsedCapacityNonReducible = default, long extraUsedCapacityLowUsageRounding = default, long extraUsedCapacityNonReduciblePlanDiscount = default, long totalUsedCapacityBilled = default, long totalUsedCapacityIncludedPlan = default, long totalUsedCapacityOverage = default, long totalPerformanceReported = default, long totalPerformanceIncludedPlan = default, long totalPerformanceOverage = default) + { + return new ReservationBillingStatus( + timestamp, + totalUsedCapacityReported, + lowDrrPoolCount, + drrWeightedAverage, + totalNonReducibleReported, + extraUsedCapacityNonReducible, + extraUsedCapacityLowUsageRounding, + extraUsedCapacityNonReduciblePlanDiscount, + totalUsedCapacityBilled, + totalUsedCapacityIncludedPlan, + totalUsedCapacityOverage, + totalPerformanceReported, + totalPerformanceIncludedPlan, + totalPerformanceOverage, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Latest formatted billing report for this reservation. + /// A list of detailed billing usage properties. + /// Overall status message of the billing usage report. + /// A new instance for mocking. + public static ReservationBillingUsageReport ReservationBillingUsageReport(string timestamp = null, IEnumerable billingUsageProperties = null, string overallStatusMessage = null) + { + billingUsageProperties ??= new List(); + + return new ReservationBillingUsageReport(timestamp, billingUsageProperties?.ToList(), overallStatusMessage, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique identifier for the billing usage property. + /// Name of the billing usage property. + /// Current value of the billing usage property. + /// Previous value of the billing usage property. + /// Severity level of the usage. + /// Status message for the billing usage against a property. + /// Optional list of sub-properties providing additional details. + /// A new instance for mocking. + public static BillingUsageProperty BillingUsageProperty(string propertyId = null, string propertyName = null, string currentValue = null, string previousValue = null, UsageSeverity severity = default, string statusMessage = null, IEnumerable subProperties = null) + { + subProperties ??= new List(); + + return new BillingUsageProperty( + propertyId, + propertyName, + currentValue, + previousValue, + severity, + statusMessage, + subProperties?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. + /// A new instance for mocking. + public static StoragePoolData StoragePoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, StoragePoolProperties properties = null, ManagedServiceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new StoragePoolData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Pure Storage's internal ID of the storage pool. + /// Azure Availability Zone the Pool is located in. + /// Network properties of the storage pool. + /// How long a destroyed object is kept before being eradicated, in seconds. + /// Total bandwidth provisioned for the pool, in MB/s. + /// Total I/O operations per second (IOPS) provisioned for the pool. + /// AVS connection state summary. + /// Provisioning state of the resource. + /// Azure resource ID of the Pure Storage Cloud service (reservation resource) this storage pool belongs to. + /// A new instance for mocking. + public static StoragePoolProperties StoragePoolProperties(string storagePoolInternalId = null, string availabilityZone = null, VnetInjection vnetInjection = null, long? dataRetentionPeriod = null, long provisionedBandwidthMbPerSec = default, long? provisionedIops = null, AzureVmwareService avs = null, ProvisioningState? provisioningState = null, string reservationResourceId = null) + { + return new StoragePoolProperties( + storagePoolInternalId, + availabilityZone, + vnetInjection, + dataRetentionPeriod, + provisionedBandwidthMbPerSec, + provisionedIops, + avs, + provisioningState, + reservationResourceId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// If true, an AVS SDDC is successfully connected to the storage pool. + /// Azure resource ID of the AVS SDDC the storage pool is connected to. + /// A new instance for mocking. + public static AzureVmwareService AzureVmwareService(bool avsEnabled = default, string clusterResourceId = null) + { + return new AzureVmwareService(avsEnabled, clusterResourceId, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Health metrics. + /// List of health alerts. + /// A new instance for mocking. + public static StoragePoolHealthInfo StoragePoolHealthInfo(HealthDetails health = null, IEnumerable alerts = null) + { + alerts ??= new List(); + + return new StoragePoolHealthInfo(health, alerts?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// How full the pool is right now, in %, compared to the maximum size it can grow to; estimated based on current usage and data reduction ratio. + /// Bandwidth usage metrics. + /// IOPS usage metrics. + /// Storage space usage. + /// Data reduction ratio achieved on this pool. + /// Estimated maximum capacity of the pool, in bytes, based on current usage and data reduction ratio. + /// A new instance for mocking. + public static HealthDetails HealthDetails(double usedCapacityPercentage = default, BandwidthUsage bandwidthUsage = null, IopsUsage iopsUsage = null, Space space = null, double dataReductionRatio = default, long estimatedMaxCapacity = default) + { + return new HealthDetails( + usedCapacityPercentage, + bandwidthUsage, + iopsUsage, + space, + dataReductionRatio, + estimatedMaxCapacity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Number of bytes written and read per second (maximum value over the last 10 minutes). + /// Bandwidth value currently provisioned for the storage pool, in MB/s. + /// Maximum bandwidth value that can be provisioned for the storage pool. + /// A new instance for mocking. + public static BandwidthUsage BandwidthUsage(long current = default, long provisioned = default, long max = default) + { + return new BandwidthUsage(current, provisioned, max, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Current number of IOPS (maximum value over the last 10 minutes). + /// IOPS value currently provisioned for the storage pool. + /// Maximum IOPS value that can be provisioned for the storage pool. + /// A new instance for mocking. + public static IopsUsage IopsUsage(long current = default, long provisioned = default, long max = default) + { + return new IopsUsage(current, provisioned, max, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Total space occupied by customer data (i.e., being billed for), in bytes. + /// Unique space occupied by customer data, in bytes; for a volume, this is the amount of storage that would be freed by deleting the volume, since snapshot and shared data would be kept. + /// Space occupied by data unique to one or more snapshots, in bytes. + /// Space occupied by duplicated data, meaning data shared with other volumes and snapshots as a result of data deduplication, in bytes. + /// A new instance for mocking. + public static Space Space(long totalUsed = default, long unique = default, long snapshots = default, long shared = default) + { + return new Space(totalUsed, unique, snapshots, shared, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Severity level. + /// A short description of the alert. + /// A new instance for mocking. + public static Alert Alert(AlertLevel level = default, string message = null) + { + return new Alert(level, message, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Indicates whether service initialization is complete. + /// Encoded service account credentials alongside connection information. + /// Explicit service account credentials. + /// A new instance for mocking. + public static AvsConnection AvsConnection(bool serviceInitializationCompleted = default, string serviceInitializationHandleEnc = null, ServiceInitializationHandle serviceInitializationHandle = null) + { + return new AvsConnection(serviceInitializationCompleted, serviceInitializationHandleEnc, serviceInitializationHandle, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Azure resource ID of the AVS SDDC the pool is connecting to. + /// Requested service account username. + /// A new instance for mocking. + public static ServiceInitializationHandle ServiceInitializationHandle(string clusterResourceId = null, string serviceAccountUsername = null) + { + return new ServiceInitializationHandle(clusterResourceId, serviceAccountUsername, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// If true, an AVS connection has been successfully completed. + /// Human-readable current AVS connection status. + /// Azure resource ID of the AVS SDDC the pool is connected to. + /// A new instance for mocking. + public static AvsStatus AvsStatus(bool avsEnabled = default, string currentConnectionStatus = null, string clusterResourceId = null) + { + return new AvsStatus(avsEnabled, currentConnectionStatus, clusterResourceId, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static AvsStorageContainerData AvsStorageContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AvsStorageContainerProperties properties = null) + { + return new AvsStorageContainerData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Storage space usage. + /// Name of the storage container. + /// Maximum amount of bytes that can be provisioned in this storage container; it must be a multiple of 512; each time a volume is provisioned in this container, its provisionedSize will be counted against the provisionLimit and the provisioning will fail if it goes over (minimum: 1048576 (1MiB), maximum: 4503599627370496 (4PiB)); by default it is unrestricted. + /// VMware datastore associated with this storage container (if any). + /// Whether the datastore is mounted in VMware or not. + /// A new instance for mocking. + public static AvsStorageContainerProperties AvsStorageContainerProperties(Space space = null, string resourceName = null, long? provisionedLimit = null, string datastore = null, bool? mounted = null) + { + return new AvsStorageContainerProperties( + space, + resourceName, + provisionedLimit, + datastore, + mounted, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// If false, the resource is active; if true, the resource has been destroyed; resources can be soft-deleted by setting destroyed to true, and recovered by setting it to false. + /// Date at which the resource will be eradicated and impossible to recover, as an RFC 3339 timestamp; invalid if destroyed is false;. + /// A new instance for mocking. + public static SoftDeletion SoftDeletion(bool destroyed = default, string eradicationTimestamp = null) + { + return new SoftDeletion(destroyed, eradicationTimestamp, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static AvsStorageContainerVolumeData AvsStorageContainerVolumeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, VolumeProperties properties = null) + { + return new AvsStorageContainerVolumeData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Pure Storage's internal ID for the storage pool containing the volume. + /// Azure Resource ID of the storage pool containing this volume. + /// Pure Storage's internal ID for the volume. + /// Human-readable name of the volume. + /// Storage space usage. + /// Volume's soft-deletion state. + /// Volume creation date, as an RFC 3339 timestamp. + /// Currently provisioned size of the volume, in bytes. + /// Specify which control plane handles the lifecycle of the volume. + /// AVS-specific volume information. + /// Provisioning state of the resource. + /// A new instance for mocking. + public static VolumeProperties VolumeProperties(string storagePoolInternalId = null, string storagePoolResourceId = null, string volumeInternalId = null, string displayName = null, Space space = null, SoftDeletion softDeletion = null, string createdTimestamp = null, long? provisionedSize = null, VolumeType? volumeType = null, AvsDiskDetails avs = null, ResourceProvisioningState? provisioningState = null) + { + return new VolumeProperties( + storagePoolInternalId, + storagePoolResourceId, + volumeInternalId, + displayName, + space, + softDeletion, + createdTimestamp, + provisionedSize, + volumeType, + avs, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// VMware ID of the disk/volume. + /// VMware name of the disk/volume. + /// Name of the top-level folder in the datastore that contains the disk/volume. + /// VMware ID assigned to the disk/volume. + /// Azure resource ID of the AVS VM connected to this disk/volume. + /// Name of the AVS VM connected to this disk/volume. + /// Azure resource ID of the AVS storage container containing this disk/volume. + /// A new instance for mocking. + public static AvsDiskDetails AvsDiskDetails(string diskId = null, string diskName = null, string folder = null, string avsVmInternalId = null, string avsVmResourceId = null, string avsVmName = null, string avsStorageContainerResourceId = null) + { + return new AvsDiskDetails( + diskId, + diskName, + folder, + avsVmInternalId, + avsVmResourceId, + avsVmName, + avsStorageContainerResourceId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static AvsVmData AvsVmData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AvsVmProperties properties = null) + { + return new AvsVmData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Pure Storage's internal ID for the storage pool. + /// Azure resource ID of the storage pool. + /// Human-readable name of the AVS VM. + /// Date at which the AVS VM was created, as an RFC 3339 timestamp. + /// AVS VM's soft-deletion state. + /// Specify which control plane handles the lifecycle of the volume container. + /// AVS VM details. + /// Contains properties related to used Flash space. + /// Provisioning state of the resource. + /// A new instance for mocking. + public static AvsVmProperties AvsVmProperties(string storagePoolInternalId = null, string storagePoolResourceId = null, string displayName = null, string createdTimestamp = null, SoftDeletion softDeletion = null, VolumeContainerType? volumeContainerType = null, AvsVmDetails avs = null, Space space = null, ResourceProvisioningState? provisioningState = null) + { + return new AvsVmProperties( + storagePoolInternalId, + storagePoolResourceId, + displayName, + createdTimestamp, + softDeletion, + volumeContainerType, + avs, + space, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// ID of the AVS VM using this set of volumes. + /// Name of the VMware VM using this set of volumes. + /// Type of the VMware VM using this set of volumes. + /// Pure Storage's internal ID for this AVS VM. + /// A new instance for mocking. + public static AvsVmDetails AvsVmDetails(string vmId = null, string vmName = null, VmType vmType = default, string avsVmInternalId = null) + { + return new AvsVmDetails(vmId, vmName, vmType, avsVmInternalId, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static AvsVmVolumeData AvsVmVolumeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, VolumeProperties properties = null) + { + return new AvsVmVolumeData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerCollection.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerCollection.cs new file mode 100644 index 000000000000..f78c35d233a2 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAvsStorageContainers method from an instance of . + /// + public partial class AvsStorageContainerCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _avsStorageContainerClientDiagnostics; + private readonly AvsStorageContainersRestOperations _avsStorageContainerRestClient; + + /// Initializes a new instance of the class for mocking. + protected AvsStorageContainerCollection() + { + } + + /// 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 AvsStorageContainerCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _avsStorageContainerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PureStorageBlock", AvsStorageContainerResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AvsStorageContainerResource.ResourceType, out string avsStorageContainerApiVersion); + _avsStorageContainerRestClient = new AvsStorageContainersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, avsStorageContainerApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != StoragePoolResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, StoragePoolResource.ResourceType), nameof(id)); + } + + /// + /// Get an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName} + /// + /// + /// Operation Id + /// AvsStorageContainer_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string storageContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + + using var scope = _avsStorageContainerClientDiagnostics.CreateScope("AvsStorageContainerCollection.Get"); + scope.Start(); + try + { + var response = await _avsStorageContainerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, storageContainerName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AvsStorageContainerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName} + /// + /// + /// Operation Id + /// AvsStorageContainer_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string storageContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + + using var scope = _avsStorageContainerClientDiagnostics.CreateScope("AvsStorageContainerCollection.Get"); + scope.Start(); + try + { + var response = _avsStorageContainerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, storageContainerName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AvsStorageContainerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AVS storage containers by storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers + /// + /// + /// Operation Id + /// AvsStorageContainer_ListByStoragePool + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _avsStorageContainerRestClient.CreateListByStoragePoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _avsStorageContainerRestClient.CreateListByStoragePoolNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AvsStorageContainerResource(Client, AvsStorageContainerData.DeserializeAvsStorageContainerData(e)), _avsStorageContainerClientDiagnostics, Pipeline, "AvsStorageContainerCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AVS storage containers by storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers + /// + /// + /// Operation Id + /// AvsStorageContainer_ListByStoragePool + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _avsStorageContainerRestClient.CreateListByStoragePoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _avsStorageContainerRestClient.CreateListByStoragePoolNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AvsStorageContainerResource(Client, AvsStorageContainerData.DeserializeAvsStorageContainerData(e)), _avsStorageContainerClientDiagnostics, Pipeline, "AvsStorageContainerCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName} + /// + /// + /// Operation Id + /// AvsStorageContainer_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string storageContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + + using var scope = _avsStorageContainerClientDiagnostics.CreateScope("AvsStorageContainerCollection.Exists"); + scope.Start(); + try + { + var response = await _avsStorageContainerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, storageContainerName, 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/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName} + /// + /// + /// Operation Id + /// AvsStorageContainer_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string storageContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + + using var scope = _avsStorageContainerClientDiagnostics.CreateScope("AvsStorageContainerCollection.Exists"); + scope.Start(); + try + { + var response = _avsStorageContainerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, storageContainerName, 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/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName} + /// + /// + /// Operation Id + /// AvsStorageContainer_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string storageContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + + using var scope = _avsStorageContainerClientDiagnostics.CreateScope("AvsStorageContainerCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _avsStorageContainerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, storageContainerName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AvsStorageContainerResource(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/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName} + /// + /// + /// Operation Id + /// AvsStorageContainer_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string storageContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + + using var scope = _avsStorageContainerClientDiagnostics.CreateScope("AvsStorageContainerCollection.GetIfExists"); + scope.Start(); + try + { + var response = _avsStorageContainerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, storageContainerName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AvsStorageContainerResource(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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerData.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerData.Serialization.cs new file mode 100644 index 000000000000..bfcc3e4b8f4b --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + public partial class AvsStorageContainerData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(AvsStorageContainerData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + AvsStorageContainerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsStorageContainerData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsStorageContainerData(document.RootElement, options); + } + + internal static AvsStorageContainerData DeserializeAvsStorageContainerData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AvsStorageContainerProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = AvsStorageContainerProperties.DeserializeAvsStorageContainerProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsStorageContainerData( + 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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsStorageContainerData)} does not support writing '{options.Format}' format."); + } + } + + AvsStorageContainerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsStorageContainerData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsStorageContainerData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerData.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerData.cs new file mode 100644 index 000000000000..ce8171061050 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A class representing the AvsStorageContainer data model. + /// AVS storage container resource type, representing a VMware storage container in a storage pool, which can be associated to and mounted as a datastore + /// + public partial class AvsStorageContainerData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AvsStorageContainerData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal AvsStorageContainerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AvsStorageContainerProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public AvsStorageContainerProperties Properties { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerResource.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerResource.Serialization.cs new file mode 100644 index 000000000000..b4ee075453ab --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerResource.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.PureStorageBlock +{ + public partial class AvsStorageContainerResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AvsStorageContainerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerPureStorageBlockContext.Default); + + AvsStorageContainerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerPureStorageBlockContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerResource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerResource.cs new file mode 100644 index 000000000000..1d5e97a15020 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerResource.cs @@ -0,0 +1,324 @@ +// 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.PureStorageBlock +{ + /// + /// A Class representing an AvsStorageContainer along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAvsStorageContainerResource method. + /// Otherwise you can get one from its parent resource using the GetAvsStorageContainer method. + /// + public partial class AvsStorageContainerResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The storagePoolName. + /// The storageContainerName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _avsStorageContainerClientDiagnostics; + private readonly AvsStorageContainersRestOperations _avsStorageContainerRestClient; + private readonly AvsStorageContainerData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "PureStorage.Block/storagePools/avsStorageContainers"; + + /// Initializes a new instance of the class for mocking. + protected AvsStorageContainerResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AvsStorageContainerResource(ArmClient client, AvsStorageContainerData 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 AvsStorageContainerResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _avsStorageContainerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PureStorageBlock", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string avsStorageContainerApiVersion); + _avsStorageContainerRestClient = new AvsStorageContainersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, avsStorageContainerApiVersion); +#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 AvsStorageContainerData 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 AvsStorageContainerVolumeResources in the AvsStorageContainer. + /// An object representing collection of AvsStorageContainerVolumeResources and their operations over a AvsStorageContainerVolumeResource. + public virtual AvsStorageContainerVolumeCollection GetAvsStorageContainerVolumes() + { + return GetCachedClient(client => new AvsStorageContainerVolumeCollection(client, Id)); + } + + /// + /// Get a volume in an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId} + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the storage container. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAvsStorageContainerVolumeAsync(string volumeId, CancellationToken cancellationToken = default) + { + return await GetAvsStorageContainerVolumes().GetAsync(volumeId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a volume in an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId} + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the storage container. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAvsStorageContainerVolume(string volumeId, CancellationToken cancellationToken = default) + { + return GetAvsStorageContainerVolumes().Get(volumeId, cancellationToken); + } + + /// + /// Get an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName} + /// + /// + /// Operation Id + /// AvsStorageContainer_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _avsStorageContainerClientDiagnostics.CreateScope("AvsStorageContainerResource.Get"); + scope.Start(); + try + { + var response = await _avsStorageContainerRestClient.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 AvsStorageContainerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName} + /// + /// + /// Operation Id + /// AvsStorageContainer_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _avsStorageContainerClientDiagnostics.CreateScope("AvsStorageContainerResource.Get"); + scope.Start(); + try + { + var response = _avsStorageContainerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AvsStorageContainerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName} + /// + /// + /// Operation Id + /// AvsStorageContainer_Delete + /// + /// + /// Default Api Version + /// 2024-11-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 = _avsStorageContainerClientDiagnostics.CreateScope("AvsStorageContainerResource.Delete"); + scope.Start(); + try + { + var response = await _avsStorageContainerRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(_avsStorageContainerClientDiagnostics, Pipeline, _avsStorageContainerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName} + /// + /// + /// Operation Id + /// AvsStorageContainer_Delete + /// + /// + /// Default Api Version + /// 2024-11-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 = _avsStorageContainerClientDiagnostics.CreateScope("AvsStorageContainerResource.Delete"); + scope.Start(); + try + { + var response = _avsStorageContainerRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new PureStorageBlockArmOperation(_avsStorageContainerClientDiagnostics, Pipeline, _avsStorageContainerRestClient.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; + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeCollection.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeCollection.cs new file mode 100644 index 000000000000..be140fbd4ef8 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAvsStorageContainerVolumes method from an instance of . + /// + public partial class AvsStorageContainerVolumeCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _avsStorageContainerVolumeClientDiagnostics; + private readonly AvsStorageContainerVolumesRestOperations _avsStorageContainerVolumeRestClient; + + /// Initializes a new instance of the class for mocking. + protected AvsStorageContainerVolumeCollection() + { + } + + /// 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 AvsStorageContainerVolumeCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _avsStorageContainerVolumeClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PureStorageBlock", AvsStorageContainerVolumeResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AvsStorageContainerVolumeResource.ResourceType, out string avsStorageContainerVolumeApiVersion); + _avsStorageContainerVolumeRestClient = new AvsStorageContainerVolumesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, avsStorageContainerVolumeApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != AvsStorageContainerResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, AvsStorageContainerResource.ResourceType), nameof(id)); + } + + /// + /// Get a volume in an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId} + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the storage container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var scope = _avsStorageContainerVolumeClientDiagnostics.CreateScope("AvsStorageContainerVolumeCollection.Get"); + scope.Start(); + try + { + var response = await _avsStorageContainerVolumeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeId, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AvsStorageContainerVolumeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a volume in an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId} + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the storage container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var scope = _avsStorageContainerVolumeClientDiagnostics.CreateScope("AvsStorageContainerVolumeCollection.Get"); + scope.Start(); + try + { + var response = _avsStorageContainerVolumeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeId, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AvsStorageContainerVolumeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List volumes in an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_ListByAvsStorageContainer + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _avsStorageContainerVolumeRestClient.CreateListByAvsStorageContainerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _avsStorageContainerVolumeRestClient.CreateListByAvsStorageContainerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AvsStorageContainerVolumeResource(Client, AvsStorageContainerVolumeData.DeserializeAvsStorageContainerVolumeData(e)), _avsStorageContainerVolumeClientDiagnostics, Pipeline, "AvsStorageContainerVolumeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List volumes in an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_ListByAvsStorageContainer + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _avsStorageContainerVolumeRestClient.CreateListByAvsStorageContainerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _avsStorageContainerVolumeRestClient.CreateListByAvsStorageContainerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AvsStorageContainerVolumeResource(Client, AvsStorageContainerVolumeData.DeserializeAvsStorageContainerVolumeData(e)), _avsStorageContainerVolumeClientDiagnostics, Pipeline, "AvsStorageContainerVolumeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId} + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the storage container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var scope = _avsStorageContainerVolumeClientDiagnostics.CreateScope("AvsStorageContainerVolumeCollection.Exists"); + scope.Start(); + try + { + var response = await _avsStorageContainerVolumeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeId, 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/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId} + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the storage container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var scope = _avsStorageContainerVolumeClientDiagnostics.CreateScope("AvsStorageContainerVolumeCollection.Exists"); + scope.Start(); + try + { + var response = _avsStorageContainerVolumeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeId, 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/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId} + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the storage container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var scope = _avsStorageContainerVolumeClientDiagnostics.CreateScope("AvsStorageContainerVolumeCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _avsStorageContainerVolumeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeId, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AvsStorageContainerVolumeResource(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/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId} + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the storage container. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var scope = _avsStorageContainerVolumeClientDiagnostics.CreateScope("AvsStorageContainerVolumeCollection.GetIfExists"); + scope.Start(); + try + { + var response = _avsStorageContainerVolumeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeId, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AvsStorageContainerVolumeResource(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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeData.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeData.Serialization.cs new file mode 100644 index 000000000000..6d9a5b122e3f --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + public partial class AvsStorageContainerVolumeData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(AvsStorageContainerVolumeData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + AvsStorageContainerVolumeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsStorageContainerVolumeData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsStorageContainerVolumeData(document.RootElement, options); + } + + internal static AvsStorageContainerVolumeData DeserializeAvsStorageContainerVolumeData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + VolumeProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = VolumeProperties.DeserializeVolumeProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsStorageContainerVolumeData( + 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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsStorageContainerVolumeData)} does not support writing '{options.Format}' format."); + } + } + + AvsStorageContainerVolumeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsStorageContainerVolumeData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsStorageContainerVolumeData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeData.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeData.cs new file mode 100644 index 000000000000..04afa4606ccf --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A class representing the AvsStorageContainerVolume data model. + /// A volume contained in an AVS storage container + /// + public partial class AvsStorageContainerVolumeData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AvsStorageContainerVolumeData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal AvsStorageContainerVolumeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, VolumeProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public VolumeProperties Properties { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeResource.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeResource.Serialization.cs new file mode 100644 index 000000000000..eda1799352f3 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeResource.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.PureStorageBlock +{ + public partial class AvsStorageContainerVolumeResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AvsStorageContainerVolumeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerPureStorageBlockContext.Default); + + AvsStorageContainerVolumeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerPureStorageBlockContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeResource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeResource.cs new file mode 100644 index 000000000000..a2c9b4068b0b --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsStorageContainerVolumeResource.cs @@ -0,0 +1,349 @@ +// 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.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A Class representing an AvsStorageContainerVolume along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAvsStorageContainerVolumeResource method. + /// Otherwise you can get one from its parent resource using the GetAvsStorageContainerVolume method. + /// + public partial class AvsStorageContainerVolumeResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The storagePoolName. + /// The storageContainerName. + /// The volumeId. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName, string volumeId) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _avsStorageContainerVolumeClientDiagnostics; + private readonly AvsStorageContainerVolumesRestOperations _avsStorageContainerVolumeRestClient; + private readonly AvsStorageContainerVolumeData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "PureStorage.Block/storagePools/avsStorageContainers/volumes"; + + /// Initializes a new instance of the class for mocking. + protected AvsStorageContainerVolumeResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AvsStorageContainerVolumeResource(ArmClient client, AvsStorageContainerVolumeData 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 AvsStorageContainerVolumeResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _avsStorageContainerVolumeClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PureStorageBlock", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string avsStorageContainerVolumeApiVersion); + _avsStorageContainerVolumeRestClient = new AvsStorageContainerVolumesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, avsStorageContainerVolumeApiVersion); +#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 AvsStorageContainerVolumeData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a volume in an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId} + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _avsStorageContainerVolumeClientDiagnostics.CreateScope("AvsStorageContainerVolumeResource.Get"); + scope.Start(); + try + { + var response = await _avsStorageContainerVolumeRestClient.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 AvsStorageContainerVolumeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a volume in an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId} + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _avsStorageContainerVolumeClientDiagnostics.CreateScope("AvsStorageContainerVolumeResource.Get"); + scope.Start(); + try + { + var response = _avsStorageContainerVolumeRestClient.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 AvsStorageContainerVolumeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a volume in an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId} + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_Delete + /// + /// + /// Default Api Version + /// 2024-11-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 = _avsStorageContainerVolumeClientDiagnostics.CreateScope("AvsStorageContainerVolumeResource.Delete"); + scope.Start(); + try + { + var response = await _avsStorageContainerVolumeRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(_avsStorageContainerVolumeClientDiagnostics, Pipeline, _avsStorageContainerVolumeRestClient.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; + } + } + + /// + /// Delete a volume in an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId} + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_Delete + /// + /// + /// Default Api Version + /// 2024-11-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 = _avsStorageContainerVolumeClientDiagnostics.CreateScope("AvsStorageContainerVolumeResource.Delete"); + scope.Start(); + try + { + var response = _avsStorageContainerVolumeRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new PureStorageBlockArmOperation(_avsStorageContainerVolumeClientDiagnostics, Pipeline, _avsStorageContainerVolumeRestClient.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; + } + } + + /// + /// Update a volume in an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId} + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_Update + /// + /// + /// Default Api Version + /// 2024-11-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, AvsStorageContainerVolumePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _avsStorageContainerVolumeClientDiagnostics.CreateScope("AvsStorageContainerVolumeResource.Update"); + scope.Start(); + try + { + var response = await _avsStorageContainerVolumeRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(new AvsStorageContainerVolumeOperationSource(Client), _avsStorageContainerVolumeClientDiagnostics, Pipeline, _avsStorageContainerVolumeRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a volume in an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName}/volumes/{volumeId} + /// + /// + /// Operation Id + /// AvsStorageContainerVolume_Update + /// + /// + /// Default Api Version + /// 2024-11-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, AvsStorageContainerVolumePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _avsStorageContainerVolumeClientDiagnostics.CreateScope("AvsStorageContainerVolumeResource.Update"); + scope.Start(); + try + { + var response = _avsStorageContainerVolumeRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new PureStorageBlockArmOperation(new AvsStorageContainerVolumeOperationSource(Client), _avsStorageContainerVolumeClientDiagnostics, Pipeline, _avsStorageContainerVolumeRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmCollection.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmCollection.cs new file mode 100644 index 000000000000..1dc13dd8f203 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAvsVms method from an instance of . + /// + public partial class AvsVmCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _avsVmClientDiagnostics; + private readonly AvsVmsRestOperations _avsVmRestClient; + + /// Initializes a new instance of the class for mocking. + protected AvsVmCollection() + { + } + + /// 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 AvsVmCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _avsVmClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PureStorageBlock", AvsVmResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AvsVmResource.ResourceType, out string avsVmApiVersion); + _avsVmRestClient = new AvsVmsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, avsVmApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != StoragePoolResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, StoragePoolResource.ResourceType), nameof(id)); + } + + /// + /// Get an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId} + /// + /// + /// Operation Id + /// AvsVm_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the AVS VM. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string avsVmId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + + using var scope = _avsVmClientDiagnostics.CreateScope("AvsVmCollection.Get"); + scope.Start(); + try + { + var response = await _avsVmRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, avsVmId, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AvsVmResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId} + /// + /// + /// Operation Id + /// AvsVm_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the AVS VM. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string avsVmId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + + using var scope = _avsVmClientDiagnostics.CreateScope("AvsVmCollection.Get"); + scope.Start(); + try + { + var response = _avsVmRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, avsVmId, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AvsVmResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AVS VMs by storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms + /// + /// + /// Operation Id + /// AvsVm_ListByStoragePool + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _avsVmRestClient.CreateListByStoragePoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _avsVmRestClient.CreateListByStoragePoolNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AvsVmResource(Client, AvsVmData.DeserializeAvsVmData(e)), _avsVmClientDiagnostics, Pipeline, "AvsVmCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AVS VMs by storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms + /// + /// + /// Operation Id + /// AvsVm_ListByStoragePool + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _avsVmRestClient.CreateListByStoragePoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _avsVmRestClient.CreateListByStoragePoolNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AvsVmResource(Client, AvsVmData.DeserializeAvsVmData(e)), _avsVmClientDiagnostics, Pipeline, "AvsVmCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId} + /// + /// + /// Operation Id + /// AvsVm_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the AVS VM. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string avsVmId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + + using var scope = _avsVmClientDiagnostics.CreateScope("AvsVmCollection.Exists"); + scope.Start(); + try + { + var response = await _avsVmRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, avsVmId, 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/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId} + /// + /// + /// Operation Id + /// AvsVm_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the AVS VM. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string avsVmId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + + using var scope = _avsVmClientDiagnostics.CreateScope("AvsVmCollection.Exists"); + scope.Start(); + try + { + var response = _avsVmRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, avsVmId, 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/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId} + /// + /// + /// Operation Id + /// AvsVm_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the AVS VM. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string avsVmId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + + using var scope = _avsVmClientDiagnostics.CreateScope("AvsVmCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _avsVmRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, avsVmId, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AvsVmResource(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/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId} + /// + /// + /// Operation Id + /// AvsVm_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the AVS VM. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string avsVmId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + + using var scope = _avsVmClientDiagnostics.CreateScope("AvsVmCollection.GetIfExists"); + scope.Start(); + try + { + var response = _avsVmRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, avsVmId, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AvsVmResource(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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmData.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmData.Serialization.cs new file mode 100644 index 000000000000..437d07cb6f16 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + public partial class AvsVmData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(AvsVmData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + AvsVmData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsVmData(document.RootElement, options); + } + + internal static AvsVmData DeserializeAvsVmData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AvsVmProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = AvsVmProperties.DeserializeAvsVmProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsVmData( + 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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsVmData)} does not support writing '{options.Format}' format."); + } + } + + AvsVmData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsVmData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsVmData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmData.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmData.cs new file mode 100644 index 000000000000..876f7adccc2c --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A class representing the AvsVm data model. + /// AVS VM resource type, representing all the volumes associated to an AVS VM as defined by VMware + /// + public partial class AvsVmData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AvsVmData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal AvsVmData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AvsVmProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public AvsVmProperties Properties { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmResource.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmResource.Serialization.cs new file mode 100644 index 000000000000..a6005a9bfcd0 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmResource.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.PureStorageBlock +{ + public partial class AvsVmResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AvsVmData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerPureStorageBlockContext.Default); + + AvsVmData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerPureStorageBlockContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmResource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmResource.cs new file mode 100644 index 000000000000..e13f5d6cb48e --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmResource.cs @@ -0,0 +1,417 @@ +// 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.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A Class representing an AvsVm along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAvsVmResource method. + /// Otherwise you can get one from its parent resource using the GetAvsVm method. + /// + public partial class AvsVmResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The storagePoolName. + /// The avsVmId. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _avsVmClientDiagnostics; + private readonly AvsVmsRestOperations _avsVmRestClient; + private readonly AvsVmData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "PureStorage.Block/storagePools/avsVms"; + + /// Initializes a new instance of the class for mocking. + protected AvsVmResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AvsVmResource(ArmClient client, AvsVmData 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 AvsVmResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _avsVmClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PureStorageBlock", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string avsVmApiVersion); + _avsVmRestClient = new AvsVmsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, avsVmApiVersion); +#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 AvsVmData 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 AvsVmVolumeResources in the AvsVm. + /// An object representing collection of AvsVmVolumeResources and their operations over a AvsVmVolumeResource. + public virtual AvsVmVolumeCollection GetAvsVmVolumes() + { + return GetCachedClient(client => new AvsVmVolumeCollection(client, Id)); + } + + /// + /// Get a volume in an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId} + /// + /// + /// Operation Id + /// AvsVmVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the AVS VM. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAvsVmVolumeAsync(string volumeId, CancellationToken cancellationToken = default) + { + return await GetAvsVmVolumes().GetAsync(volumeId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a volume in an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId} + /// + /// + /// Operation Id + /// AvsVmVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the AVS VM. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAvsVmVolume(string volumeId, CancellationToken cancellationToken = default) + { + return GetAvsVmVolumes().Get(volumeId, cancellationToken); + } + + /// + /// Get an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId} + /// + /// + /// Operation Id + /// AvsVm_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _avsVmClientDiagnostics.CreateScope("AvsVmResource.Get"); + scope.Start(); + try + { + var response = await _avsVmRestClient.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 AvsVmResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId} + /// + /// + /// Operation Id + /// AvsVm_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _avsVmClientDiagnostics.CreateScope("AvsVmResource.Get"); + scope.Start(); + try + { + var response = _avsVmRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AvsVmResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId} + /// + /// + /// Operation Id + /// AvsVm_Delete + /// + /// + /// Default Api Version + /// 2024-11-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 = _avsVmClientDiagnostics.CreateScope("AvsVmResource.Delete"); + scope.Start(); + try + { + var response = await _avsVmRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(_avsVmClientDiagnostics, Pipeline, _avsVmRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId} + /// + /// + /// Operation Id + /// AvsVm_Delete + /// + /// + /// Default Api Version + /// 2024-11-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 = _avsVmClientDiagnostics.CreateScope("AvsVmResource.Delete"); + scope.Start(); + try + { + var response = _avsVmRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new PureStorageBlockArmOperation(_avsVmClientDiagnostics, Pipeline, _avsVmRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId} + /// + /// + /// Operation Id + /// AvsVm_Update + /// + /// + /// Default Api Version + /// 2024-11-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, AvsVmPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _avsVmClientDiagnostics.CreateScope("AvsVmResource.Update"); + scope.Start(); + try + { + var response = await _avsVmRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(new AvsVmOperationSource(Client), _avsVmClientDiagnostics, Pipeline, _avsVmRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId} + /// + /// + /// Operation Id + /// AvsVm_Update + /// + /// + /// Default Api Version + /// 2024-11-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, AvsVmPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _avsVmClientDiagnostics.CreateScope("AvsVmResource.Update"); + scope.Start(); + try + { + var response = _avsVmRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new PureStorageBlockArmOperation(new AvsVmOperationSource(Client), _avsVmClientDiagnostics, Pipeline, _avsVmRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeCollection.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeCollection.cs new file mode 100644 index 000000000000..b1bbbae42b51 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAvsVmVolumes method from an instance of . + /// + public partial class AvsVmVolumeCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _avsVmVolumeClientDiagnostics; + private readonly AvsVmVolumesRestOperations _avsVmVolumeRestClient; + + /// Initializes a new instance of the class for mocking. + protected AvsVmVolumeCollection() + { + } + + /// 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 AvsVmVolumeCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _avsVmVolumeClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PureStorageBlock", AvsVmVolumeResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AvsVmVolumeResource.ResourceType, out string avsVmVolumeApiVersion); + _avsVmVolumeRestClient = new AvsVmVolumesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, avsVmVolumeApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != AvsVmResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, AvsVmResource.ResourceType), nameof(id)); + } + + /// + /// Get a volume in an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId} + /// + /// + /// Operation Id + /// AvsVmVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the AVS VM. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var scope = _avsVmVolumeClientDiagnostics.CreateScope("AvsVmVolumeCollection.Get"); + scope.Start(); + try + { + var response = await _avsVmVolumeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeId, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AvsVmVolumeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a volume in an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId} + /// + /// + /// Operation Id + /// AvsVmVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the AVS VM. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var scope = _avsVmVolumeClientDiagnostics.CreateScope("AvsVmVolumeCollection.Get"); + scope.Start(); + try + { + var response = _avsVmVolumeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeId, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AvsVmVolumeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List volumes in an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes + /// + /// + /// Operation Id + /// AvsVmVolume_ListByAvsVm + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _avsVmVolumeRestClient.CreateListByAvsVmRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _avsVmVolumeRestClient.CreateListByAvsVmNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AvsVmVolumeResource(Client, AvsVmVolumeData.DeserializeAvsVmVolumeData(e)), _avsVmVolumeClientDiagnostics, Pipeline, "AvsVmVolumeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List volumes in an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes + /// + /// + /// Operation Id + /// AvsVmVolume_ListByAvsVm + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _avsVmVolumeRestClient.CreateListByAvsVmRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _avsVmVolumeRestClient.CreateListByAvsVmNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AvsVmVolumeResource(Client, AvsVmVolumeData.DeserializeAvsVmVolumeData(e)), _avsVmVolumeClientDiagnostics, Pipeline, "AvsVmVolumeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId} + /// + /// + /// Operation Id + /// AvsVmVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the AVS VM. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var scope = _avsVmVolumeClientDiagnostics.CreateScope("AvsVmVolumeCollection.Exists"); + scope.Start(); + try + { + var response = await _avsVmVolumeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeId, 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/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId} + /// + /// + /// Operation Id + /// AvsVmVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the AVS VM. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var scope = _avsVmVolumeClientDiagnostics.CreateScope("AvsVmVolumeCollection.Exists"); + scope.Start(); + try + { + var response = _avsVmVolumeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeId, 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/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId} + /// + /// + /// Operation Id + /// AvsVmVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the AVS VM. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var scope = _avsVmVolumeClientDiagnostics.CreateScope("AvsVmVolumeCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _avsVmVolumeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeId, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AvsVmVolumeResource(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/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId} + /// + /// + /// Operation Id + /// AvsVmVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the volume in the AVS VM. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var scope = _avsVmVolumeClientDiagnostics.CreateScope("AvsVmVolumeCollection.GetIfExists"); + scope.Start(); + try + { + var response = _avsVmVolumeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeId, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AvsVmVolumeResource(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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeData.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeData.Serialization.cs new file mode 100644 index 000000000000..bfc7b6495ed0 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + public partial class AvsVmVolumeData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(AvsVmVolumeData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + AvsVmVolumeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmVolumeData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsVmVolumeData(document.RootElement, options); + } + + internal static AvsVmVolumeData DeserializeAvsVmVolumeData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + VolumeProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = VolumeProperties.DeserializeVolumeProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsVmVolumeData( + 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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsVmVolumeData)} does not support writing '{options.Format}' format."); + } + } + + AvsVmVolumeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsVmVolumeData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsVmVolumeData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeData.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeData.cs new file mode 100644 index 000000000000..dd4f871b5cb6 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A class representing the AvsVmVolume data model. + /// Any volume associated to a particular AVS VM + /// + public partial class AvsVmVolumeData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AvsVmVolumeData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal AvsVmVolumeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, VolumeProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public VolumeProperties Properties { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeResource.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeResource.Serialization.cs new file mode 100644 index 000000000000..e9cffcdeeb38 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeResource.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.PureStorageBlock +{ + public partial class AvsVmVolumeResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AvsVmVolumeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerPureStorageBlockContext.Default); + + AvsVmVolumeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerPureStorageBlockContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeResource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeResource.cs new file mode 100644 index 000000000000..ad083aebf808 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/AvsVmVolumeResource.cs @@ -0,0 +1,349 @@ +// 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.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A Class representing an AvsVmVolume along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAvsVmVolumeResource method. + /// Otherwise you can get one from its parent resource using the GetAvsVmVolume method. + /// + public partial class AvsVmVolumeResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The storagePoolName. + /// The avsVmId. + /// The volumeId. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, string volumeId) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _avsVmVolumeClientDiagnostics; + private readonly AvsVmVolumesRestOperations _avsVmVolumeRestClient; + private readonly AvsVmVolumeData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "PureStorage.Block/storagePools/avsVms/avsVmVolumes"; + + /// Initializes a new instance of the class for mocking. + protected AvsVmVolumeResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AvsVmVolumeResource(ArmClient client, AvsVmVolumeData 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 AvsVmVolumeResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _avsVmVolumeClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PureStorageBlock", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string avsVmVolumeApiVersion); + _avsVmVolumeRestClient = new AvsVmVolumesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, avsVmVolumeApiVersion); +#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 AvsVmVolumeData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a volume in an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId} + /// + /// + /// Operation Id + /// AvsVmVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _avsVmVolumeClientDiagnostics.CreateScope("AvsVmVolumeResource.Get"); + scope.Start(); + try + { + var response = await _avsVmVolumeRestClient.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 AvsVmVolumeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a volume in an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId} + /// + /// + /// Operation Id + /// AvsVmVolume_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _avsVmVolumeClientDiagnostics.CreateScope("AvsVmVolumeResource.Get"); + scope.Start(); + try + { + var response = _avsVmVolumeRestClient.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 AvsVmVolumeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a volume in an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId} + /// + /// + /// Operation Id + /// AvsVmVolume_Delete + /// + /// + /// Default Api Version + /// 2024-11-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 = _avsVmVolumeClientDiagnostics.CreateScope("AvsVmVolumeResource.Delete"); + scope.Start(); + try + { + var response = await _avsVmVolumeRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(_avsVmVolumeClientDiagnostics, Pipeline, _avsVmVolumeRestClient.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; + } + } + + /// + /// Delete a volume in an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId} + /// + /// + /// Operation Id + /// AvsVmVolume_Delete + /// + /// + /// Default Api Version + /// 2024-11-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 = _avsVmVolumeClientDiagnostics.CreateScope("AvsVmVolumeResource.Delete"); + scope.Start(); + try + { + var response = _avsVmVolumeRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new PureStorageBlockArmOperation(_avsVmVolumeClientDiagnostics, Pipeline, _avsVmVolumeRestClient.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; + } + } + + /// + /// Update a volume in an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId} + /// + /// + /// Operation Id + /// AvsVmVolume_Update + /// + /// + /// Default Api Version + /// 2024-11-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, AvsVmVolumePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _avsVmVolumeClientDiagnostics.CreateScope("AvsVmVolumeResource.Update"); + scope.Start(); + try + { + var response = await _avsVmVolumeRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(new AvsVmVolumeOperationSource(Client), _avsVmVolumeClientDiagnostics, Pipeline, _avsVmVolumeRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a volume in an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId}/avsVmVolumes/{volumeId} + /// + /// + /// Operation Id + /// AvsVmVolume_Update + /// + /// + /// Default Api Version + /// 2024-11-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, AvsVmVolumePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _avsVmVolumeClientDiagnostics.CreateScope("AvsVmVolumeResource.Update"); + scope.Start(); + try + { + var response = _avsVmVolumeRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new PureStorageBlockArmOperation(new AvsVmVolumeOperationSource(Client), _avsVmVolumeClientDiagnostics, Pipeline, _avsVmVolumeRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/MockablePureStorageBlockArmClient.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/MockablePureStorageBlockArmClient.cs new file mode 100644 index 000000000000..f453407ef77a --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/MockablePureStorageBlockArmClient.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockablePureStorageBlockArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockablePureStorageBlockArmClient() + { + } + + /// 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 MockablePureStorageBlockArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockablePureStorageBlockArmClient(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 ReservationResource GetReservationResource(ResourceIdentifier id) + { + ReservationResource.ValidateResourceId(id); + return new ReservationResource(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 StoragePoolResource GetStoragePoolResource(ResourceIdentifier id) + { + StoragePoolResource.ValidateResourceId(id); + return new StoragePoolResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AvsStorageContainerResource GetAvsStorageContainerResource(ResourceIdentifier id) + { + AvsStorageContainerResource.ValidateResourceId(id); + return new AvsStorageContainerResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AvsStorageContainerVolumeResource GetAvsStorageContainerVolumeResource(ResourceIdentifier id) + { + AvsStorageContainerVolumeResource.ValidateResourceId(id); + return new AvsStorageContainerVolumeResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AvsVmResource GetAvsVmResource(ResourceIdentifier id) + { + AvsVmResource.ValidateResourceId(id); + return new AvsVmResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AvsVmVolumeResource GetAvsVmVolumeResource(ResourceIdentifier id) + { + AvsVmVolumeResource.ValidateResourceId(id); + return new AvsVmVolumeResource(Client, id); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/MockablePureStorageBlockResourceGroupResource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/MockablePureStorageBlockResourceGroupResource.cs new file mode 100644 index 000000000000..991ad2456cea --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/MockablePureStorageBlockResourceGroupResource.cs @@ -0,0 +1,174 @@ +// 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.PureStorageBlock.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockablePureStorageBlockResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockablePureStorageBlockResourceGroupResource() + { + } + + /// 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 MockablePureStorageBlockResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ReservationResources in the ResourceGroupResource. + /// An object representing collection of ReservationResources and their operations over a ReservationResource. + public virtual ReservationCollection GetReservations() + { + return GetCachedClient(client => new ReservationCollection(client, Id)); + } + + /// + /// Get a reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the reservation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetReservationAsync(string reservationName, CancellationToken cancellationToken = default) + { + return await GetReservations().GetAsync(reservationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the reservation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetReservation(string reservationName, CancellationToken cancellationToken = default) + { + return GetReservations().Get(reservationName, cancellationToken); + } + + /// Gets a collection of StoragePoolResources in the ResourceGroupResource. + /// An object representing collection of StoragePoolResources and their operations over a StoragePoolResource. + public virtual StoragePoolCollection GetStoragePools() + { + return GetCachedClient(client => new StoragePoolCollection(client, Id)); + } + + /// + /// Get a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage pool. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetStoragePoolAsync(string storagePoolName, CancellationToken cancellationToken = default) + { + return await GetStoragePools().GetAsync(storagePoolName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage pool. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetStoragePool(string storagePoolName, CancellationToken cancellationToken = default) + { + return GetStoragePools().Get(storagePoolName, cancellationToken); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/MockablePureStorageBlockSubscriptionResource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/MockablePureStorageBlockSubscriptionResource.cs new file mode 100644 index 000000000000..feb1635e9487 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/MockablePureStorageBlockSubscriptionResource.cs @@ -0,0 +1,166 @@ +// 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.PureStorageBlock.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockablePureStorageBlockSubscriptionResource : ArmResource + { + private ClientDiagnostics _reservationClientDiagnostics; + private ReservationsRestOperations _reservationRestClient; + private ClientDiagnostics _storagePoolClientDiagnostics; + private StoragePoolsRestOperations _storagePoolRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockablePureStorageBlockSubscriptionResource() + { + } + + /// 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 MockablePureStorageBlockSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics ReservationClientDiagnostics => _reservationClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.PureStorageBlock", ReservationResource.ResourceType.Namespace, Diagnostics); + private ReservationsRestOperations ReservationRestClient => _reservationRestClient ??= new ReservationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ReservationResource.ResourceType)); + private ClientDiagnostics StoragePoolClientDiagnostics => _storagePoolClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.PureStorageBlock", StoragePoolResource.ResourceType.Namespace, Diagnostics); + private StoragePoolsRestOperations StoragePoolRestClient => _storagePoolRestClient ??= new StoragePoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(StoragePoolResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List reservations by Azure subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/PureStorage.Block/reservations + /// + /// + /// Operation Id + /// Reservation_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetReservationsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ReservationResource(Client, ReservationData.DeserializeReservationData(e)), ReservationClientDiagnostics, Pipeline, "MockablePureStorageBlockSubscriptionResource.GetReservations", "value", "nextLink", cancellationToken); + } + + /// + /// List reservations by Azure subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/PureStorage.Block/reservations + /// + /// + /// Operation Id + /// Reservation_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetReservations(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ReservationResource(Client, ReservationData.DeserializeReservationData(e)), ReservationClientDiagnostics, Pipeline, "MockablePureStorageBlockSubscriptionResource.GetReservations", "value", "nextLink", cancellationToken); + } + + /// + /// List storage pools by Azure subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/PureStorage.Block/storagePools + /// + /// + /// Operation Id + /// StoragePool_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetStoragePoolsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => StoragePoolRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StoragePoolRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StoragePoolResource(Client, StoragePoolData.DeserializeStoragePoolData(e)), StoragePoolClientDiagnostics, Pipeline, "MockablePureStorageBlockSubscriptionResource.GetStoragePools", "value", "nextLink", cancellationToken); + } + + /// + /// List storage pools by Azure subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/PureStorage.Block/storagePools + /// + /// + /// Operation Id + /// StoragePool_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetStoragePools(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => StoragePoolRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StoragePoolRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StoragePoolResource(Client, StoragePoolData.DeserializeStoragePoolData(e)), StoragePoolClientDiagnostics, Pipeline, "MockablePureStorageBlockSubscriptionResource.GetStoragePools", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/PureStorageBlockExtensions.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/PureStorageBlockExtensions.cs new file mode 100644 index 000000000000..0253af0daf16 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Extensions/PureStorageBlockExtensions.cs @@ -0,0 +1,479 @@ +// 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.PureStorageBlock.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// A class to add extension methods to Azure.ResourceManager.PureStorageBlock. + public static partial class PureStorageBlockExtensions + { + private static MockablePureStorageBlockArmClient GetMockablePureStorageBlockArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockablePureStorageBlockArmClient(client0)); + } + + private static MockablePureStorageBlockResourceGroupResource GetMockablePureStorageBlockResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockablePureStorageBlockResourceGroupResource(client, resource.Id)); + } + + private static MockablePureStorageBlockSubscriptionResource GetMockablePureStorageBlockSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockablePureStorageBlockSubscriptionResource(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 ReservationResource GetReservationResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockablePureStorageBlockArmClient(client).GetReservationResource(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 StoragePoolResource GetStoragePoolResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockablePureStorageBlockArmClient(client).GetStoragePoolResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AvsStorageContainerResource GetAvsStorageContainerResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockablePureStorageBlockArmClient(client).GetAvsStorageContainerResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AvsStorageContainerVolumeResource GetAvsStorageContainerVolumeResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockablePureStorageBlockArmClient(client).GetAvsStorageContainerVolumeResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AvsVmResource GetAvsVmResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockablePureStorageBlockArmClient(client).GetAvsVmResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AvsVmVolumeResource GetAvsVmVolumeResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockablePureStorageBlockArmClient(client).GetAvsVmVolumeResource(id); + } + + /// + /// Gets a collection of ReservationResources 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 ReservationResources and their operations over a ReservationResource. + public static ReservationCollection GetReservations(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockablePureStorageBlockResourceGroupResource(resourceGroupResource).GetReservations(); + } + + /// + /// Get a reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the reservation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetReservationAsync(this ResourceGroupResource resourceGroupResource, string reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockablePureStorageBlockResourceGroupResource(resourceGroupResource).GetReservationAsync(reservationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the reservation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetReservation(this ResourceGroupResource resourceGroupResource, string reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockablePureStorageBlockResourceGroupResource(resourceGroupResource).GetReservation(reservationName, cancellationToken); + } + + /// + /// Gets a collection of StoragePoolResources 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 StoragePoolResources and their operations over a StoragePoolResource. + public static StoragePoolCollection GetStoragePools(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockablePureStorageBlockResourceGroupResource(resourceGroupResource).GetStoragePools(); + } + + /// + /// Get a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the storage pool. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetStoragePoolAsync(this ResourceGroupResource resourceGroupResource, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockablePureStorageBlockResourceGroupResource(resourceGroupResource).GetStoragePoolAsync(storagePoolName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the storage pool. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetStoragePool(this ResourceGroupResource resourceGroupResource, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockablePureStorageBlockResourceGroupResource(resourceGroupResource).GetStoragePool(storagePoolName, cancellationToken); + } + + /// + /// List reservations by Azure subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/PureStorage.Block/reservations + /// + /// + /// Operation Id + /// Reservation_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-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 GetReservationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockablePureStorageBlockSubscriptionResource(subscriptionResource).GetReservationsAsync(cancellationToken); + } + + /// + /// List reservations by Azure subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/PureStorage.Block/reservations + /// + /// + /// Operation Id + /// Reservation_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-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 GetReservations(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockablePureStorageBlockSubscriptionResource(subscriptionResource).GetReservations(cancellationToken); + } + + /// + /// List storage pools by Azure subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/PureStorage.Block/storagePools + /// + /// + /// Operation Id + /// StoragePool_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-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 GetStoragePoolsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockablePureStorageBlockSubscriptionResource(subscriptionResource).GetStoragePoolsAsync(cancellationToken); + } + + /// + /// List storage pools by Azure subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/PureStorage.Block/storagePools + /// + /// + /// Operation Id + /// StoragePool_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-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 GetStoragePools(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockablePureStorageBlockSubscriptionResource(subscriptionResource).GetStoragePools(cancellationToken); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/Argument.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..c8664855aa7e --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/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.PureStorageBlock +{ + 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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..892c4f25ead6 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/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.PureStorageBlock +{ + 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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/ChangeTrackingList.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..531b34d1a503 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/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.PureStorageBlock +{ + 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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..7de4584b6bbd --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock +{ + internal static class ModelSerializationExtensions + { + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray()); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static bool IsSentinelValue(BinaryData value) + { + ReadOnlySpan sentinelSpan = SentinelValue.ToMemory().Span; + ReadOnlySpan valueSpan = value.ToMemory().Span; + return sentinelSpan.SequenceEqual(valueSpan); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/Optional.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..c4c31c9387d4 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/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.PureStorageBlock +{ + 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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..cf57027efd64 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/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.PureStorageBlock +{ + 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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/AvsStorageContainerVolumeOperationSource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/AvsStorageContainerVolumeOperationSource.cs new file mode 100644 index 000000000000..38a05e3db84c --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/AvsStorageContainerVolumeOperationSource.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.PureStorageBlock +{ + internal class AvsStorageContainerVolumeOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal AvsStorageContainerVolumeOperationSource(ArmClient client) + { + _client = client; + } + + AvsStorageContainerVolumeResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPureStorageBlockContext.Default); + return new AvsStorageContainerVolumeResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPureStorageBlockContext.Default); + return await Task.FromResult(new AvsStorageContainerVolumeResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/AvsVmOperationSource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/AvsVmOperationSource.cs new file mode 100644 index 000000000000..db92295d2099 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/AvsVmOperationSource.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.PureStorageBlock +{ + internal class AvsVmOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal AvsVmOperationSource(ArmClient client) + { + _client = client; + } + + AvsVmResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPureStorageBlockContext.Default); + return new AvsVmResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPureStorageBlockContext.Default); + return await Task.FromResult(new AvsVmResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/AvsVmVolumeOperationSource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/AvsVmVolumeOperationSource.cs new file mode 100644 index 000000000000..9d28144efae8 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/AvsVmVolumeOperationSource.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.PureStorageBlock +{ + internal class AvsVmVolumeOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal AvsVmVolumeOperationSource(ArmClient client) + { + _client = client; + } + + AvsVmVolumeResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPureStorageBlockContext.Default); + return new AvsVmVolumeResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPureStorageBlockContext.Default); + return await Task.FromResult(new AvsVmVolumeResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/PureStorageBlockArmOperation.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/PureStorageBlockArmOperation.cs new file mode 100644 index 000000000000..700031e29f83 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/PureStorageBlockArmOperation.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.PureStorageBlock +{ +#pragma warning disable SA1649 // File name should match first type name + internal class PureStorageBlockArmOperation : 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 PureStorageBlockArmOperation for mocking. + protected PureStorageBlockArmOperation() + { + } + + internal PureStorageBlockArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal PureStorageBlockArmOperation(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, "PureStorageBlockArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerPureStorageBlockContext.Default).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/PureStorageBlockArmOperationOfT.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/PureStorageBlockArmOperationOfT.cs new file mode 100644 index 000000000000..f83ed894f669 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/PureStorageBlockArmOperationOfT.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.PureStorageBlock +{ +#pragma warning disable SA1649 // File name should match first type name + internal class PureStorageBlockArmOperation : 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 PureStorageBlockArmOperation for mocking. + protected PureStorageBlockArmOperation() + { + } + + internal PureStorageBlockArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal PureStorageBlockArmOperation(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, "PureStorageBlockArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerPureStorageBlockContext.Default).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/ReservationOperationSource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/ReservationOperationSource.cs new file mode 100644 index 000000000000..a281a3edc3fc --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/ReservationOperationSource.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.PureStorageBlock +{ + internal class ReservationOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ReservationOperationSource(ArmClient client) + { + _client = client; + } + + ReservationResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPureStorageBlockContext.Default); + return new ReservationResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPureStorageBlockContext.Default); + return await Task.FromResult(new ReservationResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/StoragePoolOperationSource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/StoragePoolOperationSource.cs new file mode 100644 index 000000000000..8c56fb3ed99a --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/LongRunningOperation/StoragePoolOperationSource.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.PureStorageBlock +{ + internal class StoragePoolOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal StoragePoolOperationSource(ArmClient client) + { + _client = client; + } + + StoragePoolResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPureStorageBlockContext.Default); + return new StoragePoolResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPureStorageBlockContext.Default); + return await Task.FromResult(new StoragePoolResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Address.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Address.Serialization.cs new file mode 100644 index 000000000000..f0c373124fb5 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Address.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class Address : IUtf8JsonSerializable, IJsonModel
+ { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel
)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel
.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel
)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Address)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("addressLine1"u8); + writer.WriteStringValue(AddressLine1); + if (Optional.IsDefined(AddressLine2)) + { + writer.WritePropertyName("addressLine2"u8); + writer.WriteStringValue(AddressLine2); + } + writer.WritePropertyName("city"u8); + writer.WriteStringValue(City); + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State); + writer.WritePropertyName("country"u8); + writer.WriteStringValue(Country); + writer.WritePropertyName("postalCode"u8); + writer.WriteStringValue(PostalCode); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Address IJsonModel
.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel
)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Address)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAddress(document.RootElement, options); + } + + internal static Address DeserializeAddress(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string addressLine1 = default; + string addressLine2 = default; + string city = default; + string state = default; + string country = default; + string postalCode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("addressLine1"u8)) + { + addressLine1 = property.Value.GetString(); + continue; + } + if (property.NameEquals("addressLine2"u8)) + { + addressLine2 = property.Value.GetString(); + continue; + } + if (property.NameEquals("city"u8)) + { + city = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString(); + continue; + } + if (property.NameEquals("country"u8)) + { + country = property.Value.GetString(); + continue; + } + if (property.NameEquals("postalCode"u8)) + { + postalCode = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Address( + addressLine1, + addressLine2, + city, + state, + country, + postalCode, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel
.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel
)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(Address)} does not support writing '{options.Format}' format."); + } + } + + Address IPersistableModel
.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel
)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAddress(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Address)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel
.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Address.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Address.cs new file mode 100644 index 000000000000..2adc0e5c51df --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Address.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Address details. + public partial class Address + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Address line 1. + /// Name of the city. + /// State (if any). + /// Name of the country. + /// Postal code. + /// , , , or is null. + public Address(string addressLine1, string city, string state, string country, string postalCode) + { + Argument.AssertNotNull(addressLine1, nameof(addressLine1)); + Argument.AssertNotNull(city, nameof(city)); + Argument.AssertNotNull(state, nameof(state)); + Argument.AssertNotNull(country, nameof(country)); + Argument.AssertNotNull(postalCode, nameof(postalCode)); + + AddressLine1 = addressLine1; + City = city; + State = state; + Country = country; + PostalCode = postalCode; + } + + /// Initializes a new instance of . + /// Address line 1. + /// Address line 2. + /// Name of the city. + /// State (if any). + /// Name of the country. + /// Postal code. + /// Keeps track of any properties unknown to the library. + internal Address(string addressLine1, string addressLine2, string city, string state, string country, string postalCode, IDictionary serializedAdditionalRawData) + { + AddressLine1 = addressLine1; + AddressLine2 = addressLine2; + City = city; + State = state; + Country = country; + PostalCode = postalCode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Address() + { + } + + /// Address line 1. + public string AddressLine1 { get; set; } + /// Address line 2. + public string AddressLine2 { get; set; } + /// Name of the city. + public string City { get; set; } + /// State (if any). + public string State { get; set; } + /// Name of the country. + public string Country { get; set; } + /// Postal code. + public string PostalCode { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Alert.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Alert.Serialization.cs new file mode 100644 index 000000000000..558b5be1aeaa --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Alert.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class Alert : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Alert)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("level"u8); + writer.WriteStringValue(Level.ToString()); + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Alert IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Alert)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAlert(document.RootElement, options); + } + + internal static Alert DeserializeAlert(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AlertLevel level = default; + string message = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("level"u8)) + { + level = new AlertLevel(property.Value.GetString()); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Alert(level, message, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(Alert)} does not support writing '{options.Format}' format."); + } + } + + Alert IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAlert(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Alert)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Alert.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Alert.cs new file mode 100644 index 000000000000..51413fa85764 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Alert.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.PureStorageBlock.Models +{ + /// Health alerts. + public partial class Alert + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Severity level. + /// A short description of the alert. + /// is null. + internal Alert(AlertLevel level, string message) + { + Argument.AssertNotNull(message, nameof(message)); + + Level = level; + Message = message; + } + + /// Initializes a new instance of . + /// Severity level. + /// A short description of the alert. + /// Keeps track of any properties unknown to the library. + internal Alert(AlertLevel level, string message, IDictionary serializedAdditionalRawData) + { + Level = level; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Alert() + { + } + + /// Severity level. + public AlertLevel Level { get; } + /// A short description of the alert. + public string Message { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AlertLevel.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AlertLevel.cs new file mode 100644 index 000000000000..29a548be949b --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AlertLevel.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.PureStorageBlock.Models +{ + /// Severity level of the alert. + public readonly partial struct AlertLevel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AlertLevel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InfoValue = "info"; + private const string WarningValue = "warning"; + private const string ErrorValue = "error"; + + /// Information level. + public static AlertLevel Info { get; } = new AlertLevel(InfoValue); + /// Warning level. + public static AlertLevel Warning { get; } = new AlertLevel(WarningValue); + /// Error level. + public static AlertLevel Error { get; } = new AlertLevel(ErrorValue); + /// Determines if two values are the same. + public static bool operator ==(AlertLevel left, AlertLevel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AlertLevel left, AlertLevel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AlertLevel(string value) => new AlertLevel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AlertLevel other && Equals(other); + /// + public bool Equals(AlertLevel 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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsConnection.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsConnection.Serialization.cs new file mode 100644 index 000000000000..b7c748f037c5 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsConnection.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class AvsConnection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsConnection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("serviceInitializationCompleted"u8); + writer.WriteBooleanValue(ServiceInitializationCompleted); + if (Optional.IsDefined(ServiceInitializationHandleEnc)) + { + writer.WritePropertyName("serviceInitializationHandleEnc"u8); + writer.WriteStringValue(ServiceInitializationHandleEnc); + } + if (Optional.IsDefined(ServiceInitializationHandle)) + { + writer.WritePropertyName("serviceInitializationHandle"u8); + writer.WriteObjectValue(ServiceInitializationHandle, 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 + } + } + } + + AvsConnection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsConnection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsConnection(document.RootElement, options); + } + + internal static AvsConnection DeserializeAvsConnection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool serviceInitializationCompleted = default; + string serviceInitializationHandleEnc = default; + ServiceInitializationHandle serviceInitializationHandle = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceInitializationCompleted"u8)) + { + serviceInitializationCompleted = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("serviceInitializationHandleEnc"u8)) + { + serviceInitializationHandleEnc = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceInitializationHandle"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceInitializationHandle = ServiceInitializationHandle.DeserializeServiceInitializationHandle(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsConnection(serviceInitializationCompleted, serviceInitializationHandleEnc, serviceInitializationHandle, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsConnection)} does not support writing '{options.Format}' format."); + } + } + + AvsConnection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsConnection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsConnection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsConnection.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsConnection.cs new file mode 100644 index 000000000000..ec1201c0a142 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsConnection.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Transient information about an on-going connection to an AVS instance. + public partial class AvsConnection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Indicates whether service initialization is complete. + internal AvsConnection(bool serviceInitializationCompleted) + { + ServiceInitializationCompleted = serviceInitializationCompleted; + } + + /// Initializes a new instance of . + /// Indicates whether service initialization is complete. + /// Encoded service account credentials alongside connection information. + /// Explicit service account credentials. + /// Keeps track of any properties unknown to the library. + internal AvsConnection(bool serviceInitializationCompleted, string serviceInitializationHandleEnc, ServiceInitializationHandle serviceInitializationHandle, IDictionary serializedAdditionalRawData) + { + ServiceInitializationCompleted = serviceInitializationCompleted; + ServiceInitializationHandleEnc = serviceInitializationHandleEnc; + ServiceInitializationHandle = serviceInitializationHandle; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AvsConnection() + { + } + + /// Indicates whether service initialization is complete. + public bool ServiceInitializationCompleted { get; } + /// Encoded service account credentials alongside connection information. + public string ServiceInitializationHandleEnc { get; } + /// Explicit service account credentials. + public ServiceInitializationHandle ServiceInitializationHandle { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsDiskDetails.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsDiskDetails.Serialization.cs new file mode 100644 index 000000000000..95fb5ce5f67a --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsDiskDetails.Serialization.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class AvsDiskDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsDiskDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("diskId"u8); + writer.WriteStringValue(DiskId); + writer.WritePropertyName("diskName"u8); + writer.WriteStringValue(DiskName); + writer.WritePropertyName("folder"u8); + writer.WriteStringValue(Folder); + writer.WritePropertyName("avsVmInternalId"u8); + writer.WriteStringValue(AvsVmInternalId); + writer.WritePropertyName("avsVmResourceId"u8); + writer.WriteStringValue(AvsVmResourceId); + writer.WritePropertyName("avsVmName"u8); + writer.WriteStringValue(AvsVmName); + writer.WritePropertyName("avsStorageContainerResourceId"u8); + writer.WriteStringValue(AvsStorageContainerResourceId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AvsDiskDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsDiskDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsDiskDetails(document.RootElement, options); + } + + internal static AvsDiskDetails DeserializeAvsDiskDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string diskId = default; + string diskName = default; + string folder = default; + string avsVmInternalId = default; + string avsVmResourceId = default; + string avsVmName = default; + string avsStorageContainerResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskId"u8)) + { + diskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskName"u8)) + { + diskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("folder"u8)) + { + folder = property.Value.GetString(); + continue; + } + if (property.NameEquals("avsVmInternalId"u8)) + { + avsVmInternalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("avsVmResourceId"u8)) + { + avsVmResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("avsVmName"u8)) + { + avsVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("avsStorageContainerResourceId"u8)) + { + avsStorageContainerResourceId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsDiskDetails( + diskId, + diskName, + folder, + avsVmInternalId, + avsVmResourceId, + avsVmName, + avsStorageContainerResourceId, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsDiskDetails)} does not support writing '{options.Format}' format."); + } + } + + AvsDiskDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsDiskDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsDiskDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsDiskDetails.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsDiskDetails.cs new file mode 100644 index 000000000000..c13ebe87fe39 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsDiskDetails.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// AVS disk/volume information. + public partial class AvsDiskDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// VMware ID of the disk/volume. + /// VMware name of the disk/volume. + /// Name of the top-level folder in the datastore that contains the disk/volume. + /// VMware ID assigned to the disk/volume. + /// Azure resource ID of the AVS VM connected to this disk/volume. + /// Name of the AVS VM connected to this disk/volume. + /// Azure resource ID of the AVS storage container containing this disk/volume. + /// , , , , , or is null. + internal AvsDiskDetails(string diskId, string diskName, string folder, string avsVmInternalId, string avsVmResourceId, string avsVmName, string avsStorageContainerResourceId) + { + Argument.AssertNotNull(diskId, nameof(diskId)); + Argument.AssertNotNull(diskName, nameof(diskName)); + Argument.AssertNotNull(folder, nameof(folder)); + Argument.AssertNotNull(avsVmInternalId, nameof(avsVmInternalId)); + Argument.AssertNotNull(avsVmResourceId, nameof(avsVmResourceId)); + Argument.AssertNotNull(avsVmName, nameof(avsVmName)); + Argument.AssertNotNull(avsStorageContainerResourceId, nameof(avsStorageContainerResourceId)); + + DiskId = diskId; + DiskName = diskName; + Folder = folder; + AvsVmInternalId = avsVmInternalId; + AvsVmResourceId = avsVmResourceId; + AvsVmName = avsVmName; + AvsStorageContainerResourceId = avsStorageContainerResourceId; + } + + /// Initializes a new instance of . + /// VMware ID of the disk/volume. + /// VMware name of the disk/volume. + /// Name of the top-level folder in the datastore that contains the disk/volume. + /// VMware ID assigned to the disk/volume. + /// Azure resource ID of the AVS VM connected to this disk/volume. + /// Name of the AVS VM connected to this disk/volume. + /// Azure resource ID of the AVS storage container containing this disk/volume. + /// Keeps track of any properties unknown to the library. + internal AvsDiskDetails(string diskId, string diskName, string folder, string avsVmInternalId, string avsVmResourceId, string avsVmName, string avsStorageContainerResourceId, IDictionary serializedAdditionalRawData) + { + DiskId = diskId; + DiskName = diskName; + Folder = folder; + AvsVmInternalId = avsVmInternalId; + AvsVmResourceId = avsVmResourceId; + AvsVmName = avsVmName; + AvsStorageContainerResourceId = avsStorageContainerResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AvsDiskDetails() + { + } + + /// VMware ID of the disk/volume. + public string DiskId { get; } + /// VMware name of the disk/volume. + public string DiskName { get; } + /// Name of the top-level folder in the datastore that contains the disk/volume. + public string Folder { get; } + /// VMware ID assigned to the disk/volume. + public string AvsVmInternalId { get; } + /// Azure resource ID of the AVS VM connected to this disk/volume. + public string AvsVmResourceId { get; } + /// Name of the AVS VM connected to this disk/volume. + public string AvsVmName { get; } + /// Azure resource ID of the AVS storage container containing this disk/volume. + public string AvsStorageContainerResourceId { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStatus.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStatus.Serialization.cs new file mode 100644 index 000000000000..111b508d079b --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStatus.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class AvsStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsStatus)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("avsEnabled"u8); + writer.WriteBooleanValue(AvsEnabled); + writer.WritePropertyName("currentConnectionStatus"u8); + writer.WriteStringValue(CurrentConnectionStatus); + if (Optional.IsDefined(ClusterResourceId)) + { + writer.WritePropertyName("sddcResourceId"u8); + writer.WriteStringValue(ClusterResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AvsStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsStatus(document.RootElement, options); + } + + internal static AvsStatus DeserializeAvsStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool avsEnabled = default; + string currentConnectionStatus = default; + string sddcResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("avsEnabled"u8)) + { + avsEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("currentConnectionStatus"u8)) + { + currentConnectionStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("sddcResourceId"u8)) + { + sddcResourceId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsStatus(avsEnabled, currentConnectionStatus, sddcResourceId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsStatus)} does not support writing '{options.Format}' format."); + } + } + + AvsStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStatus.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStatus.cs new file mode 100644 index 000000000000..4453630d1f2d --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStatus.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Status of storage pool / AVS connection. + public partial class AvsStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// If true, an AVS connection has been successfully completed. + /// Human-readable current AVS connection status. + /// is null. + internal AvsStatus(bool avsEnabled, string currentConnectionStatus) + { + Argument.AssertNotNull(currentConnectionStatus, nameof(currentConnectionStatus)); + + AvsEnabled = avsEnabled; + CurrentConnectionStatus = currentConnectionStatus; + } + + /// Initializes a new instance of . + /// If true, an AVS connection has been successfully completed. + /// Human-readable current AVS connection status. + /// Azure resource ID of the AVS SDDC the pool is connected to. + /// Keeps track of any properties unknown to the library. + internal AvsStatus(bool avsEnabled, string currentConnectionStatus, string clusterResourceId, IDictionary serializedAdditionalRawData) + { + AvsEnabled = avsEnabled; + CurrentConnectionStatus = currentConnectionStatus; + ClusterResourceId = clusterResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AvsStatus() + { + } + + /// If true, an AVS connection has been successfully completed. + public bool AvsEnabled { get; } + /// Human-readable current AVS connection status. + public string CurrentConnectionStatus { get; } + /// Azure resource ID of the AVS SDDC the pool is connected to. + public string ClusterResourceId { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerListResult.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerListResult.Serialization.cs new file mode 100644 index 000000000000..bedbdd44c9f5 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerListResult.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.PureStorageBlock.Models +{ + internal partial class AvsStorageContainerListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsStorageContainerListResult)} 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 + } + } + } + + AvsStorageContainerListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsStorageContainerListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsStorageContainerListResult(document.RootElement, options); + } + + internal static AvsStorageContainerListResult DeserializeAvsStorageContainerListResult(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(AvsStorageContainerData.DeserializeAvsStorageContainerData(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 AvsStorageContainerListResult(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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsStorageContainerListResult)} does not support writing '{options.Format}' format."); + } + } + + AvsStorageContainerListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsStorageContainerListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsStorageContainerListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerListResult.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerListResult.cs new file mode 100644 index 000000000000..5c67e692b07d --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerListResult.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.PureStorageBlock.Models +{ + /// The response of a AvsStorageContainer list operation. + internal partial class AvsStorageContainerListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 AvsStorageContainer items on this page. + /// is null. + internal AvsStorageContainerListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AvsStorageContainer items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AvsStorageContainerListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AvsStorageContainerListResult() + { + } + + /// The AvsStorageContainer items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerProperties.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerProperties.Serialization.cs new file mode 100644 index 000000000000..cfde49241b8b --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerProperties.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class AvsStorageContainerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsStorageContainerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Space)) + { + writer.WritePropertyName("space"u8); + writer.WriteObjectValue(Space, options); + } + if (options.Format != "W") + { + writer.WritePropertyName("resourceName"u8); + writer.WriteStringValue(ResourceName); + } + if (Optional.IsDefined(ProvisionedLimit)) + { + writer.WritePropertyName("provisionedLimit"u8); + writer.WriteNumberValue(ProvisionedLimit.Value); + } + if (options.Format != "W" && Optional.IsDefined(Datastore)) + { + writer.WritePropertyName("datastore"u8); + writer.WriteStringValue(Datastore); + } + if (options.Format != "W" && Optional.IsDefined(Mounted)) + { + writer.WritePropertyName("mounted"u8); + writer.WriteBooleanValue(Mounted.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 + } + } + } + + AvsStorageContainerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsStorageContainerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsStorageContainerProperties(document.RootElement, options); + } + + internal static AvsStorageContainerProperties DeserializeAvsStorageContainerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Space space = default; + string resourceName = default; + long? provisionedLimit = default; + string datastore = default; + bool? mounted = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("space"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + space = Space.DeserializeSpace(property.Value, options); + continue; + } + if (property.NameEquals("resourceName"u8)) + { + resourceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisionedLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisionedLimit = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("datastore"u8)) + { + datastore = property.Value.GetString(); + continue; + } + if (property.NameEquals("mounted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mounted = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsStorageContainerProperties( + space, + resourceName, + provisionedLimit, + datastore, + mounted, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsStorageContainerProperties)} does not support writing '{options.Format}' format."); + } + } + + AvsStorageContainerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsStorageContainerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsStorageContainerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerProperties.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerProperties.cs new file mode 100644 index 000000000000..12243be3d4d2 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerProperties.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.PureStorageBlock.Models +{ + /// AVS storage container properties. + public partial class AvsStorageContainerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 storage container. + internal AvsStorageContainerProperties(string resourceName) + { + ResourceName = resourceName; + } + + /// Initializes a new instance of . + /// Storage space usage. + /// Name of the storage container. + /// Maximum amount of bytes that can be provisioned in this storage container; it must be a multiple of 512; each time a volume is provisioned in this container, its provisionedSize will be counted against the provisionLimit and the provisioning will fail if it goes over (minimum: 1048576 (1MiB), maximum: 4503599627370496 (4PiB)); by default it is unrestricted. + /// VMware datastore associated with this storage container (if any). + /// Whether the datastore is mounted in VMware or not. + /// Keeps track of any properties unknown to the library. + internal AvsStorageContainerProperties(Space space, string resourceName, long? provisionedLimit, string datastore, bool? mounted, IDictionary serializedAdditionalRawData) + { + Space = space; + ResourceName = resourceName; + ProvisionedLimit = provisionedLimit; + Datastore = datastore; + Mounted = mounted; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AvsStorageContainerProperties() + { + } + + /// Storage space usage. + public Space Space { get; } + /// Name of the storage container. + public string ResourceName { get; } + /// Maximum amount of bytes that can be provisioned in this storage container; it must be a multiple of 512; each time a volume is provisioned in this container, its provisionedSize will be counted against the provisionLimit and the provisioning will fail if it goes over (minimum: 1048576 (1MiB), maximum: 4503599627370496 (4PiB)); by default it is unrestricted. + public long? ProvisionedLimit { get; } + /// VMware datastore associated with this storage container (if any). + public string Datastore { get; } + /// Whether the datastore is mounted in VMware or not. + public bool? Mounted { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeListResult.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeListResult.Serialization.cs new file mode 100644 index 000000000000..0c90c3910eaa --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeListResult.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.PureStorageBlock.Models +{ + internal partial class AvsStorageContainerVolumeListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsStorageContainerVolumeListResult)} 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 + } + } + } + + AvsStorageContainerVolumeListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsStorageContainerVolumeListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsStorageContainerVolumeListResult(document.RootElement, options); + } + + internal static AvsStorageContainerVolumeListResult DeserializeAvsStorageContainerVolumeListResult(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(AvsStorageContainerVolumeData.DeserializeAvsStorageContainerVolumeData(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 AvsStorageContainerVolumeListResult(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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsStorageContainerVolumeListResult)} does not support writing '{options.Format}' format."); + } + } + + AvsStorageContainerVolumeListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsStorageContainerVolumeListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsStorageContainerVolumeListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeListResult.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeListResult.cs new file mode 100644 index 000000000000..3de2586c629f --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeListResult.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.PureStorageBlock.Models +{ + /// The response of a AvsStorageContainerVolume list operation. + internal partial class AvsStorageContainerVolumeListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 AvsStorageContainerVolume items on this page. + /// is null. + internal AvsStorageContainerVolumeListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AvsStorageContainerVolume items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AvsStorageContainerVolumeListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AvsStorageContainerVolumeListResult() + { + } + + /// The AvsStorageContainerVolume items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumePatch.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumePatch.Serialization.cs new file mode 100644 index 000000000000..13c91d9bd45a --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumePatch.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class AvsStorageContainerVolumePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsStorageContainerVolumePatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AvsStorageContainerVolumePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsStorageContainerVolumePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsStorageContainerVolumePatch(document.RootElement, options); + } + + internal static AvsStorageContainerVolumePatch DeserializeAvsStorageContainerVolumePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AvsStorageContainerVolumeUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = AvsStorageContainerVolumeUpdateProperties.DeserializeAvsStorageContainerVolumeUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsStorageContainerVolumePatch(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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsStorageContainerVolumePatch)} does not support writing '{options.Format}' format."); + } + } + + AvsStorageContainerVolumePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsStorageContainerVolumePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsStorageContainerVolumePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumePatch.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumePatch.cs new file mode 100644 index 000000000000..cc4a0844315b --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumePatch.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// The type used for update operations of the AvsStorageContainerVolume. + public partial class AvsStorageContainerVolumePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 AvsStorageContainerVolumePatch() + { + } + + /// Initializes a new instance of . + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal AvsStorageContainerVolumePatch(AvsStorageContainerVolumeUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + internal AvsStorageContainerVolumeUpdateProperties Properties { get; set; } + /// Volume's soft-deletion state. + public SoftDeletion AvsStorageContainerVolumeUpdateSoftDeletion + { + get => Properties is null ? default : Properties.SoftDeletion; + set + { + if (Properties is null) + Properties = new AvsStorageContainerVolumeUpdateProperties(); + Properties.SoftDeletion = value; + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeUpdateProperties.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..a71831be4e75 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeUpdateProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + internal partial class AvsStorageContainerVolumeUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsStorageContainerVolumeUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SoftDeletion)) + { + writer.WritePropertyName("softDeletion"u8); + writer.WriteObjectValue(SoftDeletion, 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 + } + } + } + + AvsStorageContainerVolumeUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsStorageContainerVolumeUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsStorageContainerVolumeUpdateProperties(document.RootElement, options); + } + + internal static AvsStorageContainerVolumeUpdateProperties DeserializeAvsStorageContainerVolumeUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SoftDeletion softDeletion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("softDeletion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softDeletion = SoftDeletion.DeserializeSoftDeletion(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsStorageContainerVolumeUpdateProperties(softDeletion, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsStorageContainerVolumeUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + AvsStorageContainerVolumeUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsStorageContainerVolumeUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsStorageContainerVolumeUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeUpdateProperties.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeUpdateProperties.cs new file mode 100644 index 000000000000..9e0fc0521568 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsStorageContainerVolumeUpdateProperties.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.PureStorageBlock.Models +{ + /// The updatable properties of the AvsStorageContainerVolume. + internal partial class AvsStorageContainerVolumeUpdateProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 AvsStorageContainerVolumeUpdateProperties() + { + } + + /// Initializes a new instance of . + /// Volume's soft-deletion state. + /// Keeps track of any properties unknown to the library. + internal AvsStorageContainerVolumeUpdateProperties(SoftDeletion softDeletion, IDictionary serializedAdditionalRawData) + { + SoftDeletion = softDeletion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Volume's soft-deletion state. + public SoftDeletion SoftDeletion { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmDetails.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmDetails.Serialization.cs new file mode 100644 index 000000000000..3076656acd54 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmDetails.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.ResourceManager.PureStorageBlock.Models +{ + public partial class AvsVmDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("vmId"u8); + writer.WriteStringValue(VmId); + writer.WritePropertyName("vmName"u8); + writer.WriteStringValue(VmName); + writer.WritePropertyName("vmType"u8); + writer.WriteStringValue(VmType.ToString()); + writer.WritePropertyName("avsVmInternalId"u8); + writer.WriteStringValue(AvsVmInternalId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AvsVmDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsVmDetails(document.RootElement, options); + } + + internal static AvsVmDetails DeserializeAvsVmDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string vmId = default; + string vmName = default; + VmType vmType = default; + string avsVmInternalId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmId"u8)) + { + vmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("vmName"u8)) + { + vmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("vmType"u8)) + { + vmType = new VmType(property.Value.GetString()); + continue; + } + if (property.NameEquals("avsVmInternalId"u8)) + { + avsVmInternalId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsVmDetails(vmId, vmName, vmType, avsVmInternalId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsVmDetails)} does not support writing '{options.Format}' format."); + } + } + + AvsVmDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsVmDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsVmDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmDetails.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmDetails.cs new file mode 100644 index 000000000000..a90f693ef30d --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmDetails.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// AVS VM details. + public partial class AvsVmDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// ID of the AVS VM using this set of volumes. + /// Name of the VMware VM using this set of volumes. + /// Type of the VMware VM using this set of volumes. + /// Pure Storage's internal ID for this AVS VM. + /// , or is null. + internal AvsVmDetails(string vmId, string vmName, VmType vmType, string avsVmInternalId) + { + Argument.AssertNotNull(vmId, nameof(vmId)); + Argument.AssertNotNull(vmName, nameof(vmName)); + Argument.AssertNotNull(avsVmInternalId, nameof(avsVmInternalId)); + + VmId = vmId; + VmName = vmName; + VmType = vmType; + AvsVmInternalId = avsVmInternalId; + } + + /// Initializes a new instance of . + /// ID of the AVS VM using this set of volumes. + /// Name of the VMware VM using this set of volumes. + /// Type of the VMware VM using this set of volumes. + /// Pure Storage's internal ID for this AVS VM. + /// Keeps track of any properties unknown to the library. + internal AvsVmDetails(string vmId, string vmName, VmType vmType, string avsVmInternalId, IDictionary serializedAdditionalRawData) + { + VmId = vmId; + VmName = vmName; + VmType = vmType; + AvsVmInternalId = avsVmInternalId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AvsVmDetails() + { + } + + /// ID of the AVS VM using this set of volumes. + public string VmId { get; } + /// Name of the VMware VM using this set of volumes. + public string VmName { get; } + /// Type of the VMware VM using this set of volumes. + public VmType VmType { get; } + /// Pure Storage's internal ID for this AVS VM. + public string AvsVmInternalId { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmListResult.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmListResult.Serialization.cs new file mode 100644 index 000000000000..fbd71a9bbaea --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmListResult.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.PureStorageBlock.Models +{ + internal partial class AvsVmListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmListResult)} 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 + } + } + } + + AvsVmListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsVmListResult(document.RootElement, options); + } + + internal static AvsVmListResult DeserializeAvsVmListResult(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(AvsVmData.DeserializeAvsVmData(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 AvsVmListResult(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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsVmListResult)} does not support writing '{options.Format}' format."); + } + } + + AvsVmListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsVmListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsVmListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmListResult.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmListResult.cs new file mode 100644 index 000000000000..7eece46f2dc7 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmListResult.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.PureStorageBlock.Models +{ + /// The response of a AvsVm list operation. + internal partial class AvsVmListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 AvsVm items on this page. + /// is null. + internal AvsVmListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AvsVm items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AvsVmListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AvsVmListResult() + { + } + + /// The AvsVm items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmPatch.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmPatch.Serialization.cs new file mode 100644 index 000000000000..d6c8e0c8a482 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmPatch.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class AvsVmPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AvsVmPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsVmPatch(document.RootElement, options); + } + + internal static AvsVmPatch DeserializeAvsVmPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AvsVmUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = AvsVmUpdateProperties.DeserializeAvsVmUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsVmPatch(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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsVmPatch)} does not support writing '{options.Format}' format."); + } + } + + AvsVmPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsVmPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsVmPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmPatch.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmPatch.cs new file mode 100644 index 000000000000..b3c69f928826 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmPatch.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// The type used for update operations of the AvsVm. + public partial class AvsVmPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 AvsVmPatch() + { + } + + /// Initializes a new instance of . + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal AvsVmPatch(AvsVmUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + internal AvsVmUpdateProperties Properties { get; set; } + /// AVS VM's soft-deletion state. + public SoftDeletion AvsVmUpdateSoftDeletion + { + get => Properties is null ? default : Properties.SoftDeletion; + set + { + if (Properties is null) + Properties = new AvsVmUpdateProperties(); + Properties.SoftDeletion = value; + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmProperties.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmProperties.Serialization.cs new file mode 100644 index 000000000000..c4355914cd41 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmProperties.Serialization.cs @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class AvsVmProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(StoragePoolInternalId)) + { + writer.WritePropertyName("storagePoolInternalId"u8); + writer.WriteStringValue(StoragePoolInternalId); + } + if (options.Format != "W" && Optional.IsDefined(StoragePoolResourceId)) + { + writer.WritePropertyName("storagePoolResourceId"u8); + writer.WriteStringValue(StoragePoolResourceId); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(CreatedTimestamp)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedTimestamp); + } + if (Optional.IsDefined(SoftDeletion)) + { + writer.WritePropertyName("softDeletion"u8); + writer.WriteObjectValue(SoftDeletion, options); + } + if (options.Format != "W" && Optional.IsDefined(VolumeContainerType)) + { + writer.WritePropertyName("volumeContainerType"u8); + writer.WriteStringValue(VolumeContainerType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Avs)) + { + writer.WritePropertyName("avs"u8); + writer.WriteObjectValue(Avs, options); + } + if (options.Format != "W" && Optional.IsDefined(Space)) + { + writer.WritePropertyName("space"u8); + writer.WriteObjectValue(Space, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AvsVmProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsVmProperties(document.RootElement, options); + } + + internal static AvsVmProperties DeserializeAvsVmProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string storagePoolInternalId = default; + string storagePoolResourceId = default; + string displayName = default; + string createdTimestamp = default; + SoftDeletion softDeletion = default; + VolumeContainerType? volumeContainerType = default; + AvsVmDetails avs = default; + Space space = default; + ResourceProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storagePoolInternalId"u8)) + { + storagePoolInternalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storagePoolResourceId"u8)) + { + storagePoolResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdTimestamp"u8)) + { + createdTimestamp = property.Value.GetString(); + continue; + } + if (property.NameEquals("softDeletion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softDeletion = SoftDeletion.DeserializeSoftDeletion(property.Value, options); + continue; + } + if (property.NameEquals("volumeContainerType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + volumeContainerType = new VolumeContainerType(property.Value.GetString()); + continue; + } + if (property.NameEquals("avs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + avs = AvsVmDetails.DeserializeAvsVmDetails(property.Value, options); + continue; + } + if (property.NameEquals("space"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + space = Space.DeserializeSpace(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ResourceProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsVmProperties( + storagePoolInternalId, + storagePoolResourceId, + displayName, + createdTimestamp, + softDeletion, + volumeContainerType, + avs, + space, + 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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsVmProperties)} does not support writing '{options.Format}' format."); + } + } + + AvsVmProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsVmProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsVmProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmProperties.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmProperties.cs new file mode 100644 index 000000000000..dc1b2ce4e0e2 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmProperties.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// AVS VM properties. + public partial class AvsVmProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AvsVmProperties() + { + } + + /// Initializes a new instance of . + /// Pure Storage's internal ID for the storage pool. + /// Azure resource ID of the storage pool. + /// Human-readable name of the AVS VM. + /// Date at which the AVS VM was created, as an RFC 3339 timestamp. + /// AVS VM's soft-deletion state. + /// Specify which control plane handles the lifecycle of the volume container. + /// AVS VM details. + /// Contains properties related to used Flash space. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal AvsVmProperties(string storagePoolInternalId, string storagePoolResourceId, string displayName, string createdTimestamp, SoftDeletion softDeletion, VolumeContainerType? volumeContainerType, AvsVmDetails avs, Space space, ResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + StoragePoolInternalId = storagePoolInternalId; + StoragePoolResourceId = storagePoolResourceId; + DisplayName = displayName; + CreatedTimestamp = createdTimestamp; + SoftDeletion = softDeletion; + VolumeContainerType = volumeContainerType; + Avs = avs; + Space = space; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Pure Storage's internal ID for the storage pool. + public string StoragePoolInternalId { get; } + /// Azure resource ID of the storage pool. + public string StoragePoolResourceId { get; } + /// Human-readable name of the AVS VM. + public string DisplayName { get; } + /// Date at which the AVS VM was created, as an RFC 3339 timestamp. + public string CreatedTimestamp { get; } + /// AVS VM's soft-deletion state. + public SoftDeletion SoftDeletion { get; } + /// Specify which control plane handles the lifecycle of the volume container. + public VolumeContainerType? VolumeContainerType { get; } + /// AVS VM details. + public AvsVmDetails Avs { get; } + /// Contains properties related to used Flash space. + public Space Space { get; } + /// Provisioning state of the resource. + public ResourceProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmUpdateProperties.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..a68eb197173b --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmUpdateProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + internal partial class AvsVmUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SoftDeletion)) + { + writer.WritePropertyName("softDeletion"u8); + writer.WriteObjectValue(SoftDeletion, 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 + } + } + } + + AvsVmUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsVmUpdateProperties(document.RootElement, options); + } + + internal static AvsVmUpdateProperties DeserializeAvsVmUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SoftDeletion softDeletion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("softDeletion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softDeletion = SoftDeletion.DeserializeSoftDeletion(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsVmUpdateProperties(softDeletion, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsVmUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + AvsVmUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsVmUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsVmUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmUpdateProperties.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmUpdateProperties.cs new file mode 100644 index 000000000000..f49a964a1902 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmUpdateProperties.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.PureStorageBlock.Models +{ + /// The updatable properties of the AvsVm. + internal partial class AvsVmUpdateProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 AvsVmUpdateProperties() + { + } + + /// Initializes a new instance of . + /// AVS VM's soft-deletion state. + /// Keeps track of any properties unknown to the library. + internal AvsVmUpdateProperties(SoftDeletion softDeletion, IDictionary serializedAdditionalRawData) + { + SoftDeletion = softDeletion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// AVS VM's soft-deletion state. + public SoftDeletion SoftDeletion { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeListResult.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeListResult.Serialization.cs new file mode 100644 index 000000000000..65ad95cb336f --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeListResult.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.PureStorageBlock.Models +{ + internal partial class AvsVmVolumeListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmVolumeListResult)} 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 + } + } + } + + AvsVmVolumeListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmVolumeListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsVmVolumeListResult(document.RootElement, options); + } + + internal static AvsVmVolumeListResult DeserializeAvsVmVolumeListResult(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(AvsVmVolumeData.DeserializeAvsVmVolumeData(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 AvsVmVolumeListResult(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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsVmVolumeListResult)} does not support writing '{options.Format}' format."); + } + } + + AvsVmVolumeListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsVmVolumeListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsVmVolumeListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeListResult.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeListResult.cs new file mode 100644 index 000000000000..8e6bf0d08b5d --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeListResult.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.PureStorageBlock.Models +{ + /// The response of a AvsVmVolume list operation. + internal partial class AvsVmVolumeListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 AvsVmVolume items on this page. + /// is null. + internal AvsVmVolumeListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AvsVmVolume items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AvsVmVolumeListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AvsVmVolumeListResult() + { + } + + /// The AvsVmVolume items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumePatch.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumePatch.Serialization.cs new file mode 100644 index 000000000000..c19fc4f78d88 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumePatch.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class AvsVmVolumePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmVolumePatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AvsVmVolumePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmVolumePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsVmVolumePatch(document.RootElement, options); + } + + internal static AvsVmVolumePatch DeserializeAvsVmVolumePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AvsVmVolumeUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = AvsVmVolumeUpdateProperties.DeserializeAvsVmVolumeUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsVmVolumePatch(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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsVmVolumePatch)} does not support writing '{options.Format}' format."); + } + } + + AvsVmVolumePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsVmVolumePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsVmVolumePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumePatch.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumePatch.cs new file mode 100644 index 000000000000..e1f1d08afc64 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumePatch.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// The type used for update operations of the AvsVmVolume. + public partial class AvsVmVolumePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 AvsVmVolumePatch() + { + } + + /// Initializes a new instance of . + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal AvsVmVolumePatch(AvsVmVolumeUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + internal AvsVmVolumeUpdateProperties Properties { get; set; } + /// Volume's soft-deletion state. + public SoftDeletion AvsVmVolumeUpdateSoftDeletion + { + get => Properties is null ? default : Properties.SoftDeletion; + set + { + if (Properties is null) + Properties = new AvsVmVolumeUpdateProperties(); + Properties.SoftDeletion = value; + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeUpdateProperties.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..27fb9501863e --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeUpdateProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + internal partial class AvsVmVolumeUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmVolumeUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SoftDeletion)) + { + writer.WritePropertyName("softDeletion"u8); + writer.WriteObjectValue(SoftDeletion, 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 + } + } + } + + AvsVmVolumeUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsVmVolumeUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsVmVolumeUpdateProperties(document.RootElement, options); + } + + internal static AvsVmVolumeUpdateProperties DeserializeAvsVmVolumeUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SoftDeletion softDeletion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("softDeletion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softDeletion = SoftDeletion.DeserializeSoftDeletion(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsVmVolumeUpdateProperties(softDeletion, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AvsVmVolumeUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + AvsVmVolumeUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvsVmVolumeUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsVmVolumeUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeUpdateProperties.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeUpdateProperties.cs new file mode 100644 index 000000000000..755b351346d6 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AvsVmVolumeUpdateProperties.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.PureStorageBlock.Models +{ + /// The updatable properties of the AvsVmVolume. + internal partial class AvsVmVolumeUpdateProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 AvsVmVolumeUpdateProperties() + { + } + + /// Initializes a new instance of . + /// Volume's soft-deletion state. + /// Keeps track of any properties unknown to the library. + internal AvsVmVolumeUpdateProperties(SoftDeletion softDeletion, IDictionary serializedAdditionalRawData) + { + SoftDeletion = softDeletion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Volume's soft-deletion state. + public SoftDeletion SoftDeletion { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AzureResourceManagerPureStorageBlockContext.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AzureResourceManagerPureStorageBlockContext.cs new file mode 100644 index 000000000000..622e50087d1c --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AzureResourceManagerPureStorageBlockContext.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// Context class which will be filled in by the System.ClientModel.SourceGeneration. + /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' + /// + public partial class AzureResourceManagerPureStorageBlockContext : ModelReaderWriterContext + { + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AzureVmwareService.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AzureVmwareService.Serialization.cs new file mode 100644 index 000000000000..fb134cddb371 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AzureVmwareService.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class AzureVmwareService : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureVmwareService)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("avsEnabled"u8); + writer.WriteBooleanValue(AvsEnabled); + if (Optional.IsDefined(ClusterResourceId)) + { + writer.WritePropertyName("sddcResourceId"u8); + writer.WriteStringValue(ClusterResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureVmwareService IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureVmwareService)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureVmwareService(document.RootElement, options); + } + + internal static AzureVmwareService DeserializeAzureVmwareService(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool avsEnabled = default; + string sddcResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("avsEnabled"u8)) + { + avsEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("sddcResourceId"u8)) + { + sddcResourceId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureVmwareService(avsEnabled, sddcResourceId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(AzureVmwareService)} does not support writing '{options.Format}' format."); + } + } + + AzureVmwareService IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAzureVmwareService(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureVmwareService)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AzureVmwareService.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AzureVmwareService.cs new file mode 100644 index 000000000000..a70fb8974778 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/AzureVmwareService.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Connected AVS status. + public partial class AzureVmwareService + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// If true, an AVS SDDC is successfully connected to the storage pool. + internal AzureVmwareService(bool avsEnabled) + { + AvsEnabled = avsEnabled; + } + + /// Initializes a new instance of . + /// If true, an AVS SDDC is successfully connected to the storage pool. + /// Azure resource ID of the AVS SDDC the storage pool is connected to. + /// Keeps track of any properties unknown to the library. + internal AzureVmwareService(bool avsEnabled, string clusterResourceId, IDictionary serializedAdditionalRawData) + { + AvsEnabled = avsEnabled; + ClusterResourceId = clusterResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureVmwareService() + { + } + + /// If true, an AVS SDDC is successfully connected to the storage pool. + public bool AvsEnabled { get; } + /// Azure resource ID of the AVS SDDC the storage pool is connected to. + public string ClusterResourceId { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BandwidthUsage.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BandwidthUsage.Serialization.cs new file mode 100644 index 000000000000..a154a4f1d074 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BandwidthUsage.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.PureStorageBlock.Models +{ + public partial class BandwidthUsage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BandwidthUsage)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("current"u8); + writer.WriteNumberValue(Current); + writer.WritePropertyName("provisioned"u8); + writer.WriteNumberValue(Provisioned); + writer.WritePropertyName("max"u8); + writer.WriteNumberValue(Max); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BandwidthUsage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BandwidthUsage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBandwidthUsage(document.RootElement, options); + } + + internal static BandwidthUsage DeserializeBandwidthUsage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long current = default; + long provisioned = default; + long max = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("current"u8)) + { + current = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("provisioned"u8)) + { + provisioned = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("max"u8)) + { + max = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BandwidthUsage(current, provisioned, max, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(BandwidthUsage)} does not support writing '{options.Format}' format."); + } + } + + BandwidthUsage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBandwidthUsage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BandwidthUsage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BandwidthUsage.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BandwidthUsage.cs new file mode 100644 index 000000000000..e419d16e49f6 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BandwidthUsage.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Bandwidth usage metrics. + public partial class BandwidthUsage + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Number of bytes written and read per second (maximum value over the last 10 minutes). + /// Bandwidth value currently provisioned for the storage pool, in MB/s. + /// Maximum bandwidth value that can be provisioned for the storage pool. + internal BandwidthUsage(long current, long provisioned, long max) + { + Current = current; + Provisioned = provisioned; + Max = max; + } + + /// Initializes a new instance of . + /// Number of bytes written and read per second (maximum value over the last 10 minutes). + /// Bandwidth value currently provisioned for the storage pool, in MB/s. + /// Maximum bandwidth value that can be provisioned for the storage pool. + /// Keeps track of any properties unknown to the library. + internal BandwidthUsage(long current, long provisioned, long max, IDictionary serializedAdditionalRawData) + { + Current = current; + Provisioned = provisioned; + Max = max; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BandwidthUsage() + { + } + + /// Number of bytes written and read per second (maximum value over the last 10 minutes). + public long Current { get; } + /// Bandwidth value currently provisioned for the storage pool, in MB/s. + public long Provisioned { get; } + /// Maximum bandwidth value that can be provisioned for the storage pool. + public long Max { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BillingUsageProperty.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BillingUsageProperty.Serialization.cs new file mode 100644 index 000000000000..29164c2e3313 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BillingUsageProperty.Serialization.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class BillingUsageProperty : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BillingUsageProperty)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("propertyId"u8); + writer.WriteStringValue(PropertyId); + writer.WritePropertyName("propertyName"u8); + writer.WriteStringValue(PropertyName); + writer.WritePropertyName("currentValue"u8); + writer.WriteStringValue(CurrentValue); + if (Optional.IsDefined(PreviousValue)) + { + writer.WritePropertyName("previousValue"u8); + writer.WriteStringValue(PreviousValue); + } + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity.ToString()); + if (Optional.IsDefined(StatusMessage)) + { + writer.WritePropertyName("statusMessage"u8); + writer.WriteStringValue(StatusMessage); + } + if (Optional.IsCollectionDefined(SubProperties)) + { + writer.WritePropertyName("subProperties"u8); + writer.WriteStartArray(); + foreach (var item in SubProperties) + { + 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 + } + } + } + + BillingUsageProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BillingUsageProperty)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBillingUsageProperty(document.RootElement, options); + } + + internal static BillingUsageProperty DeserializeBillingUsageProperty(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string propertyId = default; + string propertyName = default; + string currentValue = default; + string previousValue = default; + UsageSeverity severity = default; + string statusMessage = default; + IReadOnlyList subProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("propertyId"u8)) + { + propertyId = property.Value.GetString(); + continue; + } + if (property.NameEquals("propertyName"u8)) + { + propertyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("currentValue"u8)) + { + currentValue = property.Value.GetString(); + continue; + } + if (property.NameEquals("previousValue"u8)) + { + previousValue = property.Value.GetString(); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = new UsageSeverity(property.Value.GetString()); + continue; + } + if (property.NameEquals("statusMessage"u8)) + { + statusMessage = property.Value.GetString(); + continue; + } + if (property.NameEquals("subProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeBillingUsageProperty(item, options)); + } + subProperties = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BillingUsageProperty( + propertyId, + propertyName, + currentValue, + previousValue, + severity, + statusMessage, + subProperties ?? 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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(BillingUsageProperty)} does not support writing '{options.Format}' format."); + } + } + + BillingUsageProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBillingUsageProperty(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BillingUsageProperty)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BillingUsageProperty.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BillingUsageProperty.cs new file mode 100644 index 000000000000..a754e8131fcc --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/BillingUsageProperty.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Represents an individual billing usage property. + public partial class BillingUsageProperty + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Unique identifier for the billing usage property. + /// Name of the billing usage property. + /// Current value of the billing usage property. + /// Severity level of the usage. + /// , or is null. + internal BillingUsageProperty(string propertyId, string propertyName, string currentValue, UsageSeverity severity) + { + Argument.AssertNotNull(propertyId, nameof(propertyId)); + Argument.AssertNotNull(propertyName, nameof(propertyName)); + Argument.AssertNotNull(currentValue, nameof(currentValue)); + + PropertyId = propertyId; + PropertyName = propertyName; + CurrentValue = currentValue; + Severity = severity; + SubProperties = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique identifier for the billing usage property. + /// Name of the billing usage property. + /// Current value of the billing usage property. + /// Previous value of the billing usage property. + /// Severity level of the usage. + /// Status message for the billing usage against a property. + /// Optional list of sub-properties providing additional details. + /// Keeps track of any properties unknown to the library. + internal BillingUsageProperty(string propertyId, string propertyName, string currentValue, string previousValue, UsageSeverity severity, string statusMessage, IReadOnlyList subProperties, IDictionary serializedAdditionalRawData) + { + PropertyId = propertyId; + PropertyName = propertyName; + CurrentValue = currentValue; + PreviousValue = previousValue; + Severity = severity; + StatusMessage = statusMessage; + SubProperties = subProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BillingUsageProperty() + { + } + + /// Unique identifier for the billing usage property. + public string PropertyId { get; } + /// Name of the billing usage property. + public string PropertyName { get; } + /// Current value of the billing usage property. + public string CurrentValue { get; } + /// Previous value of the billing usage property. + public string PreviousValue { get; } + /// Severity level of the usage. + public UsageSeverity Severity { get; } + /// Status message for the billing usage against a property. + public string StatusMessage { get; } + /// Optional list of sub-properties providing additional details. + public IReadOnlyList SubProperties { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/CompanyDetails.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/CompanyDetails.Serialization.cs new file mode 100644 index 000000000000..21b2d823c3f0 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/CompanyDetails.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class CompanyDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompanyDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("companyName"u8); + writer.WriteStringValue(CompanyName); + if (Optional.IsDefined(Address)) + { + writer.WritePropertyName("address"u8); + writer.WriteObjectValue(Address, 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 + } + } + } + + CompanyDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompanyDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompanyDetails(document.RootElement, options); + } + + internal static CompanyDetails DeserializeCompanyDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string companyName = default; + Address address = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("companyName"u8)) + { + companyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("address"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + address = Address.DeserializeAddress(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CompanyDetails(companyName, address, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(CompanyDetails)} does not support writing '{options.Format}' format."); + } + } + + CompanyDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCompanyDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CompanyDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/CompanyDetails.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/CompanyDetails.cs new file mode 100644 index 000000000000..23951f5faf57 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/CompanyDetails.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Company details. + public partial class CompanyDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Company name. + /// is null. + public CompanyDetails(string companyName) + { + Argument.AssertNotNull(companyName, nameof(companyName)); + + CompanyName = companyName; + } + + /// Initializes a new instance of . + /// Company name. + /// Company address. + /// Keeps track of any properties unknown to the library. + internal CompanyDetails(string companyName, Address address, IDictionary serializedAdditionalRawData) + { + CompanyName = companyName; + Address = address; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CompanyDetails() + { + } + + /// Company name. + public string CompanyName { get; set; } + /// Company address. + public Address Address { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/HealthDetails.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/HealthDetails.Serialization.cs new file mode 100644 index 000000000000..5216db600c83 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/HealthDetails.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.PureStorageBlock.Models +{ + public partial class HealthDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HealthDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("usedCapacityPercentage"u8); + writer.WriteNumberValue(UsedCapacityPercentage); + writer.WritePropertyName("bandwidthUsage"u8); + writer.WriteObjectValue(BandwidthUsage, options); + writer.WritePropertyName("iopsUsage"u8); + writer.WriteObjectValue(IopsUsage, options); + writer.WritePropertyName("space"u8); + writer.WriteObjectValue(Space, options); + writer.WritePropertyName("dataReductionRatio"u8); + writer.WriteNumberValue(DataReductionRatio); + writer.WritePropertyName("estimatedMaxCapacity"u8); + writer.WriteNumberValue(EstimatedMaxCapacity); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HealthDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HealthDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHealthDetails(document.RootElement, options); + } + + internal static HealthDetails DeserializeHealthDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double usedCapacityPercentage = default; + BandwidthUsage bandwidthUsage = default; + IopsUsage iopsUsage = default; + Space space = default; + double dataReductionRatio = default; + long estimatedMaxCapacity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("usedCapacityPercentage"u8)) + { + usedCapacityPercentage = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("bandwidthUsage"u8)) + { + bandwidthUsage = BandwidthUsage.DeserializeBandwidthUsage(property.Value, options); + continue; + } + if (property.NameEquals("iopsUsage"u8)) + { + iopsUsage = IopsUsage.DeserializeIopsUsage(property.Value, options); + continue; + } + if (property.NameEquals("space"u8)) + { + space = Space.DeserializeSpace(property.Value, options); + continue; + } + if (property.NameEquals("dataReductionRatio"u8)) + { + dataReductionRatio = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("estimatedMaxCapacity"u8)) + { + estimatedMaxCapacity = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HealthDetails( + usedCapacityPercentage, + bandwidthUsage, + iopsUsage, + space, + dataReductionRatio, + estimatedMaxCapacity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(HealthDetails)} does not support writing '{options.Format}' format."); + } + } + + HealthDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHealthDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HealthDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/HealthDetails.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/HealthDetails.cs new file mode 100644 index 000000000000..92972733fd19 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/HealthDetails.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Health metrics for a storage pool. + public partial class HealthDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// How full the pool is right now, in %, compared to the maximum size it can grow to; estimated based on current usage and data reduction ratio. + /// Bandwidth usage metrics. + /// IOPS usage metrics. + /// Storage space usage. + /// Data reduction ratio achieved on this pool. + /// Estimated maximum capacity of the pool, in bytes, based on current usage and data reduction ratio. + /// , or is null. + internal HealthDetails(double usedCapacityPercentage, BandwidthUsage bandwidthUsage, IopsUsage iopsUsage, Space space, double dataReductionRatio, long estimatedMaxCapacity) + { + Argument.AssertNotNull(bandwidthUsage, nameof(bandwidthUsage)); + Argument.AssertNotNull(iopsUsage, nameof(iopsUsage)); + Argument.AssertNotNull(space, nameof(space)); + + UsedCapacityPercentage = usedCapacityPercentage; + BandwidthUsage = bandwidthUsage; + IopsUsage = iopsUsage; + Space = space; + DataReductionRatio = dataReductionRatio; + EstimatedMaxCapacity = estimatedMaxCapacity; + } + + /// Initializes a new instance of . + /// How full the pool is right now, in %, compared to the maximum size it can grow to; estimated based on current usage and data reduction ratio. + /// Bandwidth usage metrics. + /// IOPS usage metrics. + /// Storage space usage. + /// Data reduction ratio achieved on this pool. + /// Estimated maximum capacity of the pool, in bytes, based on current usage and data reduction ratio. + /// Keeps track of any properties unknown to the library. + internal HealthDetails(double usedCapacityPercentage, BandwidthUsage bandwidthUsage, IopsUsage iopsUsage, Space space, double dataReductionRatio, long estimatedMaxCapacity, IDictionary serializedAdditionalRawData) + { + UsedCapacityPercentage = usedCapacityPercentage; + BandwidthUsage = bandwidthUsage; + IopsUsage = iopsUsage; + Space = space; + DataReductionRatio = dataReductionRatio; + EstimatedMaxCapacity = estimatedMaxCapacity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HealthDetails() + { + } + + /// How full the pool is right now, in %, compared to the maximum size it can grow to; estimated based on current usage and data reduction ratio. + public double UsedCapacityPercentage { get; } + /// Bandwidth usage metrics. + public BandwidthUsage BandwidthUsage { get; } + /// IOPS usage metrics. + public IopsUsage IopsUsage { get; } + /// Storage space usage. + public Space Space { get; } + /// Data reduction ratio achieved on this pool. + public double DataReductionRatio { get; } + /// Estimated maximum capacity of the pool, in bytes, based on current usage and data reduction ratio. + public long EstimatedMaxCapacity { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/IopsUsage.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/IopsUsage.Serialization.cs new file mode 100644 index 000000000000..b2c18396cb12 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/IopsUsage.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.PureStorageBlock.Models +{ + public partial class IopsUsage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IopsUsage)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("current"u8); + writer.WriteNumberValue(Current); + writer.WritePropertyName("provisioned"u8); + writer.WriteNumberValue(Provisioned); + writer.WritePropertyName("max"u8); + writer.WriteNumberValue(Max); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IopsUsage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IopsUsage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIopsUsage(document.RootElement, options); + } + + internal static IopsUsage DeserializeIopsUsage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long current = default; + long provisioned = default; + long max = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("current"u8)) + { + current = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("provisioned"u8)) + { + provisioned = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("max"u8)) + { + max = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IopsUsage(current, provisioned, max, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(IopsUsage)} does not support writing '{options.Format}' format."); + } + } + + IopsUsage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIopsUsage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IopsUsage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/IopsUsage.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/IopsUsage.cs new file mode 100644 index 000000000000..dc7971c1eb22 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/IopsUsage.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// IOPS usage metrics. + public partial class IopsUsage + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Current number of IOPS (maximum value over the last 10 minutes). + /// IOPS value currently provisioned for the storage pool. + /// Maximum IOPS value that can be provisioned for the storage pool. + internal IopsUsage(long current, long provisioned, long max) + { + Current = current; + Provisioned = provisioned; + Max = max; + } + + /// Initializes a new instance of . + /// Current number of IOPS (maximum value over the last 10 minutes). + /// IOPS value currently provisioned for the storage pool. + /// Maximum IOPS value that can be provisioned for the storage pool. + /// Keeps track of any properties unknown to the library. + internal IopsUsage(long current, long provisioned, long max, IDictionary serializedAdditionalRawData) + { + Current = current; + Provisioned = provisioned; + Max = max; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IopsUsage() + { + } + + /// Current number of IOPS (maximum value over the last 10 minutes). + public long Current { get; } + /// IOPS value currently provisioned for the storage pool. + public long Provisioned { get; } + /// Maximum IOPS value that can be provisioned for the storage pool. + public long Max { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/LimitDetails.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/LimitDetails.Serialization.cs new file mode 100644 index 000000000000..40f31a0b7a7c --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/LimitDetails.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.ResourceManager.PureStorageBlock.Models +{ + public partial class LimitDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LimitDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("storagePool"u8); + writer.WriteObjectValue(StoragePool, options); + writer.WritePropertyName("volume"u8); + writer.WriteObjectValue(Volume, options); + writer.WritePropertyName("protectionPolicy"u8); + writer.WriteObjectValue(ProtectionPolicy, options); + writer.WritePropertyName("performancePolicy"u8); + writer.WriteObjectValue(PerformancePolicy, 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 + } + } + } + + LimitDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LimitDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLimitDetails(document.RootElement, options); + } + + internal static LimitDetails DeserializeLimitDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + StoragePoolLimits storagePool = default; + VolumeLimits volume = default; + ProtectionPolicyLimits protectionPolicy = default; + PerformancePolicyLimits performancePolicy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storagePool"u8)) + { + storagePool = StoragePoolLimits.DeserializeStoragePoolLimits(property.Value, options); + continue; + } + if (property.NameEquals("volume"u8)) + { + volume = VolumeLimits.DeserializeVolumeLimits(property.Value, options); + continue; + } + if (property.NameEquals("protectionPolicy"u8)) + { + protectionPolicy = ProtectionPolicyLimits.DeserializeProtectionPolicyLimits(property.Value, options); + continue; + } + if (property.NameEquals("performancePolicy"u8)) + { + performancePolicy = PerformancePolicyLimits.DeserializePerformancePolicyLimits(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LimitDetails(storagePool, volume, protectionPolicy, performancePolicy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(LimitDetails)} does not support writing '{options.Format}' format."); + } + } + + LimitDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLimitDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LimitDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/LimitDetails.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/LimitDetails.cs new file mode 100644 index 000000000000..290a23c0c69f --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/LimitDetails.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Limits constraining certain resource properties. + public partial class LimitDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Limits used for storage pool resources. + /// Limits used for volume resources. + /// internal. + /// internal. + /// , , or is null. + internal LimitDetails(StoragePoolLimits storagePool, VolumeLimits volume, ProtectionPolicyLimits protectionPolicy, PerformancePolicyLimits performancePolicy) + { + Argument.AssertNotNull(storagePool, nameof(storagePool)); + Argument.AssertNotNull(volume, nameof(volume)); + Argument.AssertNotNull(protectionPolicy, nameof(protectionPolicy)); + Argument.AssertNotNull(performancePolicy, nameof(performancePolicy)); + + StoragePool = storagePool; + Volume = volume; + ProtectionPolicy = protectionPolicy; + PerformancePolicy = performancePolicy; + } + + /// Initializes a new instance of . + /// Limits used for storage pool resources. + /// Limits used for volume resources. + /// internal. + /// internal. + /// Keeps track of any properties unknown to the library. + internal LimitDetails(StoragePoolLimits storagePool, VolumeLimits volume, ProtectionPolicyLimits protectionPolicy, PerformancePolicyLimits performancePolicy, IDictionary serializedAdditionalRawData) + { + StoragePool = storagePool; + Volume = volume; + ProtectionPolicy = protectionPolicy; + PerformancePolicy = performancePolicy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal LimitDetails() + { + } + + /// Limits used for storage pool resources. + public StoragePoolLimits StoragePool { get; } + /// Limits used for volume resources. + internal VolumeLimits Volume { get; } + /// Provisioned size limits for a volume, in bytes. + public RangeLimits VolumeProvisionedSize + { + get => Volume?.ProvisionedSize; + } + + /// internal. + public ProtectionPolicyLimits ProtectionPolicy { get; } + /// internal. + public PerformancePolicyLimits PerformancePolicy { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/MarketplaceDetails.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/MarketplaceDetails.Serialization.cs new file mode 100644 index 000000000000..29d77a40c660 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/MarketplaceDetails.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class MarketplaceDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplaceDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(SubscriptionId)) + { + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + } + if (Optional.IsDefined(SubscriptionStatus)) + { + writer.WritePropertyName("subscriptionStatus"u8); + writer.WriteStringValue(SubscriptionStatus.Value.ToString()); + } + writer.WritePropertyName("offerDetails"u8); + writer.WriteObjectValue(OfferDetails, 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 + } + } + } + + MarketplaceDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplaceDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMarketplaceDetails(document.RootElement, options); + } + + internal static MarketplaceDetails DeserializeMarketplaceDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string subscriptionId = default; + MarketplaceSubscriptionStatus? subscriptionStatus = default; + OfferDetails offerDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("subscriptionStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subscriptionStatus = new MarketplaceSubscriptionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("offerDetails"u8)) + { + offerDetails = OfferDetails.DeserializeOfferDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MarketplaceDetails(subscriptionId, subscriptionStatus, offerDetails, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(MarketplaceDetails)} does not support writing '{options.Format}' format."); + } + } + + MarketplaceDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMarketplaceDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MarketplaceDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/MarketplaceDetails.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/MarketplaceDetails.cs new file mode 100644 index 000000000000..0d49ac90238f --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/MarketplaceDetails.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Marketplace details. + public partial class MarketplaceDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Offer details of the marketplace subscription. + /// is null. + public MarketplaceDetails(OfferDetails offerDetails) + { + Argument.AssertNotNull(offerDetails, nameof(offerDetails)); + + OfferDetails = offerDetails; + } + + /// Initializes a new instance of . + /// Marketplace subscription ID. + /// Marketplace subscription status. + /// Offer details of the marketplace subscription. + /// Keeps track of any properties unknown to the library. + internal MarketplaceDetails(string subscriptionId, MarketplaceSubscriptionStatus? subscriptionStatus, OfferDetails offerDetails, IDictionary serializedAdditionalRawData) + { + SubscriptionId = subscriptionId; + SubscriptionStatus = subscriptionStatus; + OfferDetails = offerDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MarketplaceDetails() + { + } + + /// Marketplace subscription ID. + public string SubscriptionId { get; } + /// Marketplace subscription status. + public MarketplaceSubscriptionStatus? SubscriptionStatus { get; set; } + /// Offer details of the marketplace subscription. + public OfferDetails OfferDetails { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/MarketplaceSubscriptionStatus.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/MarketplaceSubscriptionStatus.cs new file mode 100644 index 000000000000..582818b0aaf8 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/MarketplaceSubscriptionStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Marketplace subscription status. + public readonly partial struct MarketplaceSubscriptionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MarketplaceSubscriptionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingFulfillmentStartValue = "PendingFulfillmentStart"; + private const string SubscribedValue = "Subscribed"; + private const string SuspendedValue = "Suspended"; + private const string UnsubscribedValue = "Unsubscribed"; + + /// Marketplace subscription purchased but not yet activated. + public static MarketplaceSubscriptionStatus PendingFulfillmentStart { get; } = new MarketplaceSubscriptionStatus(PendingFulfillmentStartValue); + /// Marketplace subscription activated. + public static MarketplaceSubscriptionStatus Subscribed { get; } = new MarketplaceSubscriptionStatus(SubscribedValue); + /// Marketplace subscription suspended due to missing customer payment. + public static MarketplaceSubscriptionStatus Suspended { get; } = new MarketplaceSubscriptionStatus(SuspendedValue); + /// Marketplace subscription cancelled. + public static MarketplaceSubscriptionStatus Unsubscribed { get; } = new MarketplaceSubscriptionStatus(UnsubscribedValue); + /// Determines if two values are the same. + public static bool operator ==(MarketplaceSubscriptionStatus left, MarketplaceSubscriptionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MarketplaceSubscriptionStatus left, MarketplaceSubscriptionStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MarketplaceSubscriptionStatus(string value) => new MarketplaceSubscriptionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MarketplaceSubscriptionStatus other && Equals(other); + /// + public bool Equals(MarketplaceSubscriptionStatus 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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/OfferDetails.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/OfferDetails.Serialization.cs new file mode 100644 index 000000000000..125d14d42c6c --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/OfferDetails.Serialization.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class OfferDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OfferDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("publisherId"u8); + writer.WriteStringValue(PublisherId); + writer.WritePropertyName("offerId"u8); + writer.WriteStringValue(OfferId); + writer.WritePropertyName("planId"u8); + writer.WriteStringValue(PlanId); + if (Optional.IsDefined(PlanName)) + { + writer.WritePropertyName("planName"u8); + writer.WriteStringValue(PlanName); + } + if (Optional.IsDefined(TermUnit)) + { + writer.WritePropertyName("termUnit"u8); + writer.WriteStringValue(TermUnit); + } + if (Optional.IsDefined(TermId)) + { + writer.WritePropertyName("termId"u8); + writer.WriteStringValue(TermId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OfferDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OfferDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOfferDetails(document.RootElement, options); + } + + internal static OfferDetails DeserializeOfferDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string publisherId = default; + string offerId = default; + string planId = default; + string planName = default; + string termUnit = default; + string termId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("publisherId"u8)) + { + publisherId = property.Value.GetString(); + continue; + } + if (property.NameEquals("offerId"u8)) + { + offerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("planId"u8)) + { + planId = property.Value.GetString(); + continue; + } + if (property.NameEquals("planName"u8)) + { + planName = property.Value.GetString(); + continue; + } + if (property.NameEquals("termUnit"u8)) + { + termUnit = property.Value.GetString(); + continue; + } + if (property.NameEquals("termId"u8)) + { + termId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OfferDetails( + publisherId, + offerId, + planId, + planName, + termUnit, + termId, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(OfferDetails)} does not support writing '{options.Format}' format."); + } + } + + OfferDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOfferDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OfferDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/OfferDetails.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/OfferDetails.cs new file mode 100644 index 000000000000..61ae5b70496b --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/OfferDetails.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Offer details for the marketplace that is selected by the user. + public partial class OfferDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Publisher ID for the marketplace offer. + /// Offer ID for the marketplace offer. + /// Plan ID for the marketplace offer. + /// , or is null. + public OfferDetails(string publisherId, string offerId, string planId) + { + Argument.AssertNotNull(publisherId, nameof(publisherId)); + Argument.AssertNotNull(offerId, nameof(offerId)); + Argument.AssertNotNull(planId, nameof(planId)); + + PublisherId = publisherId; + OfferId = offerId; + PlanId = planId; + } + + /// Initializes a new instance of . + /// Publisher ID for the marketplace offer. + /// Offer ID for the marketplace offer. + /// Plan ID for the marketplace offer. + /// Plan Name for the marketplace offer. + /// Term Unit for the marketplace offer. + /// Term ID for the marketplace offer. + /// Keeps track of any properties unknown to the library. + internal OfferDetails(string publisherId, string offerId, string planId, string planName, string termUnit, string termId, IDictionary serializedAdditionalRawData) + { + PublisherId = publisherId; + OfferId = offerId; + PlanId = planId; + PlanName = planName; + TermUnit = termUnit; + TermId = termId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OfferDetails() + { + } + + /// Publisher ID for the marketplace offer. + public string PublisherId { get; set; } + /// Offer ID for the marketplace offer. + public string OfferId { get; set; } + /// Plan ID for the marketplace offer. + public string PlanId { get; set; } + /// Plan Name for the marketplace offer. + public string PlanName { get; set; } + /// Term Unit for the marketplace offer. + public string TermUnit { get; set; } + /// Term ID for the marketplace offer. + public string TermId { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/PerformancePolicyLimits.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/PerformancePolicyLimits.Serialization.cs new file mode 100644 index 000000000000..391e2dbeb0fa --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/PerformancePolicyLimits.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class PerformancePolicyLimits : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PerformancePolicyLimits)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("iopsLimit"u8); + writer.WriteObjectValue(IopsLimit, options); + writer.WritePropertyName("bandwidthLimit"u8); + writer.WriteObjectValue(BandwidthLimit, 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 + } + } + } + + PerformancePolicyLimits IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PerformancePolicyLimits)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePerformancePolicyLimits(document.RootElement, options); + } + + internal static PerformancePolicyLimits DeserializePerformancePolicyLimits(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RangeLimits iopsLimit = default; + RangeLimits bandwidthLimit = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("iopsLimit"u8)) + { + iopsLimit = RangeLimits.DeserializeRangeLimits(property.Value, options); + continue; + } + if (property.NameEquals("bandwidthLimit"u8)) + { + bandwidthLimit = RangeLimits.DeserializeRangeLimits(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PerformancePolicyLimits(iopsLimit, bandwidthLimit, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(PerformancePolicyLimits)} does not support writing '{options.Format}' format."); + } + } + + PerformancePolicyLimits IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePerformancePolicyLimits(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PerformancePolicyLimits)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/PerformancePolicyLimits.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/PerformancePolicyLimits.cs new file mode 100644 index 000000000000..bbc79730087c --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/PerformancePolicyLimits.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.PureStorageBlock.Models +{ + /// internal. + public partial class PerformancePolicyLimits + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// internal. + /// internal. + /// or is null. + internal PerformancePolicyLimits(RangeLimits iopsLimit, RangeLimits bandwidthLimit) + { + Argument.AssertNotNull(iopsLimit, nameof(iopsLimit)); + Argument.AssertNotNull(bandwidthLimit, nameof(bandwidthLimit)); + + IopsLimit = iopsLimit; + BandwidthLimit = bandwidthLimit; + } + + /// Initializes a new instance of . + /// internal. + /// internal. + /// Keeps track of any properties unknown to the library. + internal PerformancePolicyLimits(RangeLimits iopsLimit, RangeLimits bandwidthLimit, IDictionary serializedAdditionalRawData) + { + IopsLimit = iopsLimit; + BandwidthLimit = bandwidthLimit; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PerformancePolicyLimits() + { + } + + /// internal. + public RangeLimits IopsLimit { get; } + /// internal. + public RangeLimits BandwidthLimit { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ProtectionPolicyLimits.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ProtectionPolicyLimits.Serialization.cs new file mode 100644 index 000000000000..8f57ac088014 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ProtectionPolicyLimits.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class ProtectionPolicyLimits : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectionPolicyLimits)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("frequency"u8); + writer.WriteObjectValue(Frequency, options); + writer.WritePropertyName("retention"u8); + writer.WriteObjectValue(Retention, 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 + } + } + } + + ProtectionPolicyLimits IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectionPolicyLimits)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectionPolicyLimits(document.RootElement, options); + } + + internal static ProtectionPolicyLimits DeserializeProtectionPolicyLimits(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RangeLimits frequency = default; + RangeLimits retention = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("frequency"u8)) + { + frequency = RangeLimits.DeserializeRangeLimits(property.Value, options); + continue; + } + if (property.NameEquals("retention"u8)) + { + retention = RangeLimits.DeserializeRangeLimits(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProtectionPolicyLimits(frequency, retention, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(ProtectionPolicyLimits)} does not support writing '{options.Format}' format."); + } + } + + ProtectionPolicyLimits IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProtectionPolicyLimits(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectionPolicyLimits)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ProtectionPolicyLimits.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ProtectionPolicyLimits.cs new file mode 100644 index 000000000000..49ceb2dae585 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ProtectionPolicyLimits.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.PureStorageBlock.Models +{ + /// internal. + public partial class ProtectionPolicyLimits + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// internal. + /// internal. + /// or is null. + internal ProtectionPolicyLimits(RangeLimits frequency, RangeLimits retention) + { + Argument.AssertNotNull(frequency, nameof(frequency)); + Argument.AssertNotNull(retention, nameof(retention)); + + Frequency = frequency; + Retention = retention; + } + + /// Initializes a new instance of . + /// internal. + /// internal. + /// Keeps track of any properties unknown to the library. + internal ProtectionPolicyLimits(RangeLimits frequency, RangeLimits retention, IDictionary serializedAdditionalRawData) + { + Frequency = frequency; + Retention = retention; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProtectionPolicyLimits() + { + } + + /// internal. + public RangeLimits Frequency { get; } + /// internal. + public RangeLimits Retention { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ProvisioningState.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..095f4ac41f3f --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ProvisioningState.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.PureStorageBlock.Models +{ + /// The status of the current operation. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + + /// Resource has been created. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Resource creation failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// Deletion in progress. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// Change accepted for processing. + public static ProvisioningState Accepted { get; } = new ProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/RangeLimits.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/RangeLimits.Serialization.cs new file mode 100644 index 000000000000..020e1b5e9d92 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/RangeLimits.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class RangeLimits : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RangeLimits)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("min"u8); + writer.WriteNumberValue(Min); + writer.WritePropertyName("max"u8); + writer.WriteNumberValue(Max); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RangeLimits IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RangeLimits)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRangeLimits(document.RootElement, options); + } + + internal static RangeLimits DeserializeRangeLimits(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long min = default; + long max = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("min"u8)) + { + min = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("max"u8)) + { + max = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RangeLimits(min, max, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(RangeLimits)} does not support writing '{options.Format}' format."); + } + } + + RangeLimits IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRangeLimits(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RangeLimits)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/RangeLimits.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/RangeLimits.cs new file mode 100644 index 000000000000..a5d32e8b676d --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/RangeLimits.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Minimum and maximum values for a property. + public partial class RangeLimits + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Minimum value of the property. + /// Maximum value of the property. + internal RangeLimits(long min, long max) + { + Min = min; + Max = max; + } + + /// Initializes a new instance of . + /// Minimum value of the property. + /// Maximum value of the property. + /// Keeps track of any properties unknown to the library. + internal RangeLimits(long min, long max, IDictionary serializedAdditionalRawData) + { + Min = min; + Max = max; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RangeLimits() + { + } + + /// Minimum value of the property. + public long Min { get; } + /// Maximum value of the property. + public long Max { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingStatus.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingStatus.Serialization.cs new file mode 100644 index 000000000000..848028faf1f3 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingStatus.Serialization.cs @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class ReservationBillingStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReservationBillingStatus)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp); + writer.WritePropertyName("totalUsedCapacityReported"u8); + writer.WriteNumberValue(TotalUsedCapacityReported); + writer.WritePropertyName("lowDrrPoolCount"u8); + writer.WriteNumberValue(LowDrrPoolCount); + writer.WritePropertyName("drrWeightedAverage"u8); + writer.WriteNumberValue(DrrWeightedAverage); + writer.WritePropertyName("totalNonReducibleReported"u8); + writer.WriteNumberValue(TotalNonReducibleReported); + writer.WritePropertyName("extraUsedCapacityNonReducible"u8); + writer.WriteNumberValue(ExtraUsedCapacityNonReducible); + writer.WritePropertyName("extraUsedCapacityLowUsageRounding"u8); + writer.WriteNumberValue(ExtraUsedCapacityLowUsageRounding); + writer.WritePropertyName("extraUsedCapacityNonReduciblePlanDiscount"u8); + writer.WriteNumberValue(ExtraUsedCapacityNonReduciblePlanDiscount); + writer.WritePropertyName("totalUsedCapacityBilled"u8); + writer.WriteNumberValue(TotalUsedCapacityBilled); + writer.WritePropertyName("totalUsedCapacityIncludedPlan"u8); + writer.WriteNumberValue(TotalUsedCapacityIncludedPlan); + writer.WritePropertyName("totalUsedCapacityOverage"u8); + writer.WriteNumberValue(TotalUsedCapacityOverage); + writer.WritePropertyName("totalPerformanceReported"u8); + writer.WriteNumberValue(TotalPerformanceReported); + writer.WritePropertyName("totalPerformanceIncludedPlan"u8); + writer.WriteNumberValue(TotalPerformanceIncludedPlan); + writer.WritePropertyName("totalPerformanceOverage"u8); + writer.WriteNumberValue(TotalPerformanceOverage); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ReservationBillingStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReservationBillingStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReservationBillingStatus(document.RootElement, options); + } + + internal static ReservationBillingStatus DeserializeReservationBillingStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string timestamp = default; + long totalUsedCapacityReported = default; + int lowDrrPoolCount = default; + double drrWeightedAverage = default; + long totalNonReducibleReported = default; + long extraUsedCapacityNonReducible = default; + long extraUsedCapacityLowUsageRounding = default; + long extraUsedCapacityNonReduciblePlanDiscount = default; + long totalUsedCapacityBilled = default; + long totalUsedCapacityIncludedPlan = default; + long totalUsedCapacityOverage = default; + long totalPerformanceReported = default; + long totalPerformanceIncludedPlan = default; + long totalPerformanceOverage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("timestamp"u8)) + { + timestamp = property.Value.GetString(); + continue; + } + if (property.NameEquals("totalUsedCapacityReported"u8)) + { + totalUsedCapacityReported = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("lowDrrPoolCount"u8)) + { + lowDrrPoolCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("drrWeightedAverage"u8)) + { + drrWeightedAverage = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("totalNonReducibleReported"u8)) + { + totalNonReducibleReported = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("extraUsedCapacityNonReducible"u8)) + { + extraUsedCapacityNonReducible = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("extraUsedCapacityLowUsageRounding"u8)) + { + extraUsedCapacityLowUsageRounding = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("extraUsedCapacityNonReduciblePlanDiscount"u8)) + { + extraUsedCapacityNonReduciblePlanDiscount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("totalUsedCapacityBilled"u8)) + { + totalUsedCapacityBilled = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("totalUsedCapacityIncludedPlan"u8)) + { + totalUsedCapacityIncludedPlan = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("totalUsedCapacityOverage"u8)) + { + totalUsedCapacityOverage = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("totalPerformanceReported"u8)) + { + totalPerformanceReported = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("totalPerformanceIncludedPlan"u8)) + { + totalPerformanceIncludedPlan = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("totalPerformanceOverage"u8)) + { + totalPerformanceOverage = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReservationBillingStatus( + timestamp, + totalUsedCapacityReported, + lowDrrPoolCount, + drrWeightedAverage, + totalNonReducibleReported, + extraUsedCapacityNonReducible, + extraUsedCapacityLowUsageRounding, + extraUsedCapacityNonReduciblePlanDiscount, + totalUsedCapacityBilled, + totalUsedCapacityIncludedPlan, + totalUsedCapacityOverage, + totalPerformanceReported, + totalPerformanceIncludedPlan, + totalPerformanceOverage, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(ReservationBillingStatus)} does not support writing '{options.Format}' format."); + } + } + + ReservationBillingStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReservationBillingStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReservationBillingStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingStatus.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingStatus.cs new file mode 100644 index 000000000000..1e1139f8e6c2 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingStatus.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Latest billing status for this reservation. + public partial class ReservationBillingStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Timestamp for the latest update of this billing status, in RFC 3339 format. + /// Total used capacity as reported by associated storage pools. In bytes. + /// How many associated storage pools reported low data reduction ratio (DRR). + /// Weighted average of the data-reduction ratio for all associated pools. + /// The sum of total used capacity for all pools with low DRR, if the DRR penalty applies. In bytes. + /// Extra capacity added because of low DRR storage pools; In bytes. + /// Extra capacity added when rounding up low-usage pools to 30TiB. In bytes. + /// Extra capacity discounted due to plan forgiving some low-DRR usage. In bytes. + /// Total used capacity actually billed. In bytes. + /// Total used capacity included in plan. In bytes. + /// Total used capacity reported at on-demand price. In bytes. + /// The sum of all performance settings across the pools under this reservation. In MB per second. + /// Total performance amount included in plan. In bytes per second. + /// Total performance amount reported at on-demand price. In MB per second. + /// is null. + internal ReservationBillingStatus(string timestamp, long totalUsedCapacityReported, int lowDrrPoolCount, double drrWeightedAverage, long totalNonReducibleReported, long extraUsedCapacityNonReducible, long extraUsedCapacityLowUsageRounding, long extraUsedCapacityNonReduciblePlanDiscount, long totalUsedCapacityBilled, long totalUsedCapacityIncludedPlan, long totalUsedCapacityOverage, long totalPerformanceReported, long totalPerformanceIncludedPlan, long totalPerformanceOverage) + { + Argument.AssertNotNull(timestamp, nameof(timestamp)); + + Timestamp = timestamp; + TotalUsedCapacityReported = totalUsedCapacityReported; + LowDrrPoolCount = lowDrrPoolCount; + DrrWeightedAverage = drrWeightedAverage; + TotalNonReducibleReported = totalNonReducibleReported; + ExtraUsedCapacityNonReducible = extraUsedCapacityNonReducible; + ExtraUsedCapacityLowUsageRounding = extraUsedCapacityLowUsageRounding; + ExtraUsedCapacityNonReduciblePlanDiscount = extraUsedCapacityNonReduciblePlanDiscount; + TotalUsedCapacityBilled = totalUsedCapacityBilled; + TotalUsedCapacityIncludedPlan = totalUsedCapacityIncludedPlan; + TotalUsedCapacityOverage = totalUsedCapacityOverage; + TotalPerformanceReported = totalPerformanceReported; + TotalPerformanceIncludedPlan = totalPerformanceIncludedPlan; + TotalPerformanceOverage = totalPerformanceOverage; + } + + /// Initializes a new instance of . + /// Timestamp for the latest update of this billing status, in RFC 3339 format. + /// Total used capacity as reported by associated storage pools. In bytes. + /// How many associated storage pools reported low data reduction ratio (DRR). + /// Weighted average of the data-reduction ratio for all associated pools. + /// The sum of total used capacity for all pools with low DRR, if the DRR penalty applies. In bytes. + /// Extra capacity added because of low DRR storage pools; In bytes. + /// Extra capacity added when rounding up low-usage pools to 30TiB. In bytes. + /// Extra capacity discounted due to plan forgiving some low-DRR usage. In bytes. + /// Total used capacity actually billed. In bytes. + /// Total used capacity included in plan. In bytes. + /// Total used capacity reported at on-demand price. In bytes. + /// The sum of all performance settings across the pools under this reservation. In MB per second. + /// Total performance amount included in plan. In bytes per second. + /// Total performance amount reported at on-demand price. In MB per second. + /// Keeps track of any properties unknown to the library. + internal ReservationBillingStatus(string timestamp, long totalUsedCapacityReported, int lowDrrPoolCount, double drrWeightedAverage, long totalNonReducibleReported, long extraUsedCapacityNonReducible, long extraUsedCapacityLowUsageRounding, long extraUsedCapacityNonReduciblePlanDiscount, long totalUsedCapacityBilled, long totalUsedCapacityIncludedPlan, long totalUsedCapacityOverage, long totalPerformanceReported, long totalPerformanceIncludedPlan, long totalPerformanceOverage, IDictionary serializedAdditionalRawData) + { + Timestamp = timestamp; + TotalUsedCapacityReported = totalUsedCapacityReported; + LowDrrPoolCount = lowDrrPoolCount; + DrrWeightedAverage = drrWeightedAverage; + TotalNonReducibleReported = totalNonReducibleReported; + ExtraUsedCapacityNonReducible = extraUsedCapacityNonReducible; + ExtraUsedCapacityLowUsageRounding = extraUsedCapacityLowUsageRounding; + ExtraUsedCapacityNonReduciblePlanDiscount = extraUsedCapacityNonReduciblePlanDiscount; + TotalUsedCapacityBilled = totalUsedCapacityBilled; + TotalUsedCapacityIncludedPlan = totalUsedCapacityIncludedPlan; + TotalUsedCapacityOverage = totalUsedCapacityOverage; + TotalPerformanceReported = totalPerformanceReported; + TotalPerformanceIncludedPlan = totalPerformanceIncludedPlan; + TotalPerformanceOverage = totalPerformanceOverage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReservationBillingStatus() + { + } + + /// Timestamp for the latest update of this billing status, in RFC 3339 format. + public string Timestamp { get; } + /// Total used capacity as reported by associated storage pools. In bytes. + public long TotalUsedCapacityReported { get; } + /// How many associated storage pools reported low data reduction ratio (DRR). + public int LowDrrPoolCount { get; } + /// Weighted average of the data-reduction ratio for all associated pools. + public double DrrWeightedAverage { get; } + /// The sum of total used capacity for all pools with low DRR, if the DRR penalty applies. In bytes. + public long TotalNonReducibleReported { get; } + /// Extra capacity added because of low DRR storage pools; In bytes. + public long ExtraUsedCapacityNonReducible { get; } + /// Extra capacity added when rounding up low-usage pools to 30TiB. In bytes. + public long ExtraUsedCapacityLowUsageRounding { get; } + /// Extra capacity discounted due to plan forgiving some low-DRR usage. In bytes. + public long ExtraUsedCapacityNonReduciblePlanDiscount { get; } + /// Total used capacity actually billed. In bytes. + public long TotalUsedCapacityBilled { get; } + /// Total used capacity included in plan. In bytes. + public long TotalUsedCapacityIncludedPlan { get; } + /// Total used capacity reported at on-demand price. In bytes. + public long TotalUsedCapacityOverage { get; } + /// The sum of all performance settings across the pools under this reservation. In MB per second. + public long TotalPerformanceReported { get; } + /// Total performance amount included in plan. In bytes per second. + public long TotalPerformanceIncludedPlan { get; } + /// Total performance amount reported at on-demand price. In MB per second. + public long TotalPerformanceOverage { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingUsageReport.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingUsageReport.Serialization.cs new file mode 100644 index 000000000000..5f8e0b4f3692 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingUsageReport.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class ReservationBillingUsageReport : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReservationBillingUsageReport)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp); + writer.WritePropertyName("billingUsageProperties"u8); + writer.WriteStartArray(); + foreach (var item in BillingUsageProperties) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("overallStatusMessage"u8); + writer.WriteStringValue(OverallStatusMessage); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ReservationBillingUsageReport IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReservationBillingUsageReport)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReservationBillingUsageReport(document.RootElement, options); + } + + internal static ReservationBillingUsageReport DeserializeReservationBillingUsageReport(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string timestamp = default; + IReadOnlyList billingUsageProperties = default; + string overallStatusMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("timestamp"u8)) + { + timestamp = property.Value.GetString(); + continue; + } + if (property.NameEquals("billingUsageProperties"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BillingUsageProperty.DeserializeBillingUsageProperty(item, options)); + } + billingUsageProperties = array; + continue; + } + if (property.NameEquals("overallStatusMessage"u8)) + { + overallStatusMessage = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReservationBillingUsageReport(timestamp, billingUsageProperties, overallStatusMessage, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(ReservationBillingUsageReport)} does not support writing '{options.Format}' format."); + } + } + + ReservationBillingUsageReport IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReservationBillingUsageReport(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReservationBillingUsageReport)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingUsageReport.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingUsageReport.cs new file mode 100644 index 000000000000..03017fa1ece6 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationBillingUsageReport.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; +using System.Linq; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Represents a billing usage report, including overall status and detailed properties. + public partial class ReservationBillingUsageReport + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Latest formatted billing report for this reservation. + /// A list of detailed billing usage properties. + /// Overall status message of the billing usage report. + /// , or is null. + internal ReservationBillingUsageReport(string timestamp, IEnumerable billingUsageProperties, string overallStatusMessage) + { + Argument.AssertNotNull(timestamp, nameof(timestamp)); + Argument.AssertNotNull(billingUsageProperties, nameof(billingUsageProperties)); + Argument.AssertNotNull(overallStatusMessage, nameof(overallStatusMessage)); + + Timestamp = timestamp; + BillingUsageProperties = billingUsageProperties.ToList(); + OverallStatusMessage = overallStatusMessage; + } + + /// Initializes a new instance of . + /// Latest formatted billing report for this reservation. + /// A list of detailed billing usage properties. + /// Overall status message of the billing usage report. + /// Keeps track of any properties unknown to the library. + internal ReservationBillingUsageReport(string timestamp, IReadOnlyList billingUsageProperties, string overallStatusMessage, IDictionary serializedAdditionalRawData) + { + Timestamp = timestamp; + BillingUsageProperties = billingUsageProperties; + OverallStatusMessage = overallStatusMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReservationBillingUsageReport() + { + } + + /// Latest formatted billing report for this reservation. + public string Timestamp { get; } + /// A list of detailed billing usage properties. + public IReadOnlyList BillingUsageProperties { get; } + /// Overall status message of the billing usage report. + public string OverallStatusMessage { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationListResult.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationListResult.Serialization.cs new file mode 100644 index 000000000000..83ac0766d4ea --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationListResult.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.PureStorageBlock.Models +{ + internal partial class ReservationListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReservationListResult)} 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 + } + } + } + + ReservationListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReservationListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReservationListResult(document.RootElement, options); + } + + internal static ReservationListResult DeserializeReservationListResult(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(ReservationData.DeserializeReservationData(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 ReservationListResult(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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(ReservationListResult)} does not support writing '{options.Format}' format."); + } + } + + ReservationListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReservationListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReservationListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationListResult.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationListResult.cs new file mode 100644 index 000000000000..56546011427e --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationListResult.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.PureStorageBlock.Models +{ + /// The response of a Reservation list operation. + internal partial class ReservationListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 Reservation items on this page. + /// is null. + internal ReservationListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Reservation items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ReservationListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReservationListResult() + { + } + + /// The Reservation items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPatch.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPatch.Serialization.cs new file mode 100644 index 000000000000..6b3b985b1074 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPatch.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.PureStorageBlock.Models +{ + public partial class ReservationPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReservationPatch)} 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 + } + } + } + + ReservationPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReservationPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReservationPatch(document.RootElement, options); + } + + internal static ReservationPatch DeserializeReservationPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + ReservationUpdateProperties 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 = ReservationUpdateProperties.DeserializeReservationUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReservationPatch(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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(ReservationPatch)} does not support writing '{options.Format}' format."); + } + } + + ReservationPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReservationPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReservationPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPatch.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPatch.cs new file mode 100644 index 000000000000..adf05f1e9c62 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPatch.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.PureStorageBlock.Models +{ + /// The type used for update operations of the Reservation. + public partial class ReservationPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ReservationPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal ReservationPatch(IDictionary tags, ReservationUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + internal ReservationUpdateProperties Properties { get; set; } + /// User details. + public UserDetails ReservationUpdateUser + { + get => Properties is null ? default : Properties.User; + set + { + if (Properties is null) + Properties = new ReservationUpdateProperties(); + Properties.User = value; + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPropertiesBaseResourceProperties.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPropertiesBaseResourceProperties.Serialization.cs new file mode 100644 index 000000000000..ef76da229349 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPropertiesBaseResourceProperties.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class ReservationPropertiesBaseResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReservationPropertiesBaseResourceProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ReservationInternalId)) + { + writer.WritePropertyName("reservationInternalId"u8); + writer.WriteStringValue(ReservationInternalId); + } + writer.WritePropertyName("marketplace"u8); + writer.WriteObjectValue(Marketplace, options); + writer.WritePropertyName("user"u8); + writer.WriteObjectValue(User, options); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ReservationPropertiesBaseResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReservationPropertiesBaseResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReservationPropertiesBaseResourceProperties(document.RootElement, options); + } + + internal static ReservationPropertiesBaseResourceProperties DeserializeReservationPropertiesBaseResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string reservationInternalId = default; + MarketplaceDetails marketplace = default; + UserDetails user = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("reservationInternalId"u8)) + { + reservationInternalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("marketplace"u8)) + { + marketplace = MarketplaceDetails.DeserializeMarketplaceDetails(property.Value, options); + continue; + } + if (property.NameEquals("user"u8)) + { + user = UserDetails.DeserializeUserDetails(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReservationPropertiesBaseResourceProperties(reservationInternalId, marketplace, user, 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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(ReservationPropertiesBaseResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ReservationPropertiesBaseResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReservationPropertiesBaseResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReservationPropertiesBaseResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPropertiesBaseResourceProperties.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPropertiesBaseResourceProperties.cs new file mode 100644 index 000000000000..f72c09f449c6 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationPropertiesBaseResourceProperties.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Properties of a Reservation resource. + public partial class ReservationPropertiesBaseResourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Marketplace details. + /// User details. + /// or is null. + public ReservationPropertiesBaseResourceProperties(MarketplaceDetails marketplace, UserDetails user) + { + Argument.AssertNotNull(marketplace, nameof(marketplace)); + Argument.AssertNotNull(user, nameof(user)); + + Marketplace = marketplace; + User = user; + } + + /// Initializes a new instance of . + /// Pure Storage's internal ID for the reservation. + /// Marketplace details. + /// User details. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal ReservationPropertiesBaseResourceProperties(string reservationInternalId, MarketplaceDetails marketplace, UserDetails user, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + ReservationInternalId = reservationInternalId; + Marketplace = marketplace; + User = user; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReservationPropertiesBaseResourceProperties() + { + } + + /// Pure Storage's internal ID for the reservation. + public string ReservationInternalId { get; } + /// Marketplace details. + public MarketplaceDetails Marketplace { get; set; } + /// User details. + public UserDetails User { get; set; } + /// Provisioning state of the resource. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationUpdateProperties.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..a2a568797bd5 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationUpdateProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + internal partial class ReservationUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReservationUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(User)) + { + writer.WritePropertyName("user"u8); + writer.WriteObjectValue(User, 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 + } + } + } + + ReservationUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReservationUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReservationUpdateProperties(document.RootElement, options); + } + + internal static ReservationUpdateProperties DeserializeReservationUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + UserDetails user = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("user"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + user = UserDetails.DeserializeUserDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReservationUpdateProperties(user, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(ReservationUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + ReservationUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReservationUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReservationUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationUpdateProperties.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationUpdateProperties.cs new file mode 100644 index 000000000000..993c696ea975 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ReservationUpdateProperties.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.PureStorageBlock.Models +{ + /// The updatable properties of the Reservation. + internal partial class ReservationUpdateProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ReservationUpdateProperties() + { + } + + /// Initializes a new instance of . + /// User details. + /// Keeps track of any properties unknown to the library. + internal ReservationUpdateProperties(UserDetails user, IDictionary serializedAdditionalRawData) + { + User = user; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// User details. + public UserDetails User { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ResourceProvisioningState.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ResourceProvisioningState.cs new file mode 100644 index 000000000000..445d5bf26af1 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ResourceProvisioningState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// The provisioning state of a resource type. + public readonly partial struct ResourceProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResourceProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Resource has been created. + public static ResourceProvisioningState Succeeded { get; } = new ResourceProvisioningState(SucceededValue); + /// Resource creation failed. + public static ResourceProvisioningState Failed { get; } = new ResourceProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ResourceProvisioningState Canceled { get; } = new ResourceProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(ResourceProvisioningState left, ResourceProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResourceProvisioningState left, ResourceProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ResourceProvisioningState(string value) => new ResourceProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResourceProvisioningState other && Equals(other); + /// + public bool Equals(ResourceProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationHandle.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationHandle.Serialization.cs new file mode 100644 index 000000000000..37b0ea1b15bd --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationHandle.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class ServiceInitializationHandle : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceInitializationHandle)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ClusterResourceId)) + { + writer.WritePropertyName("sddcResourceId"u8); + writer.WriteStringValue(ClusterResourceId); + } + if (Optional.IsDefined(ServiceAccountUsername)) + { + writer.WritePropertyName("serviceAccountUsername"u8); + writer.WriteStringValue(ServiceAccountUsername); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ServiceInitializationHandle IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceInitializationHandle)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceInitializationHandle(document.RootElement, options); + } + + internal static ServiceInitializationHandle DeserializeServiceInitializationHandle(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string sddcResourceId = default; + string serviceAccountUsername = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sddcResourceId"u8)) + { + sddcResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceAccountUsername"u8)) + { + serviceAccountUsername = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServiceInitializationHandle(sddcResourceId, serviceAccountUsername, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(ServiceInitializationHandle)} does not support writing '{options.Format}' format."); + } + } + + ServiceInitializationHandle IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeServiceInitializationHandle(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServiceInitializationHandle)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationHandle.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationHandle.cs new file mode 100644 index 000000000000..c21026ce4a37 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationHandle.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.PureStorageBlock.Models +{ + /// Initialization handle used to configure the AVS SDDC to communicate with the storage pool. + public partial class ServiceInitializationHandle + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ServiceInitializationHandle() + { + } + + /// Initializes a new instance of . + /// Azure resource ID of the AVS SDDC the pool is connecting to. + /// Requested service account username. + /// Keeps track of any properties unknown to the library. + internal ServiceInitializationHandle(string clusterResourceId, string serviceAccountUsername, IDictionary serializedAdditionalRawData) + { + ClusterResourceId = clusterResourceId; + ServiceAccountUsername = serviceAccountUsername; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Azure resource ID of the AVS SDDC the pool is connecting to. + public string ClusterResourceId { get; } + /// Requested service account username. + public string ServiceAccountUsername { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationInfo.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationInfo.Serialization.cs new file mode 100644 index 000000000000..2490f5623b6c --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationInfo.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class ServiceInitializationInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceInitializationInfo)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ServiceAccountUsername)) + { + writer.WritePropertyName("serviceAccountUsername"u8); + writer.WriteStringValue(ServiceAccountUsername); + } + if (Optional.IsDefined(ServiceAccountPassword)) + { + writer.WritePropertyName("serviceAccountPassword"u8); + writer.WriteStringValue(ServiceAccountPassword); + } + if (Optional.IsDefined(VSphereIP)) + { + writer.WritePropertyName("vSphereIp"u8); + writer.WriteStringValue(VSphereIP); + } + if (Optional.IsDefined(VSphereCertificate)) + { + writer.WritePropertyName("vSphereCertificate"u8); + writer.WriteStringValue(VSphereCertificate); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ServiceInitializationInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceInitializationInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceInitializationInfo(document.RootElement, options); + } + + internal static ServiceInitializationInfo DeserializeServiceInitializationInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string serviceAccountUsername = default; + string serviceAccountPassword = default; + string vSphereIP = default; + string vSphereCertificate = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceAccountUsername"u8)) + { + serviceAccountUsername = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceAccountPassword"u8)) + { + serviceAccountPassword = property.Value.GetString(); + continue; + } + if (property.NameEquals("vSphereIp"u8)) + { + vSphereIP = property.Value.GetString(); + continue; + } + if (property.NameEquals("vSphereCertificate"u8)) + { + vSphereCertificate = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServiceInitializationInfo(serviceAccountUsername, serviceAccountPassword, vSphereIP, vSphereCertificate, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(ServiceInitializationInfo)} does not support writing '{options.Format}' format."); + } + } + + ServiceInitializationInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeServiceInitializationInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServiceInitializationInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationInfo.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationInfo.cs new file mode 100644 index 000000000000..141f80a9976c --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/ServiceInitializationInfo.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Explicit service initialization data. + public partial class ServiceInitializationInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ServiceInitializationInfo() + { + } + + /// Initializes a new instance of . + /// Service account username. + /// Service account password. + /// AVS instance's vSphere IP address. + /// AVS instance's vSphere certificate. + /// Keeps track of any properties unknown to the library. + internal ServiceInitializationInfo(string serviceAccountUsername, string serviceAccountPassword, string vSphereIP, string vSphereCertificate, IDictionary serializedAdditionalRawData) + { + ServiceAccountUsername = serviceAccountUsername; + ServiceAccountPassword = serviceAccountPassword; + VSphereIP = vSphereIP; + VSphereCertificate = vSphereCertificate; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Service account username. + public string ServiceAccountUsername { get; set; } + /// Service account password. + public string ServiceAccountPassword { get; set; } + /// AVS instance's vSphere IP address. + public string VSphereIP { get; set; } + /// AVS instance's vSphere certificate. + public string VSphereCertificate { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/SoftDeletion.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/SoftDeletion.Serialization.cs new file mode 100644 index 000000000000..fa9fb98babd9 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/SoftDeletion.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class SoftDeletion : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SoftDeletion)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("destroyed"u8); + writer.WriteBooleanValue(Destroyed); + if (options.Format != "W" && Optional.IsDefined(EradicationTimestamp)) + { + writer.WritePropertyName("eradicationTimestamp"u8); + writer.WriteStringValue(EradicationTimestamp); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SoftDeletion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SoftDeletion)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSoftDeletion(document.RootElement, options); + } + + internal static SoftDeletion DeserializeSoftDeletion(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool destroyed = default; + string eradicationTimestamp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("destroyed"u8)) + { + destroyed = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("eradicationTimestamp"u8)) + { + eradicationTimestamp = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SoftDeletion(destroyed, eradicationTimestamp, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(SoftDeletion)} does not support writing '{options.Format}' format."); + } + } + + SoftDeletion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSoftDeletion(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SoftDeletion)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/SoftDeletion.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/SoftDeletion.cs new file mode 100644 index 000000000000..b6c1168a6b87 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/SoftDeletion.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Soft-deletion state. + public partial class SoftDeletion + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// If false, the resource is active; if true, the resource has been destroyed; resources can be soft-deleted by setting destroyed to true, and recovered by setting it to false. + public SoftDeletion(bool destroyed) + { + Destroyed = destroyed; + } + + /// Initializes a new instance of . + /// If false, the resource is active; if true, the resource has been destroyed; resources can be soft-deleted by setting destroyed to true, and recovered by setting it to false. + /// Date at which the resource will be eradicated and impossible to recover, as an RFC 3339 timestamp; invalid if destroyed is false;. + /// Keeps track of any properties unknown to the library. + internal SoftDeletion(bool destroyed, string eradicationTimestamp, IDictionary serializedAdditionalRawData) + { + Destroyed = destroyed; + EradicationTimestamp = eradicationTimestamp; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SoftDeletion() + { + } + + /// If false, the resource is active; if true, the resource has been destroyed; resources can be soft-deleted by setting destroyed to true, and recovered by setting it to false. + public bool Destroyed { get; set; } + /// Date at which the resource will be eradicated and impossible to recover, as an RFC 3339 timestamp; invalid if destroyed is false;. + public string EradicationTimestamp { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Space.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Space.Serialization.cs new file mode 100644 index 000000000000..b9bca1112745 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Space.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.ResourceManager.PureStorageBlock.Models +{ + public partial class Space : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Space)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("totalUsed"u8); + writer.WriteNumberValue(TotalUsed); + writer.WritePropertyName("unique"u8); + writer.WriteNumberValue(Unique); + writer.WritePropertyName("snapshots"u8); + writer.WriteNumberValue(Snapshots); + writer.WritePropertyName("shared"u8); + writer.WriteNumberValue(Shared); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Space IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Space)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSpace(document.RootElement, options); + } + + internal static Space DeserializeSpace(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long totalUsed = default; + long unique = default; + long snapshots = default; + long shared = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("totalUsed"u8)) + { + totalUsed = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("unique"u8)) + { + unique = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("snapshots"u8)) + { + snapshots = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("shared"u8)) + { + shared = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Space(totalUsed, unique, snapshots, shared, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(Space)} does not support writing '{options.Format}' format."); + } + } + + Space IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSpace(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Space)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Space.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Space.cs new file mode 100644 index 000000000000..e942b6793869 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/Space.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Storage space usage. + public partial class Space + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Total space occupied by customer data (i.e., being billed for), in bytes. + /// Unique space occupied by customer data, in bytes; for a volume, this is the amount of storage that would be freed by deleting the volume, since snapshot and shared data would be kept. + /// Space occupied by data unique to one or more snapshots, in bytes. + /// Space occupied by duplicated data, meaning data shared with other volumes and snapshots as a result of data deduplication, in bytes. + internal Space(long totalUsed, long unique, long snapshots, long shared) + { + TotalUsed = totalUsed; + Unique = unique; + Snapshots = snapshots; + Shared = shared; + } + + /// Initializes a new instance of . + /// Total space occupied by customer data (i.e., being billed for), in bytes. + /// Unique space occupied by customer data, in bytes; for a volume, this is the amount of storage that would be freed by deleting the volume, since snapshot and shared data would be kept. + /// Space occupied by data unique to one or more snapshots, in bytes. + /// Space occupied by duplicated data, meaning data shared with other volumes and snapshots as a result of data deduplication, in bytes. + /// Keeps track of any properties unknown to the library. + internal Space(long totalUsed, long unique, long snapshots, long shared, IDictionary serializedAdditionalRawData) + { + TotalUsed = totalUsed; + Unique = unique; + Snapshots = snapshots; + Shared = shared; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Space() + { + } + + /// Total space occupied by customer data (i.e., being billed for), in bytes. + public long TotalUsed { get; } + /// Unique space occupied by customer data, in bytes; for a volume, this is the amount of storage that would be freed by deleting the volume, since snapshot and shared data would be kept. + public long Unique { get; } + /// Space occupied by data unique to one or more snapshots, in bytes. + public long Snapshots { get; } + /// Space occupied by duplicated data, meaning data shared with other volumes and snapshots as a result of data deduplication, in bytes. + public long Shared { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolEnableAvsConnectionPost.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolEnableAvsConnectionPost.Serialization.cs new file mode 100644 index 000000000000..8ecf9acc824f --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolEnableAvsConnectionPost.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class StoragePoolEnableAvsConnectionPost : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolEnableAvsConnectionPost)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("sddcResourceId"u8); + writer.WriteStringValue(ClusterResourceId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StoragePoolEnableAvsConnectionPost IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolEnableAvsConnectionPost)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStoragePoolEnableAvsConnectionPost(document.RootElement, options); + } + + internal static StoragePoolEnableAvsConnectionPost DeserializeStoragePoolEnableAvsConnectionPost(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string sddcResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sddcResourceId"u8)) + { + sddcResourceId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StoragePoolEnableAvsConnectionPost(sddcResourceId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(StoragePoolEnableAvsConnectionPost)} does not support writing '{options.Format}' format."); + } + } + + StoragePoolEnableAvsConnectionPost IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStoragePoolEnableAvsConnectionPost(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StoragePoolEnableAvsConnectionPost)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolEnableAvsConnectionPost.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolEnableAvsConnectionPost.cs new file mode 100644 index 000000000000..564a3a7ea450 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolEnableAvsConnectionPost.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// EnableAvsConnection payload information. + public partial class StoragePoolEnableAvsConnectionPost + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Azure resource ID of the AVS SDDC to connect to. + /// is null. + public StoragePoolEnableAvsConnectionPost(string clusterResourceId) + { + Argument.AssertNotNull(clusterResourceId, nameof(clusterResourceId)); + + ClusterResourceId = clusterResourceId; + } + + /// Initializes a new instance of . + /// Azure resource ID of the AVS SDDC to connect to. + /// Keeps track of any properties unknown to the library. + internal StoragePoolEnableAvsConnectionPost(string clusterResourceId, IDictionary serializedAdditionalRawData) + { + ClusterResourceId = clusterResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StoragePoolEnableAvsConnectionPost() + { + } + + /// Azure resource ID of the AVS SDDC to connect to. + public string ClusterResourceId { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolFinalizeAvsConnectionPost.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolFinalizeAvsConnectionPost.Serialization.cs new file mode 100644 index 000000000000..775ece9a8e4a --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolFinalizeAvsConnectionPost.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.PureStorageBlock.Models +{ + public partial class StoragePoolFinalizeAvsConnectionPost : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolFinalizeAvsConnectionPost)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ServiceInitializationDataEnc)) + { + writer.WritePropertyName("serviceInitializationDataEnc"u8); + writer.WriteStringValue(ServiceInitializationDataEnc); + } + if (Optional.IsDefined(ServiceInitializationData)) + { + writer.WritePropertyName("serviceInitializationData"u8); + writer.WriteObjectValue(ServiceInitializationData, 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 + } + } + } + + StoragePoolFinalizeAvsConnectionPost IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolFinalizeAvsConnectionPost)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStoragePoolFinalizeAvsConnectionPost(document.RootElement, options); + } + + internal static StoragePoolFinalizeAvsConnectionPost DeserializeStoragePoolFinalizeAvsConnectionPost(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string serviceInitializationDataEnc = default; + ServiceInitializationInfo serviceInitializationData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceInitializationDataEnc"u8)) + { + serviceInitializationDataEnc = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceInitializationData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceInitializationData = ServiceInitializationInfo.DeserializeServiceInitializationInfo(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StoragePoolFinalizeAvsConnectionPost(serviceInitializationDataEnc, serviceInitializationData, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(StoragePoolFinalizeAvsConnectionPost)} does not support writing '{options.Format}' format."); + } + } + + StoragePoolFinalizeAvsConnectionPost IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStoragePoolFinalizeAvsConnectionPost(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StoragePoolFinalizeAvsConnectionPost)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolFinalizeAvsConnectionPost.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolFinalizeAvsConnectionPost.cs new file mode 100644 index 000000000000..01808ab747a1 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolFinalizeAvsConnectionPost.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.PureStorageBlock.Models +{ + /// FinalizeAvsConnection payload information, either encoded or explicit. + public partial class StoragePoolFinalizeAvsConnectionPost + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 StoragePoolFinalizeAvsConnectionPost() + { + } + + /// Initializes a new instance of . + /// Encoded AVS connection information. + /// Explicit AVS connection information. + /// Keeps track of any properties unknown to the library. + internal StoragePoolFinalizeAvsConnectionPost(string serviceInitializationDataEnc, ServiceInitializationInfo serviceInitializationData, IDictionary serializedAdditionalRawData) + { + ServiceInitializationDataEnc = serviceInitializationDataEnc; + ServiceInitializationData = serviceInitializationData; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Encoded AVS connection information. + public string ServiceInitializationDataEnc { get; set; } + /// Explicit AVS connection information. + public ServiceInitializationInfo ServiceInitializationData { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolHealthInfo.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolHealthInfo.Serialization.cs new file mode 100644 index 000000000000..058765ae8edb --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolHealthInfo.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.PureStorageBlock.Models +{ + public partial class StoragePoolHealthInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolHealthInfo)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("health"u8); + writer.WriteObjectValue(Health, options); + writer.WritePropertyName("alerts"u8); + writer.WriteStartArray(); + foreach (var item in Alerts) + { + 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 + } + } + } + + StoragePoolHealthInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolHealthInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStoragePoolHealthInfo(document.RootElement, options); + } + + internal static StoragePoolHealthInfo DeserializeStoragePoolHealthInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HealthDetails health = default; + IReadOnlyList alerts = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("health"u8)) + { + health = HealthDetails.DeserializeHealthDetails(property.Value, options); + continue; + } + if (property.NameEquals("alerts"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Alert.DeserializeAlert(item, options)); + } + alerts = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StoragePoolHealthInfo(health, alerts, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(StoragePoolHealthInfo)} does not support writing '{options.Format}' format."); + } + } + + StoragePoolHealthInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStoragePoolHealthInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StoragePoolHealthInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolHealthInfo.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolHealthInfo.cs new file mode 100644 index 000000000000..5f8910ad0861 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolHealthInfo.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.ResourceManager.PureStorageBlock.Models +{ + /// Health information for a storage pool. + public partial class StoragePoolHealthInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Health metrics. + /// List of health alerts. + /// or is null. + internal StoragePoolHealthInfo(HealthDetails health, IEnumerable alerts) + { + Argument.AssertNotNull(health, nameof(health)); + Argument.AssertNotNull(alerts, nameof(alerts)); + + Health = health; + Alerts = alerts.ToList(); + } + + /// Initializes a new instance of . + /// Health metrics. + /// List of health alerts. + /// Keeps track of any properties unknown to the library. + internal StoragePoolHealthInfo(HealthDetails health, IReadOnlyList alerts, IDictionary serializedAdditionalRawData) + { + Health = health; + Alerts = alerts; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StoragePoolHealthInfo() + { + } + + /// Health metrics. + public HealthDetails Health { get; } + /// List of health alerts. + public IReadOnlyList Alerts { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolLimits.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolLimits.Serialization.cs new file mode 100644 index 000000000000..407671530a20 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolLimits.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class StoragePoolLimits : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolLimits)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("provisionedBandwidthMbPerSec"u8); + writer.WriteObjectValue(ProvisionedBandwidthMbPerSec, options); + writer.WritePropertyName("provisionedIops"u8); + writer.WriteObjectValue(ProvisionedIops, options); + writer.WritePropertyName("physicalAvailabilityZones"u8); + writer.WriteStartArray(); + foreach (var item in PhysicalAvailabilityZones) + { + 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 + } + } + } + + StoragePoolLimits IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolLimits)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStoragePoolLimits(document.RootElement, options); + } + + internal static StoragePoolLimits DeserializeStoragePoolLimits(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RangeLimits provisionedBandwidthMbPerSec = default; + RangeLimits provisionedIops = default; + IReadOnlyList physicalAvailabilityZones = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisionedBandwidthMbPerSec"u8)) + { + provisionedBandwidthMbPerSec = RangeLimits.DeserializeRangeLimits(property.Value, options); + continue; + } + if (property.NameEquals("provisionedIops"u8)) + { + provisionedIops = RangeLimits.DeserializeRangeLimits(property.Value, options); + continue; + } + if (property.NameEquals("physicalAvailabilityZones"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + physicalAvailabilityZones = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StoragePoolLimits(provisionedBandwidthMbPerSec, provisionedIops, physicalAvailabilityZones, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(StoragePoolLimits)} does not support writing '{options.Format}' format."); + } + } + + StoragePoolLimits IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStoragePoolLimits(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StoragePoolLimits)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolLimits.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolLimits.cs new file mode 100644 index 000000000000..26068338d88d --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolLimits.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; +using System.Linq; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Limits used for storage pool creation. + public partial class StoragePoolLimits + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Allowed provisioned bandwidth range for a storage pool, in MB/s. + /// Allowed provisioned IOPS range for a storage pool, as a number of operations. + /// List of physical availability zones in the region in which storage pools can be deployed; some Azure regions do not support the necessary resources in all availability zones. + /// , or is null. + internal StoragePoolLimits(RangeLimits provisionedBandwidthMbPerSec, RangeLimits provisionedIops, IEnumerable physicalAvailabilityZones) + { + Argument.AssertNotNull(provisionedBandwidthMbPerSec, nameof(provisionedBandwidthMbPerSec)); + Argument.AssertNotNull(provisionedIops, nameof(provisionedIops)); + Argument.AssertNotNull(physicalAvailabilityZones, nameof(physicalAvailabilityZones)); + + ProvisionedBandwidthMbPerSec = provisionedBandwidthMbPerSec; + ProvisionedIops = provisionedIops; + PhysicalAvailabilityZones = physicalAvailabilityZones.ToList(); + } + + /// Initializes a new instance of . + /// Allowed provisioned bandwidth range for a storage pool, in MB/s. + /// Allowed provisioned IOPS range for a storage pool, as a number of operations. + /// List of physical availability zones in the region in which storage pools can be deployed; some Azure regions do not support the necessary resources in all availability zones. + /// Keeps track of any properties unknown to the library. + internal StoragePoolLimits(RangeLimits provisionedBandwidthMbPerSec, RangeLimits provisionedIops, IReadOnlyList physicalAvailabilityZones, IDictionary serializedAdditionalRawData) + { + ProvisionedBandwidthMbPerSec = provisionedBandwidthMbPerSec; + ProvisionedIops = provisionedIops; + PhysicalAvailabilityZones = physicalAvailabilityZones; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StoragePoolLimits() + { + } + + /// Allowed provisioned bandwidth range for a storage pool, in MB/s. + public RangeLimits ProvisionedBandwidthMbPerSec { get; } + /// Allowed provisioned IOPS range for a storage pool, as a number of operations. + public RangeLimits ProvisionedIops { get; } + /// List of physical availability zones in the region in which storage pools can be deployed; some Azure regions do not support the necessary resources in all availability zones. + public IReadOnlyList PhysicalAvailabilityZones { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolListResult.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolListResult.Serialization.cs new file mode 100644 index 000000000000..707a60a42ba1 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolListResult.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.PureStorageBlock.Models +{ + internal partial class StoragePoolListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolListResult)} 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 + } + } + } + + StoragePoolListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStoragePoolListResult(document.RootElement, options); + } + + internal static StoragePoolListResult DeserializeStoragePoolListResult(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(StoragePoolData.DeserializeStoragePoolData(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 StoragePoolListResult(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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(StoragePoolListResult)} does not support writing '{options.Format}' format."); + } + } + + StoragePoolListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStoragePoolListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StoragePoolListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolListResult.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolListResult.cs new file mode 100644 index 000000000000..b6dd1aaff7a8 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolListResult.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.PureStorageBlock.Models +{ + /// The response of a StoragePool list operation. + internal partial class StoragePoolListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 StoragePool items on this page. + /// is null. + internal StoragePoolListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The StoragePool items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal StoragePoolListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StoragePoolListResult() + { + } + + /// The StoragePool items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolPatch.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolPatch.Serialization.cs new file mode 100644 index 000000000000..79997af67e62 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolPatch.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class StoragePoolPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + 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 + } + } + } + + StoragePoolPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStoragePoolPatch(document.RootElement, options); + } + + internal static StoragePoolPatch DeserializeStoragePoolPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentity identity = default; + IDictionary tags = default; + StoragePoolUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = StoragePoolUpdateProperties.DeserializeStoragePoolUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StoragePoolPatch(identity, 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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(StoragePoolPatch)} does not support writing '{options.Format}' format."); + } + } + + StoragePoolPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStoragePoolPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StoragePoolPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolPatch.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolPatch.cs new file mode 100644 index 000000000000..580670ac2b0d --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolPatch.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// The type used for update operations of the StoragePool. + public partial class StoragePoolPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 StoragePoolPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The managed service identities assigned to this resource. + /// Resource tags. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal StoragePoolPatch(ManagedServiceIdentity identity, IDictionary tags, StoragePoolUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Identity = identity; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + internal StoragePoolUpdateProperties Properties { get; set; } + /// Total bandwidth provisioned for the pool, in MB/s. + public long? StoragePoolUpdateProvisionedBandwidthMbPerSec + { + get => Properties is null ? default : Properties.ProvisionedBandwidthMbPerSec; + set + { + if (Properties is null) + Properties = new StoragePoolUpdateProperties(); + Properties.ProvisionedBandwidthMbPerSec = value; + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolProperties.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolProperties.Serialization.cs new file mode 100644 index 000000000000..c256718716a1 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolProperties.Serialization.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class StoragePoolProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(StoragePoolInternalId)) + { + writer.WritePropertyName("storagePoolInternalId"u8); + writer.WriteStringValue(StoragePoolInternalId); + } + writer.WritePropertyName("availabilityZone"u8); + writer.WriteStringValue(AvailabilityZone); + writer.WritePropertyName("vnetInjection"u8); + writer.WriteObjectValue(VnetInjection, options); + if (options.Format != "W" && Optional.IsDefined(DataRetentionPeriod)) + { + writer.WritePropertyName("dataRetentionPeriod"u8); + writer.WriteNumberValue(DataRetentionPeriod.Value); + } + writer.WritePropertyName("provisionedBandwidthMbPerSec"u8); + writer.WriteNumberValue(ProvisionedBandwidthMbPerSec); + if (options.Format != "W" && Optional.IsDefined(ProvisionedIops)) + { + writer.WritePropertyName("provisionedIops"u8); + writer.WriteNumberValue(ProvisionedIops.Value); + } + if (options.Format != "W" && Optional.IsDefined(Avs)) + { + writer.WritePropertyName("avs"u8); + writer.WriteObjectValue(Avs, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("reservationResourceId"u8); + writer.WriteStringValue(ReservationResourceId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StoragePoolProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStoragePoolProperties(document.RootElement, options); + } + + internal static StoragePoolProperties DeserializeStoragePoolProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string storagePoolInternalId = default; + string availabilityZone = default; + VnetInjection vnetInjection = default; + long? dataRetentionPeriod = default; + long provisionedBandwidthMbPerSec = default; + long? provisionedIops = default; + AzureVmwareService avs = default; + ProvisioningState? provisioningState = default; + string reservationResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storagePoolInternalId"u8)) + { + storagePoolInternalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("availabilityZone"u8)) + { + availabilityZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("vnetInjection"u8)) + { + vnetInjection = VnetInjection.DeserializeVnetInjection(property.Value, options); + continue; + } + if (property.NameEquals("dataRetentionPeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataRetentionPeriod = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("provisionedBandwidthMbPerSec"u8)) + { + provisionedBandwidthMbPerSec = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("provisionedIops"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisionedIops = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("avs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + avs = AzureVmwareService.DeserializeAzureVmwareService(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("reservationResourceId"u8)) + { + reservationResourceId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StoragePoolProperties( + storagePoolInternalId, + availabilityZone, + vnetInjection, + dataRetentionPeriod, + provisionedBandwidthMbPerSec, + provisionedIops, + avs, + provisioningState, + reservationResourceId, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(StoragePoolProperties)} does not support writing '{options.Format}' format."); + } + } + + StoragePoolProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStoragePoolProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StoragePoolProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolProperties.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolProperties.cs new file mode 100644 index 000000000000..6a2101438e20 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolProperties.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Properties of a storage pool. + public partial class StoragePoolProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Azure Availability Zone the Pool is located in. + /// Network properties of the storage pool. + /// Total bandwidth provisioned for the pool, in MB/s. + /// Azure resource ID of the Pure Storage Cloud service (reservation resource) this storage pool belongs to. + /// , or is null. + public StoragePoolProperties(string availabilityZone, VnetInjection vnetInjection, long provisionedBandwidthMbPerSec, string reservationResourceId) + { + Argument.AssertNotNull(availabilityZone, nameof(availabilityZone)); + Argument.AssertNotNull(vnetInjection, nameof(vnetInjection)); + Argument.AssertNotNull(reservationResourceId, nameof(reservationResourceId)); + + AvailabilityZone = availabilityZone; + VnetInjection = vnetInjection; + ProvisionedBandwidthMbPerSec = provisionedBandwidthMbPerSec; + ReservationResourceId = reservationResourceId; + } + + /// Initializes a new instance of . + /// Pure Storage's internal ID of the storage pool. + /// Azure Availability Zone the Pool is located in. + /// Network properties of the storage pool. + /// How long a destroyed object is kept before being eradicated, in seconds. + /// Total bandwidth provisioned for the pool, in MB/s. + /// Total I/O operations per second (IOPS) provisioned for the pool. + /// AVS connection state summary. + /// Provisioning state of the resource. + /// Azure resource ID of the Pure Storage Cloud service (reservation resource) this storage pool belongs to. + /// Keeps track of any properties unknown to the library. + internal StoragePoolProperties(string storagePoolInternalId, string availabilityZone, VnetInjection vnetInjection, long? dataRetentionPeriod, long provisionedBandwidthMbPerSec, long? provisionedIops, AzureVmwareService avs, ProvisioningState? provisioningState, string reservationResourceId, IDictionary serializedAdditionalRawData) + { + StoragePoolInternalId = storagePoolInternalId; + AvailabilityZone = availabilityZone; + VnetInjection = vnetInjection; + DataRetentionPeriod = dataRetentionPeriod; + ProvisionedBandwidthMbPerSec = provisionedBandwidthMbPerSec; + ProvisionedIops = provisionedIops; + Avs = avs; + ProvisioningState = provisioningState; + ReservationResourceId = reservationResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StoragePoolProperties() + { + } + + /// Pure Storage's internal ID of the storage pool. + public string StoragePoolInternalId { get; } + /// Azure Availability Zone the Pool is located in. + public string AvailabilityZone { get; set; } + /// Network properties of the storage pool. + public VnetInjection VnetInjection { get; set; } + /// How long a destroyed object is kept before being eradicated, in seconds. + public long? DataRetentionPeriod { get; } + /// Total bandwidth provisioned for the pool, in MB/s. + public long ProvisionedBandwidthMbPerSec { get; set; } + /// Total I/O operations per second (IOPS) provisioned for the pool. + public long? ProvisionedIops { get; } + /// AVS connection state summary. + public AzureVmwareService Avs { get; } + /// Provisioning state of the resource. + public ProvisioningState? ProvisioningState { get; } + /// Azure resource ID of the Pure Storage Cloud service (reservation resource) this storage pool belongs to. + public string ReservationResourceId { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolUpdateProperties.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..660d42c27e3b --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolUpdateProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + internal partial class StoragePoolUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ProvisionedBandwidthMbPerSec)) + { + writer.WritePropertyName("provisionedBandwidthMbPerSec"u8); + writer.WriteNumberValue(ProvisionedBandwidthMbPerSec.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 + } + } + } + + StoragePoolUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStoragePoolUpdateProperties(document.RootElement, options); + } + + internal static StoragePoolUpdateProperties DeserializeStoragePoolUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? provisionedBandwidthMbPerSec = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisionedBandwidthMbPerSec"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisionedBandwidthMbPerSec = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StoragePoolUpdateProperties(provisionedBandwidthMbPerSec, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(StoragePoolUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + StoragePoolUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStoragePoolUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StoragePoolUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolUpdateProperties.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolUpdateProperties.cs new file mode 100644 index 000000000000..fddde39eb0c4 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/StoragePoolUpdateProperties.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.PureStorageBlock.Models +{ + /// The updatable properties of the StoragePool. + internal partial class StoragePoolUpdateProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 StoragePoolUpdateProperties() + { + } + + /// Initializes a new instance of . + /// Total bandwidth provisioned for the pool, in MB/s. + /// Keeps track of any properties unknown to the library. + internal StoragePoolUpdateProperties(long? provisionedBandwidthMbPerSec, IDictionary serializedAdditionalRawData) + { + ProvisionedBandwidthMbPerSec = provisionedBandwidthMbPerSec; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Total bandwidth provisioned for the pool, in MB/s. + public long? ProvisionedBandwidthMbPerSec { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/UsageSeverity.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/UsageSeverity.cs new file mode 100644 index 000000000000..ca1314061d1d --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/UsageSeverity.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Severity levels for billing usage properties. + public readonly partial struct UsageSeverity : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UsageSeverity(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ALERTValue = "alert"; + private const string INFORMATIONValue = "information"; + private const string WARNINGValue = "warning"; + private const string NONEValue = "none"; + + /// Indicates an alert condition. + public static UsageSeverity ALERT { get; } = new UsageSeverity(ALERTValue); + /// Provides informational details. + public static UsageSeverity INFORMATION { get; } = new UsageSeverity(INFORMATIONValue); + /// Indicates a warning condition. + public static UsageSeverity WARNING { get; } = new UsageSeverity(WARNINGValue); + /// Indicates no severity. + public static UsageSeverity NONE { get; } = new UsageSeverity(NONEValue); + /// Determines if two values are the same. + public static bool operator ==(UsageSeverity left, UsageSeverity right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UsageSeverity left, UsageSeverity right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator UsageSeverity(string value) => new UsageSeverity(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UsageSeverity other && Equals(other); + /// + public bool Equals(UsageSeverity 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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/UserDetails.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/UserDetails.Serialization.cs new file mode 100644 index 000000000000..dcf6b88258bb --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/UserDetails.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class UserDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UserDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("firstName"u8); + writer.WriteStringValue(FirstName); + writer.WritePropertyName("lastName"u8); + writer.WriteStringValue(LastName); + writer.WritePropertyName("emailAddress"u8); + writer.WriteStringValue(EmailAddress); + if (Optional.IsDefined(Upn)) + { + writer.WritePropertyName("upn"u8); + writer.WriteStringValue(Upn); + } + if (Optional.IsDefined(PhoneNumber)) + { + writer.WritePropertyName("phoneNumber"u8); + writer.WriteStringValue(PhoneNumber); + } + if (Optional.IsDefined(CompanyDetails)) + { + writer.WritePropertyName("companyDetails"u8); + writer.WriteObjectValue(CompanyDetails, 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 + } + } + } + + UserDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UserDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUserDetails(document.RootElement, options); + } + + internal static UserDetails DeserializeUserDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string firstName = default; + string lastName = default; + string emailAddress = default; + string upn = default; + string phoneNumber = default; + CompanyDetails companyDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("firstName"u8)) + { + firstName = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastName"u8)) + { + lastName = property.Value.GetString(); + continue; + } + if (property.NameEquals("emailAddress"u8)) + { + emailAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("upn"u8)) + { + upn = property.Value.GetString(); + continue; + } + if (property.NameEquals("phoneNumber"u8)) + { + phoneNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("companyDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + companyDetails = CompanyDetails.DeserializeCompanyDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UserDetails( + firstName, + lastName, + emailAddress, + upn, + phoneNumber, + companyDetails, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(UserDetails)} does not support writing '{options.Format}' format."); + } + } + + UserDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUserDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UserDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/UserDetails.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/UserDetails.cs new file mode 100644 index 000000000000..59eaa7a2f99b --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/UserDetails.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// User details. + public partial class UserDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// First name. + /// Last name. + /// Email address. + /// , or is null. + public UserDetails(string firstName, string lastName, string emailAddress) + { + Argument.AssertNotNull(firstName, nameof(firstName)); + Argument.AssertNotNull(lastName, nameof(lastName)); + Argument.AssertNotNull(emailAddress, nameof(emailAddress)); + + FirstName = firstName; + LastName = lastName; + EmailAddress = emailAddress; + } + + /// Initializes a new instance of . + /// First name. + /// Last name. + /// Email address. + /// Principal name. + /// Phone number. + /// Company details. + /// Keeps track of any properties unknown to the library. + internal UserDetails(string firstName, string lastName, string emailAddress, string upn, string phoneNumber, CompanyDetails companyDetails, IDictionary serializedAdditionalRawData) + { + FirstName = firstName; + LastName = lastName; + EmailAddress = emailAddress; + Upn = upn; + PhoneNumber = phoneNumber; + CompanyDetails = companyDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UserDetails() + { + } + + /// First name. + public string FirstName { get; set; } + /// Last name. + public string LastName { get; set; } + /// Email address. + public string EmailAddress { get; set; } + /// Principal name. + public string Upn { get; set; } + /// Phone number. + public string PhoneNumber { get; set; } + /// Company details. + public CompanyDetails CompanyDetails { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VmType.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VmType.cs new file mode 100644 index 000000000000..63c5f023e1f9 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VmType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// AVS VM storage types. + public readonly partial struct VmType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VmType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string VVolValue = "vvol"; + + /// VM using vVols as underlying storage. + public static VmType VVol { get; } = new VmType(VVolValue); + /// Determines if two values are the same. + public static bool operator ==(VmType left, VmType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VmType left, VmType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VmType(string value) => new VmType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VmType other && Equals(other); + /// + public bool Equals(VmType 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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VnetInjection.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VnetInjection.Serialization.cs new file mode 100644 index 000000000000..4b8abb715da1 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VnetInjection.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class VnetInjection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VnetInjection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + writer.WritePropertyName("vnetId"u8); + writer.WriteStringValue(VnetId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VnetInjection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VnetInjection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVnetInjection(document.RootElement, options); + } + + internal static VnetInjection DeserializeVnetInjection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string subnetId = default; + string vnetId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subnetId"u8)) + { + subnetId = property.Value.GetString(); + continue; + } + if (property.NameEquals("vnetId"u8)) + { + vnetId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VnetInjection(subnetId, vnetId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(VnetInjection)} does not support writing '{options.Format}' format."); + } + } + + VnetInjection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVnetInjection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VnetInjection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VnetInjection.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VnetInjection.cs new file mode 100644 index 000000000000..0607c688606a --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VnetInjection.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.PureStorageBlock.Models +{ + /// Network in which the storage pool will be made available. + public partial class VnetInjection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Azure resource ID of the Virtual Network subnet where the storage pool will be connected. + /// Azure resource ID of the Virtual Network in which the subnet is located. + /// or is null. + public VnetInjection(string subnetId, string vnetId) + { + Argument.AssertNotNull(subnetId, nameof(subnetId)); + Argument.AssertNotNull(vnetId, nameof(vnetId)); + + SubnetId = subnetId; + VnetId = vnetId; + } + + /// Initializes a new instance of . + /// Azure resource ID of the Virtual Network subnet where the storage pool will be connected. + /// Azure resource ID of the Virtual Network in which the subnet is located. + /// Keeps track of any properties unknown to the library. + internal VnetInjection(string subnetId, string vnetId, IDictionary serializedAdditionalRawData) + { + SubnetId = subnetId; + VnetId = vnetId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VnetInjection() + { + } + + /// Azure resource ID of the Virtual Network subnet where the storage pool will be connected. + public string SubnetId { get; set; } + /// Azure resource ID of the Virtual Network in which the subnet is located. + public string VnetId { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeContainerType.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeContainerType.cs new file mode 100644 index 000000000000..e914377993a9 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeContainerType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Specify which control plane handles the lifecycle of the volume container. + public readonly partial struct VolumeContainerType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VolumeContainerType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AVSValue = "avs"; + + /// AVS/VMware. + public static VolumeContainerType AVS { get; } = new VolumeContainerType(AVSValue); + /// Determines if two values are the same. + public static bool operator ==(VolumeContainerType left, VolumeContainerType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VolumeContainerType left, VolumeContainerType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VolumeContainerType(string value) => new VolumeContainerType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VolumeContainerType other && Equals(other); + /// + public bool Equals(VolumeContainerType 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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeLimits.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeLimits.Serialization.cs new file mode 100644 index 000000000000..23e6e6afd434 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeLimits.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + internal partial class VolumeLimits : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeLimits)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("provisionedSize"u8); + writer.WriteObjectValue(ProvisionedSize, 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 + } + } + } + + VolumeLimits IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeLimits)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVolumeLimits(document.RootElement, options); + } + + internal static VolumeLimits DeserializeVolumeLimits(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RangeLimits provisionedSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisionedSize"u8)) + { + provisionedSize = RangeLimits.DeserializeRangeLimits(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VolumeLimits(provisionedSize, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(VolumeLimits)} does not support writing '{options.Format}' format."); + } + } + + VolumeLimits IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVolumeLimits(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VolumeLimits)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeLimits.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeLimits.cs new file mode 100644 index 000000000000..6da0949df837 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeLimits.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Limits used for volumes. + internal partial class VolumeLimits + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Provisioned size limits for a volume, in bytes. + /// is null. + internal VolumeLimits(RangeLimits provisionedSize) + { + Argument.AssertNotNull(provisionedSize, nameof(provisionedSize)); + + ProvisionedSize = provisionedSize; + } + + /// Initializes a new instance of . + /// Provisioned size limits for a volume, in bytes. + /// Keeps track of any properties unknown to the library. + internal VolumeLimits(RangeLimits provisionedSize, IDictionary serializedAdditionalRawData) + { + ProvisionedSize = provisionedSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VolumeLimits() + { + } + + /// Provisioned size limits for a volume, in bytes. + public RangeLimits ProvisionedSize { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeProperties.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeProperties.Serialization.cs new file mode 100644 index 000000000000..f9c1b6490525 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeProperties.Serialization.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + public partial class VolumeProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(StoragePoolInternalId)) + { + writer.WritePropertyName("storagePoolInternalId"u8); + writer.WriteStringValue(StoragePoolInternalId); + } + if (options.Format != "W" && Optional.IsDefined(StoragePoolResourceId)) + { + writer.WritePropertyName("storagePoolResourceId"u8); + writer.WriteStringValue(StoragePoolResourceId); + } + if (options.Format != "W" && Optional.IsDefined(VolumeInternalId)) + { + writer.WritePropertyName("volumeInternalId"u8); + writer.WriteStringValue(VolumeInternalId); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(Space)) + { + writer.WritePropertyName("space"u8); + writer.WriteObjectValue(Space, options); + } + writer.WritePropertyName("softDeletion"u8); + writer.WriteObjectValue(SoftDeletion, options); + if (options.Format != "W" && Optional.IsDefined(CreatedTimestamp)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedTimestamp); + } + if (options.Format != "W" && Optional.IsDefined(ProvisionedSize)) + { + writer.WritePropertyName("provisionedSize"u8); + writer.WriteNumberValue(ProvisionedSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(VolumeType)) + { + writer.WritePropertyName("volumeType"u8); + writer.WriteStringValue(VolumeType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Avs)) + { + writer.WritePropertyName("avs"u8); + writer.WriteObjectValue(Avs, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VolumeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VolumeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVolumeProperties(document.RootElement, options); + } + + internal static VolumeProperties DeserializeVolumeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string storagePoolInternalId = default; + string storagePoolResourceId = default; + string volumeInternalId = default; + string displayName = default; + Space space = default; + SoftDeletion softDeletion = default; + string createdTimestamp = default; + long? provisionedSize = default; + VolumeType? volumeType = default; + AvsDiskDetails avs = default; + ResourceProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storagePoolInternalId"u8)) + { + storagePoolInternalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storagePoolResourceId"u8)) + { + storagePoolResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("volumeInternalId"u8)) + { + volumeInternalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("space"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + space = Space.DeserializeSpace(property.Value, options); + continue; + } + if (property.NameEquals("softDeletion"u8)) + { + softDeletion = SoftDeletion.DeserializeSoftDeletion(property.Value, options); + continue; + } + if (property.NameEquals("createdTimestamp"u8)) + { + createdTimestamp = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisionedSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisionedSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("volumeType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + volumeType = new VolumeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("avs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + avs = AvsDiskDetails.DeserializeAvsDiskDetails(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ResourceProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VolumeProperties( + storagePoolInternalId, + storagePoolResourceId, + volumeInternalId, + displayName, + space, + softDeletion, + createdTimestamp, + provisionedSize, + volumeType, + avs, + 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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(VolumeProperties)} does not support writing '{options.Format}' format."); + } + } + + VolumeProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVolumeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VolumeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeProperties.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeProperties.cs new file mode 100644 index 000000000000..284f6919c8b4 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeProperties.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Volume properties. + public partial class VolumeProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Volume's soft-deletion state. + /// is null. + internal VolumeProperties(SoftDeletion softDeletion) + { + Argument.AssertNotNull(softDeletion, nameof(softDeletion)); + + SoftDeletion = softDeletion; + } + + /// Initializes a new instance of . + /// Pure Storage's internal ID for the storage pool containing the volume. + /// Azure Resource ID of the storage pool containing this volume. + /// Pure Storage's internal ID for the volume. + /// Human-readable name of the volume. + /// Storage space usage. + /// Volume's soft-deletion state. + /// Volume creation date, as an RFC 3339 timestamp. + /// Currently provisioned size of the volume, in bytes. + /// Specify which control plane handles the lifecycle of the volume. + /// AVS-specific volume information. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal VolumeProperties(string storagePoolInternalId, string storagePoolResourceId, string volumeInternalId, string displayName, Space space, SoftDeletion softDeletion, string createdTimestamp, long? provisionedSize, VolumeType? volumeType, AvsDiskDetails avs, ResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + StoragePoolInternalId = storagePoolInternalId; + StoragePoolResourceId = storagePoolResourceId; + VolumeInternalId = volumeInternalId; + DisplayName = displayName; + Space = space; + SoftDeletion = softDeletion; + CreatedTimestamp = createdTimestamp; + ProvisionedSize = provisionedSize; + VolumeType = volumeType; + Avs = avs; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VolumeProperties() + { + } + + /// Pure Storage's internal ID for the storage pool containing the volume. + public string StoragePoolInternalId { get; } + /// Azure Resource ID of the storage pool containing this volume. + public string StoragePoolResourceId { get; } + /// Pure Storage's internal ID for the volume. + public string VolumeInternalId { get; } + /// Human-readable name of the volume. + public string DisplayName { get; } + /// Storage space usage. + public Space Space { get; } + /// Volume's soft-deletion state. + public SoftDeletion SoftDeletion { get; } + /// Volume creation date, as an RFC 3339 timestamp. + public string CreatedTimestamp { get; } + /// Currently provisioned size of the volume, in bytes. + public long? ProvisionedSize { get; } + /// Specify which control plane handles the lifecycle of the volume. + public VolumeType? VolumeType { get; } + /// AVS-specific volume information. + public AvsDiskDetails Avs { get; } + /// Provisioning state of the resource. + public ResourceProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeType.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeType.cs new file mode 100644 index 000000000000..825576d19f78 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/Models/VolumeType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PureStorageBlock.Models +{ + /// Specify which control plane handles the lifecycle of the volume. + public readonly partial struct VolumeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VolumeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AVSValue = "avs"; + + /// AVS/VMware. + public static VolumeType AVS { get; } = new VolumeType(AVSValue); + /// Determines if two values are the same. + public static bool operator ==(VolumeType left, VolumeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VolumeType left, VolumeType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VolumeType(string value) => new VolumeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VolumeType other && Equals(other); + /// + public bool Equals(VolumeType 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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ProviderConstants.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..0cd43b19dca0 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/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.PureStorageBlock +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationCollection.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationCollection.cs new file mode 100644 index 000000000000..6ceb3e45eebb --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// 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 GetReservations method from an instance of . + /// + public partial class ReservationCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _reservationClientDiagnostics; + private readonly ReservationsRestOperations _reservationRestClient; + + /// Initializes a new instance of the class for mocking. + protected ReservationCollection() + { + } + + /// 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 ReservationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _reservationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PureStorageBlock", ReservationResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ReservationResource.ResourceType, out string reservationApiVersion); + _reservationRestClient = new ReservationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, reservationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Create + /// + /// + /// Default Api Version + /// 2024-11-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 reservation. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string reservationName, ReservationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _reservationClientDiagnostics.CreateScope("ReservationCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _reservationRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, reservationName, data, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(new ReservationOperationSource(Client), _reservationClientDiagnostics, Pipeline, _reservationRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, reservationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Create + /// + /// + /// Default Api Version + /// 2024-11-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 reservation. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string reservationName, ReservationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _reservationClientDiagnostics.CreateScope("ReservationCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _reservationRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, reservationName, data, cancellationToken); + var operation = new PureStorageBlockArmOperation(new ReservationOperationSource(Client), _reservationClientDiagnostics, Pipeline, _reservationRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, reservationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the reservation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var scope = _reservationClientDiagnostics.CreateScope("ReservationCollection.Get"); + scope.Start(); + try + { + var response = await _reservationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, reservationName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ReservationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the reservation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var scope = _reservationClientDiagnostics.CreateScope("ReservationCollection.Get"); + scope.Start(); + try + { + var response = _reservationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, reservationName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ReservationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List reservations by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations + /// + /// + /// Operation Id + /// Reservation_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _reservationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _reservationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ReservationResource(Client, ReservationData.DeserializeReservationData(e)), _reservationClientDiagnostics, Pipeline, "ReservationCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List reservations by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations + /// + /// + /// Operation Id + /// Reservation_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _reservationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _reservationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ReservationResource(Client, ReservationData.DeserializeReservationData(e)), _reservationClientDiagnostics, Pipeline, "ReservationCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the reservation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var scope = _reservationClientDiagnostics.CreateScope("ReservationCollection.Exists"); + scope.Start(); + try + { + var response = await _reservationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, reservationName, 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/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the reservation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var scope = _reservationClientDiagnostics.CreateScope("ReservationCollection.Exists"); + scope.Start(); + try + { + var response = _reservationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, reservationName, 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/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the reservation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var scope = _reservationClientDiagnostics.CreateScope("ReservationCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _reservationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, reservationName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ReservationResource(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/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the reservation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var scope = _reservationClientDiagnostics.CreateScope("ReservationCollection.GetIfExists"); + scope.Start(); + try + { + var response = _reservationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, reservationName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ReservationResource(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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationData.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationData.Serialization.cs new file mode 100644 index 000000000000..81233b2db429 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationData.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + public partial class ReservationData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ReservationData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + ReservationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReservationData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReservationData(document.RootElement, options); + } + + internal static ReservationData DeserializeReservationData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ReservationPropertiesBaseResourceProperties properties = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ReservationPropertiesBaseResourceProperties.DeserializeReservationPropertiesBaseResourceProperties(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReservationData( + 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, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(ReservationData)} does not support writing '{options.Format}' format."); + } + } + + ReservationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReservationData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReservationData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationData.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationData.cs new file mode 100644 index 000000000000..30484eb2605b --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationData.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A class representing the Reservation data model. + /// Pure Storage cloud service resource type, also called reservation + /// + public partial class ReservationData : 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 ReservationData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal ReservationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ReservationPropertiesBaseResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReservationData() + { + } + + /// The resource-specific properties for this resource. + public ReservationPropertiesBaseResourceProperties Properties { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationResource.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationResource.Serialization.cs new file mode 100644 index 000000000000..2c6c454c5a3d --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationResource.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.PureStorageBlock +{ + public partial class ReservationResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ReservationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerPureStorageBlockContext.Default); + + ReservationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerPureStorageBlockContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationResource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationResource.cs new file mode 100644 index 000000000000..65300201cfe1 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/ReservationResource.cs @@ -0,0 +1,935 @@ +// 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.PureStorageBlock.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A Class representing a Reservation 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 GetReservationResource method. + /// Otherwise you can get one from its parent resource using the GetReservation method. + /// + public partial class ReservationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The reservationName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string reservationName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _reservationClientDiagnostics; + private readonly ReservationsRestOperations _reservationRestClient; + private readonly ReservationData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "PureStorage.Block/reservations"; + + /// Initializes a new instance of the class for mocking. + protected ReservationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ReservationResource(ArmClient client, ReservationData 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 ReservationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _reservationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PureStorageBlock", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string reservationApiVersion); + _reservationRestClient = new ReservationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, reservationApiVersion); +#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 ReservationData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _reservationClientDiagnostics.CreateScope("ReservationResource.Get"); + scope.Start(); + try + { + var response = await _reservationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ReservationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _reservationClientDiagnostics.CreateScope("ReservationResource.Get"); + scope.Start(); + try + { + var response = _reservationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ReservationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Delete + /// + /// + /// Default Api Version + /// 2024-11-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 = _reservationClientDiagnostics.CreateScope("ReservationResource.Delete"); + scope.Start(); + try + { + var response = await _reservationRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(_reservationClientDiagnostics, Pipeline, _reservationRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Delete + /// + /// + /// Default Api Version + /// 2024-11-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 = _reservationClientDiagnostics.CreateScope("ReservationResource.Delete"); + scope.Start(); + try + { + var response = _reservationRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new PureStorageBlockArmOperation(_reservationClientDiagnostics, Pipeline, _reservationRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Update + /// + /// + /// Default Api Version + /// 2024-11-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, ReservationPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _reservationClientDiagnostics.CreateScope("ReservationResource.Update"); + scope.Start(); + try + { + var response = await _reservationRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(new ReservationOperationSource(Client), _reservationClientDiagnostics, Pipeline, _reservationRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Update + /// + /// + /// Default Api Version + /// 2024-11-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, ReservationPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _reservationClientDiagnostics.CreateScope("ReservationResource.Update"); + scope.Start(); + try + { + var response = _reservationRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new PureStorageBlockArmOperation(new ReservationOperationSource(Client), _reservationClientDiagnostics, Pipeline, _reservationRestClient.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; + } + } + + /// + /// Limits constraining certain resource properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName}/getResourceLimits + /// + /// + /// Operation Id + /// Reservations_GetResourceLimits + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetResourceLimitsAsync(CancellationToken cancellationToken = default) + { + using var scope = _reservationClientDiagnostics.CreateScope("ReservationResource.GetResourceLimits"); + scope.Start(); + try + { + var response = await _reservationRestClient.GetResourceLimitsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Limits constraining certain resource properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName}/getResourceLimits + /// + /// + /// Operation Id + /// Reservations_GetResourceLimits + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetResourceLimits(CancellationToken cancellationToken = default) + { + using var scope = _reservationClientDiagnostics.CreateScope("ReservationResource.GetResourceLimits"); + scope.Start(); + try + { + var response = _reservationRestClient.GetResourceLimits(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Provides various statistics about resources billed via given reservation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName}/getBillingStatus + /// + /// + /// Operation Id + /// Reservations_GetBillingStatus + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetBillingStatusAsync(CancellationToken cancellationToken = default) + { + using var scope = _reservationClientDiagnostics.CreateScope("ReservationResource.GetBillingStatus"); + scope.Start(); + try + { + var response = await _reservationRestClient.GetBillingStatusAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Provides various statistics about resources billed via given reservation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName}/getBillingStatus + /// + /// + /// Operation Id + /// Reservations_GetBillingStatus + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetBillingStatus(CancellationToken cancellationToken = default) + { + using var scope = _reservationClientDiagnostics.CreateScope("ReservationResource.GetBillingStatus"); + scope.Start(); + try + { + var response = _reservationRestClient.GetBillingStatus(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Provides a summarized report along with actions for resources billed via given reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName}/getBillingReport + /// + /// + /// Operation Id + /// Reservations_GetBillingReport + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetBillingReportAsync(CancellationToken cancellationToken = default) + { + using var scope = _reservationClientDiagnostics.CreateScope("ReservationResource.GetBillingReport"); + scope.Start(); + try + { + var response = await _reservationRestClient.GetBillingReportAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Provides a summarized report along with actions for resources billed via given reservation + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName}/getBillingReport + /// + /// + /// Operation Id + /// Reservations_GetBillingReport + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetBillingReport(CancellationToken cancellationToken = default) + { + using var scope = _reservationClientDiagnostics.CreateScope("ReservationResource.GetBillingReport"); + scope.Start(); + try + { + var response = _reservationRestClient.GetBillingReport(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-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 = _reservationClientDiagnostics.CreateScope("ReservationResource.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 _reservationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ReservationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ReservationPatch(); + 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/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-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 = _reservationClientDiagnostics.CreateScope("ReservationResource.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 = _reservationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ReservationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ReservationPatch(); + 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/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-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 = _reservationClientDiagnostics.CreateScope("ReservationResource.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 _reservationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ReservationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ReservationPatch(); + 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/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-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 = _reservationClientDiagnostics.CreateScope("ReservationResource.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 = _reservationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ReservationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ReservationPatch(); + 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/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-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 = _reservationClientDiagnostics.CreateScope("ReservationResource.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 _reservationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ReservationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ReservationPatch(); + 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/PureStorage.Block/reservations/{reservationName} + /// + /// + /// Operation Id + /// Reservation_Get + /// + /// + /// Default Api Version + /// 2024-11-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 = _reservationClientDiagnostics.CreateScope("ReservationResource.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 = _reservationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ReservationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ReservationPatch(); + 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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsStorageContainerVolumesRestOperations.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsStorageContainerVolumesRestOperations.cs new file mode 100644 index 000000000000..40bd39f2da52 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsStorageContainerVolumesRestOperations.cs @@ -0,0 +1,549 @@ +// 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.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + internal partial class AvsStorageContainerVolumesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AvsStorageContainerVolumesRestOperations. + /// 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 AvsStorageContainerVolumesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName, string volumeId, AvsStorageContainerVolumePatch 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsStorageContainers/", false); + uri.AppendPath(storageContainerName, true); + uri.AppendPath("/volumes/", false); + uri.AppendPath(volumeId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName, string volumeId, AvsStorageContainerVolumePatch 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsStorageContainers/", false); + uri.AppendPath(storageContainerName, true); + uri.AppendPath("/volumes/", false); + uri.AppendPath(volumeId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a volume in an AVS storage container. + /// 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 storage pool. + /// Name of the storage container. + /// ID of the volume in the storage container. + /// 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 storagePoolName, string storageContainerName, string volumeId, AvsStorageContainerVolumePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, storagePoolName, storageContainerName, volumeId, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a volume in an AVS storage container. + /// 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 storage pool. + /// Name of the storage container. + /// ID of the volume in the storage container. + /// 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 storagePoolName, string storageContainerName, string volumeId, AvsStorageContainerVolumePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, storagePoolName, storageContainerName, volumeId, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName, string volumeId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsStorageContainers/", false); + uri.AppendPath(storageContainerName, true); + uri.AppendPath("/volumes/", false); + uri.AppendPath(volumeId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName, string volumeId) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsStorageContainers/", false); + uri.AppendPath(storageContainerName, true); + uri.AppendPath("/volumes/", false); + uri.AppendPath(volumeId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a volume in an AVS storage container. + /// 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 storage pool. + /// Name of the storage container. + /// ID of the volume in the storage container. + /// 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 storagePoolName, string storageContainerName, string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, storagePoolName, storageContainerName, volumeId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsStorageContainerVolumeData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvsStorageContainerVolumeData.DeserializeAvsStorageContainerVolumeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AvsStorageContainerVolumeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a volume in an AVS storage container. + /// 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 storage pool. + /// Name of the storage container. + /// ID of the volume in the storage container. + /// 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 storagePoolName, string storageContainerName, string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, storagePoolName, storageContainerName, volumeId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsStorageContainerVolumeData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvsStorageContainerVolumeData.DeserializeAvsStorageContainerVolumeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AvsStorageContainerVolumeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName, string volumeId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsStorageContainers/", false); + uri.AppendPath(storageContainerName, true); + uri.AppendPath("/volumes/", false); + uri.AppendPath(volumeId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName, string volumeId) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsStorageContainers/", false); + uri.AppendPath(storageContainerName, true); + uri.AppendPath("/volumes/", false); + uri.AppendPath(volumeId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a volume in an AVS storage container. + /// 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 storage pool. + /// Name of the storage container. + /// ID of the volume in the storage container. + /// 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 storagePoolName, string storageContainerName, string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, storagePoolName, storageContainerName, volumeId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a volume in an AVS storage container. + /// 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 storage pool. + /// Name of the storage container. + /// ID of the volume in the storage container. + /// 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 storagePoolName, string storageContainerName, string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, storagePoolName, storageContainerName, volumeId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAvsStorageContainerRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsStorageContainers/", false); + uri.AppendPath(storageContainerName, true); + uri.AppendPath("/volumes", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAvsStorageContainerRequest(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsStorageContainers/", false); + uri.AppendPath(storageContainerName, true); + uri.AppendPath("/volumes", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List volumes in an AVS storage container. + /// 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 storage pool. + /// Name of the storage container. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByAvsStorageContainerAsync(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + + using var message = CreateListByAvsStorageContainerRequest(subscriptionId, resourceGroupName, storagePoolName, storageContainerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsStorageContainerVolumeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvsStorageContainerVolumeListResult.DeserializeAvsStorageContainerVolumeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List volumes in an AVS storage container. + /// 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 storage pool. + /// Name of the storage container. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByAvsStorageContainer(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + + using var message = CreateListByAvsStorageContainerRequest(subscriptionId, resourceGroupName, storagePoolName, storageContainerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsStorageContainerVolumeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvsStorageContainerVolumeListResult.DeserializeAvsStorageContainerVolumeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAvsStorageContainerNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAvsStorageContainerNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName) + { + 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 volumes in an AVS storage container. + /// 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 storage pool. + /// Name of the storage container. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByAvsStorageContainerNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + + using var message = CreateListByAvsStorageContainerNextPageRequest(nextLink, subscriptionId, resourceGroupName, storagePoolName, storageContainerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsStorageContainerVolumeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvsStorageContainerVolumeListResult.DeserializeAvsStorageContainerVolumeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List volumes in an AVS storage container. + /// 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 storage pool. + /// Name of the storage container. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByAvsStorageContainerNextPage(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + + using var message = CreateListByAvsStorageContainerNextPageRequest(nextLink, subscriptionId, resourceGroupName, storagePoolName, storageContainerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsStorageContainerVolumeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvsStorageContainerVolumeListResult.DeserializeAvsStorageContainerVolumeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsStorageContainersRestOperations.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsStorageContainersRestOperations.cs new file mode 100644 index 000000000000..8f921ced8c0b --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsStorageContainersRestOperations.cs @@ -0,0 +1,413 @@ +// 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.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + internal partial class AvsStorageContainersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AvsStorageContainersRestOperations. + /// 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 AvsStorageContainersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsStorageContainers/", false); + uri.AppendPath(storageContainerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsStorageContainers/", false); + uri.AppendPath(storageContainerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get an AVS storage container. + /// 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 storage pool. + /// Name of the storage container. + /// 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 storagePoolName, string storageContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, storagePoolName, storageContainerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsStorageContainerData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvsStorageContainerData.DeserializeAvsStorageContainerData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AvsStorageContainerData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get an AVS storage container. + /// 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 storage pool. + /// Name of the storage container. + /// 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 storagePoolName, string storageContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, storagePoolName, storageContainerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsStorageContainerData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvsStorageContainerData.DeserializeAvsStorageContainerData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AvsStorageContainerData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsStorageContainers/", false); + uri.AppendPath(storageContainerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string storagePoolName, string storageContainerName) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsStorageContainers/", false); + uri.AppendPath(storageContainerName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete an AVS storage container. + /// 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 storage pool. + /// Name of the storage container. + /// 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 storagePoolName, string storageContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, storagePoolName, storageContainerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete an AVS storage container. + /// 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 storage pool. + /// Name of the storage container. + /// 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 storagePoolName, string storageContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(storageContainerName, nameof(storageContainerName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, storagePoolName, storageContainerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByStoragePoolRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsStorageContainers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByStoragePoolRequest(string subscriptionId, string resourceGroupName, string storagePoolName) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsStorageContainers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AVS storage containers by storage pool. + /// 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 storage pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByStoragePoolAsync(string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateListByStoragePoolRequest(subscriptionId, resourceGroupName, storagePoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsStorageContainerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvsStorageContainerListResult.DeserializeAvsStorageContainerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AVS storage containers by storage pool. + /// 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 storage pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByStoragePool(string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateListByStoragePoolRequest(subscriptionId, resourceGroupName, storagePoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsStorageContainerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvsStorageContainerListResult.DeserializeAvsStorageContainerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByStoragePoolNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByStoragePoolNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName) + { + 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 AVS storage containers by storage pool. + /// 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 storage pool. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByStoragePoolNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateListByStoragePoolNextPageRequest(nextLink, subscriptionId, resourceGroupName, storagePoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsStorageContainerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvsStorageContainerListResult.DeserializeAvsStorageContainerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AVS storage containers by storage pool. + /// 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 storage pool. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByStoragePoolNextPage(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateListByStoragePoolNextPageRequest(nextLink, subscriptionId, resourceGroupName, storagePoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsStorageContainerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvsStorageContainerListResult.DeserializeAvsStorageContainerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsVmVolumesRestOperations.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsVmVolumesRestOperations.cs new file mode 100644 index 000000000000..49c8241b9150 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsVmVolumesRestOperations.cs @@ -0,0 +1,549 @@ +// 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.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + internal partial class AvsVmVolumesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AvsVmVolumesRestOperations. + /// 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 AvsVmVolumesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, string volumeId, AvsVmVolumePatch 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms/", false); + uri.AppendPath(avsVmId, true); + uri.AppendPath("/avsVmVolumes/", false); + uri.AppendPath(volumeId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, string volumeId, AvsVmVolumePatch 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms/", false); + uri.AppendPath(avsVmId, true); + uri.AppendPath("/avsVmVolumes/", false); + uri.AppendPath(volumeId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a volume in an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// ID of the volume in the AVS VM. + /// 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 storagePoolName, string avsVmId, string volumeId, AvsVmVolumePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, storagePoolName, avsVmId, volumeId, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a volume in an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// ID of the volume in the AVS VM. + /// 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 storagePoolName, string avsVmId, string volumeId, AvsVmVolumePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, storagePoolName, avsVmId, volumeId, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, string volumeId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms/", false); + uri.AppendPath(avsVmId, true); + uri.AppendPath("/avsVmVolumes/", false); + uri.AppendPath(volumeId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, string volumeId) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms/", false); + uri.AppendPath(avsVmId, true); + uri.AppendPath("/avsVmVolumes/", false); + uri.AppendPath(volumeId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a volume in an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// ID of the volume in the AVS VM. + /// 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 storagePoolName, string avsVmId, string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, storagePoolName, avsVmId, volumeId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsVmVolumeData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvsVmVolumeData.DeserializeAvsVmVolumeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AvsVmVolumeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a volume in an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// ID of the volume in the AVS VM. + /// 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 storagePoolName, string avsVmId, string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, storagePoolName, avsVmId, volumeId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsVmVolumeData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvsVmVolumeData.DeserializeAvsVmVolumeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AvsVmVolumeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, string volumeId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms/", false); + uri.AppendPath(avsVmId, true); + uri.AppendPath("/avsVmVolumes/", false); + uri.AppendPath(volumeId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, string volumeId) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms/", false); + uri.AppendPath(avsVmId, true); + uri.AppendPath("/avsVmVolumes/", false); + uri.AppendPath(volumeId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a volume in an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// ID of the volume in the AVS VM. + /// 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 storagePoolName, string avsVmId, string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, storagePoolName, avsVmId, volumeId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a volume in an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// ID of the volume in the AVS VM. + /// 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 storagePoolName, string avsVmId, string volumeId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + Argument.AssertNotNullOrEmpty(volumeId, nameof(volumeId)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, storagePoolName, avsVmId, volumeId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAvsVmRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms/", false); + uri.AppendPath(avsVmId, true); + uri.AppendPath("/avsVmVolumes", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAvsVmRequest(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms/", false); + uri.AppendPath(avsVmId, true); + uri.AppendPath("/avsVmVolumes", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List volumes in an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByAvsVmAsync(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + + using var message = CreateListByAvsVmRequest(subscriptionId, resourceGroupName, storagePoolName, avsVmId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsVmVolumeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvsVmVolumeListResult.DeserializeAvsVmVolumeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List volumes in an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByAvsVm(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + + using var message = CreateListByAvsVmRequest(subscriptionId, resourceGroupName, storagePoolName, avsVmId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsVmVolumeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvsVmVolumeListResult.DeserializeAvsVmVolumeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAvsVmNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAvsVmNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId) + { + 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 volumes in an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByAvsVmNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + + using var message = CreateListByAvsVmNextPageRequest(nextLink, subscriptionId, resourceGroupName, storagePoolName, avsVmId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsVmVolumeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvsVmVolumeListResult.DeserializeAvsVmVolumeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List volumes in an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByAvsVmNextPage(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + + using var message = CreateListByAvsVmNextPageRequest(nextLink, subscriptionId, resourceGroupName, storagePoolName, avsVmId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsVmVolumeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvsVmVolumeListResult.DeserializeAvsVmVolumeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsVmsRestOperations.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsVmsRestOperations.cs new file mode 100644 index 000000000000..d00b492618c8 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/AvsVmsRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + internal partial class AvsVmsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AvsVmsRestOperations. + /// 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 AvsVmsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, AvsVmPatch 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms/", false); + uri.AppendPath(avsVmId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId, AvsVmPatch 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms/", false); + uri.AppendPath(avsVmId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// 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 storagePoolName, string avsVmId, AvsVmPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, storagePoolName, avsVmId, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// 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 storagePoolName, string avsVmId, AvsVmPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, storagePoolName, avsVmId, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms/", false); + uri.AppendPath(avsVmId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms/", false); + uri.AppendPath(avsVmId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// 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 storagePoolName, string avsVmId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, storagePoolName, avsVmId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsVmData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvsVmData.DeserializeAvsVmData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AvsVmData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// 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 storagePoolName, string avsVmId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, storagePoolName, avsVmId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsVmData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvsVmData.DeserializeAvsVmData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AvsVmData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms/", false); + uri.AppendPath(avsVmId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string storagePoolName, string avsVmId) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms/", false); + uri.AppendPath(avsVmId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// 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 storagePoolName, string avsVmId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, storagePoolName, avsVmId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete an AVS VM. + /// 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 storage pool. + /// ID of the AVS VM. + /// 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 storagePoolName, string avsVmId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNullOrEmpty(avsVmId, nameof(avsVmId)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, storagePoolName, avsVmId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByStoragePoolRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByStoragePoolRequest(string subscriptionId, string resourceGroupName, string storagePoolName) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/avsVms", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AVS VMs by storage pool. + /// 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 storage pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByStoragePoolAsync(string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateListByStoragePoolRequest(subscriptionId, resourceGroupName, storagePoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsVmListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvsVmListResult.DeserializeAvsVmListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AVS VMs by storage pool. + /// 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 storage pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByStoragePool(string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateListByStoragePoolRequest(subscriptionId, resourceGroupName, storagePoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsVmListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvsVmListResult.DeserializeAvsVmListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByStoragePoolNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByStoragePoolNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName) + { + 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 AVS VMs by storage pool. + /// 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 storage pool. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByStoragePoolNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateListByStoragePoolNextPageRequest(nextLink, subscriptionId, resourceGroupName, storagePoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsVmListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvsVmListResult.DeserializeAvsVmListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AVS VMs by storage pool. + /// 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 storage pool. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByStoragePoolNextPage(string nextLink, string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateListByStoragePoolNextPageRequest(nextLink, subscriptionId, resourceGroupName, storagePoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsVmListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvsVmListResult.DeserializeAvsVmListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/ReservationsRestOperations.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/ReservationsRestOperations.cs new file mode 100644 index 000000000000..b7484cce9e85 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/ReservationsRestOperations.cs @@ -0,0 +1,1005 @@ +// 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.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + internal partial class ReservationsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ReservationsRestOperations. + /// 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 ReservationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string reservationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/reservations/", false); + uri.AppendPath(reservationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string reservationName) + { + 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/PureStorage.Block/reservations/", false); + uri.AppendPath(reservationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a reservation. + /// 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 reservation. + /// 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 reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, reservationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReservationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReservationData.DeserializeReservationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ReservationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a reservation. + /// 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 reservation. + /// 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 reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, reservationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReservationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReservationData.DeserializeReservationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ReservationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string reservationName, ReservationData 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/PureStorage.Block/reservations/", false); + uri.AppendPath(reservationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string reservationName, ReservationData 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/PureStorage.Block/reservations/", false); + uri.AppendPath(reservationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a reservation. + /// 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 reservation. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string reservationName, ReservationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, reservationName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a reservation. + /// 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 reservation. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string reservationName, ReservationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, reservationName, 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 reservationName, ReservationPatch 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/PureStorage.Block/reservations/", false); + uri.AppendPath(reservationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string reservationName, ReservationPatch 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/PureStorage.Block/reservations/", false); + uri.AppendPath(reservationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a reservation. + /// 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 reservation. + /// 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 reservationName, ReservationPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, reservationName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a reservation. + /// 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 reservation. + /// 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 reservationName, ReservationPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, reservationName, 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 reservationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/reservations/", false); + uri.AppendPath(reservationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string reservationName) + { + 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/PureStorage.Block/reservations/", false); + uri.AppendPath(reservationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a reservation. + /// 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 reservation. + /// 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 reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, reservationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a reservation. + /// 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 reservation. + /// 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 reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, reservationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/reservations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/reservations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List reservations by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReservationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReservationListResult.DeserializeReservationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List reservations by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReservationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReservationListResult.DeserializeReservationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/PureStorage.Block/reservations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/PureStorage.Block/reservations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List reservations by Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReservationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReservationListResult.DeserializeReservationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List reservations by Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReservationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReservationListResult.DeserializeReservationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetResourceLimitsRequestUri(string subscriptionId, string resourceGroupName, string reservationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/reservations/", false); + uri.AppendPath(reservationName, true); + uri.AppendPath("/getResourceLimits", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetResourceLimitsRequest(string subscriptionId, string resourceGroupName, string reservationName) + { + 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/PureStorage.Block/reservations/", false); + uri.AppendPath(reservationName, true); + uri.AppendPath("/getResourceLimits", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Limits constraining certain resource properties. + /// 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 reservation. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetResourceLimitsAsync(string subscriptionId, string resourceGroupName, string reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var message = CreateGetResourceLimitsRequest(subscriptionId, resourceGroupName, reservationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + LimitDetails value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = LimitDetails.DeserializeLimitDetails(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Limits constraining certain resource properties. + /// 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 reservation. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetResourceLimits(string subscriptionId, string resourceGroupName, string reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var message = CreateGetResourceLimitsRequest(subscriptionId, resourceGroupName, reservationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + LimitDetails value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = LimitDetails.DeserializeLimitDetails(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetBillingStatusRequestUri(string subscriptionId, string resourceGroupName, string reservationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/reservations/", false); + uri.AppendPath(reservationName, true); + uri.AppendPath("/getBillingStatus", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetBillingStatusRequest(string subscriptionId, string resourceGroupName, string reservationName) + { + 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/PureStorage.Block/reservations/", false); + uri.AppendPath(reservationName, true); + uri.AppendPath("/getBillingStatus", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Provides various statistics about resources billed via given reservation. + /// 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 reservation. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetBillingStatusAsync(string subscriptionId, string resourceGroupName, string reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var message = CreateGetBillingStatusRequest(subscriptionId, resourceGroupName, reservationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReservationBillingStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReservationBillingStatus.DeserializeReservationBillingStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Provides various statistics about resources billed via given reservation. + /// 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 reservation. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetBillingStatus(string subscriptionId, string resourceGroupName, string reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var message = CreateGetBillingStatusRequest(subscriptionId, resourceGroupName, reservationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReservationBillingStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReservationBillingStatus.DeserializeReservationBillingStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetBillingReportRequestUri(string subscriptionId, string resourceGroupName, string reservationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/reservations/", false); + uri.AppendPath(reservationName, true); + uri.AppendPath("/getBillingReport", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetBillingReportRequest(string subscriptionId, string resourceGroupName, string reservationName) + { + 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/PureStorage.Block/reservations/", false); + uri.AppendPath(reservationName, true); + uri.AppendPath("/getBillingReport", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Provides a summarized report along with actions for resources billed via given reservation. + /// 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 reservation. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetBillingReportAsync(string subscriptionId, string resourceGroupName, string reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var message = CreateGetBillingReportRequest(subscriptionId, resourceGroupName, reservationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReservationBillingUsageReport value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReservationBillingUsageReport.DeserializeReservationBillingUsageReport(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Provides a summarized report along with actions for resources billed via given reservation. + /// 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 reservation. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetBillingReport(string subscriptionId, string resourceGroupName, string reservationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(reservationName, nameof(reservationName)); + + using var message = CreateGetBillingReportRequest(subscriptionId, resourceGroupName, reservationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReservationBillingUsageReport value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReservationBillingUsageReport.DeserializeReservationBillingUsageReport(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List reservations by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReservationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReservationListResult.DeserializeReservationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List reservations by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReservationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReservationListResult.DeserializeReservationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List reservations by Azure subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReservationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReservationListResult.DeserializeReservationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List reservations by Azure subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReservationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReservationListResult.DeserializeReservationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/StoragePoolsRestOperations.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/StoragePoolsRestOperations.cs new file mode 100644 index 000000000000..041485333a46 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/RestOperations/StoragePoolsRestOperations.cs @@ -0,0 +1,1357 @@ +// 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.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + internal partial class StoragePoolsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of StoragePoolsRestOperations. + /// 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 StoragePoolsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-11-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string storagePoolName) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a storage pool. + /// 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 storage pool. + /// 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 storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, storagePoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StoragePoolData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = StoragePoolData.DeserializeStoragePoolData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((StoragePoolData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a storage pool. + /// 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 storage pool. + /// 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 storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, storagePoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StoragePoolData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = StoragePoolData.DeserializeStoragePoolData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((StoragePoolData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, StoragePoolData 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string storagePoolName, StoragePoolData 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a storage pool. + /// 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 storage pool. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string storagePoolName, StoragePoolData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, storagePoolName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a storage pool. + /// 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 storage pool. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string storagePoolName, StoragePoolData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, storagePoolName, 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 storagePoolName, StoragePoolPatch 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string storagePoolName, StoragePoolPatch 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a storage pool. + /// 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 storage pool. + /// 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 storagePoolName, StoragePoolPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, storagePoolName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a storage pool. + /// 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 storage pool. + /// 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 storagePoolName, StoragePoolPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, storagePoolName, 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 storagePoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string storagePoolName) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a storage pool. + /// 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 storage pool. + /// 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 storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, storagePoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a storage pool. + /// 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 storage pool. + /// 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 storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, storagePoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List storage pools by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StoragePoolListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = StoragePoolListResult.DeserializeStoragePoolListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List storage pools by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StoragePoolListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = StoragePoolListResult.DeserializeStoragePoolListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List storage pools by Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StoragePoolListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = StoragePoolListResult.DeserializeStoragePoolListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List storage pools by Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StoragePoolListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = StoragePoolListResult.DeserializeStoragePoolListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetHealthStatusRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/getHealthStatus", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetHealthStatusRequest(string subscriptionId, string resourceGroupName, string storagePoolName) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/getHealthStatus", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieve health metrics of a storage pool. + /// 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 storage pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetHealthStatusAsync(string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateGetHealthStatusRequest(subscriptionId, resourceGroupName, storagePoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StoragePoolHealthInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = StoragePoolHealthInfo.DeserializeStoragePoolHealthInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieve health metrics of a storage pool. + /// 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 storage pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetHealthStatus(string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateGetHealthStatusRequest(subscriptionId, resourceGroupName, storagePoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StoragePoolHealthInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = StoragePoolHealthInfo.DeserializeStoragePoolHealthInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetAvsConnectionRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/getAvsConnection", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetAvsConnectionRequest(string subscriptionId, string resourceGroupName, string storagePoolName) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/getAvsConnection", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns current information about an on-going connection to an AVS instance. + /// 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 storage pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAvsConnectionAsync(string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateGetAvsConnectionRequest(subscriptionId, resourceGroupName, storagePoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsConnection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvsConnection.DeserializeAvsConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns current information about an on-going connection to an AVS instance. + /// 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 storage pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetAvsConnection(string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateGetAvsConnectionRequest(subscriptionId, resourceGroupName, storagePoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsConnection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvsConnection.DeserializeAvsConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetAvsStatusRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/getAvsStatus", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetAvsStatusRequest(string subscriptionId, string resourceGroupName, string storagePoolName) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/getAvsStatus", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns the status of the storage pool connection to AVS. + /// 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 storage pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAvsStatusAsync(string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateGetAvsStatusRequest(subscriptionId, resourceGroupName, storagePoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvsStatus.DeserializeAvsStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns the status of the storage pool connection to AVS. + /// 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 storage pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetAvsStatus(string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateGetAvsStatusRequest(subscriptionId, resourceGroupName, storagePoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvsStatus.DeserializeAvsStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateEnableAvsConnectionRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, StoragePoolEnableAvsConnectionPost properties) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/enableAvsConnection", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateEnableAvsConnectionRequest(string subscriptionId, string resourceGroupName, string storagePoolName, StoragePoolEnableAvsConnectionPost properties) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/enableAvsConnection", 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(properties, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Initiate a connection between the storage pool and a specified AVS SDDC 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 storage pool. + /// Storage pool EnableAvsConnection properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task EnableAvsConnectionAsync(string subscriptionId, string resourceGroupName, string storagePoolName, StoragePoolEnableAvsConnectionPost properties, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNull(properties, nameof(properties)); + + using var message = CreateEnableAvsConnectionRequest(subscriptionId, resourceGroupName, storagePoolName, properties); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Initiate a connection between the storage pool and a specified AVS SDDC 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 storage pool. + /// Storage pool EnableAvsConnection properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response EnableAvsConnection(string subscriptionId, string resourceGroupName, string storagePoolName, StoragePoolEnableAvsConnectionPost properties, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNull(properties, nameof(properties)); + + using var message = CreateEnableAvsConnectionRequest(subscriptionId, resourceGroupName, storagePoolName, properties); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDisableAvsConnectionRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/disableAvsConnection", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDisableAvsConnectionRequest(string subscriptionId, string resourceGroupName, string storagePoolName) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/disableAvsConnection", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Disable the existing AVS connection. + /// 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 storage pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DisableAvsConnectionAsync(string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateDisableAvsConnectionRequest(subscriptionId, resourceGroupName, storagePoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Disable the existing AVS connection. + /// 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 storage pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response DisableAvsConnection(string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateDisableAvsConnectionRequest(subscriptionId, resourceGroupName, storagePoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateFinalizeAvsConnectionRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName, StoragePoolFinalizeAvsConnectionPost properties) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/finalizeAvsConnection", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateFinalizeAvsConnectionRequest(string subscriptionId, string resourceGroupName, string storagePoolName, StoragePoolFinalizeAvsConnectionPost properties) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/finalizeAvsConnection", 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(properties, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Finalize an already started AVS connection to a specific AVS SDDC. + /// 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 storage pool. + /// Storage pool FinalizeAvsConnection properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task FinalizeAvsConnectionAsync(string subscriptionId, string resourceGroupName, string storagePoolName, StoragePoolFinalizeAvsConnectionPost properties, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNull(properties, nameof(properties)); + + using var message = CreateFinalizeAvsConnectionRequest(subscriptionId, resourceGroupName, storagePoolName, properties); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Finalize an already started AVS connection to a specific AVS SDDC. + /// 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 storage pool. + /// Storage pool FinalizeAvsConnection properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response FinalizeAvsConnection(string subscriptionId, string resourceGroupName, string storagePoolName, StoragePoolFinalizeAvsConnectionPost properties, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNull(properties, nameof(properties)); + + using var message = CreateFinalizeAvsConnectionRequest(subscriptionId, resourceGroupName, storagePoolName, properties); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRepairAvsConnectionRequestUri(string subscriptionId, string resourceGroupName, string storagePoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/repairAvsConnection", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRepairAvsConnectionRequest(string subscriptionId, string resourceGroupName, string storagePoolName) + { + 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/PureStorage.Block/storagePools/", false); + uri.AppendPath(storagePoolName, true); + uri.AppendPath("/repairAvsConnection", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Test and repair, if needed, all configuration elements of the storage pool connection to the AVS instance. + /// 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 storage pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task RepairAvsConnectionAsync(string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateRepairAvsConnectionRequest(subscriptionId, resourceGroupName, storagePoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Test and repair, if needed, all configuration elements of the storage pool connection to the AVS instance. + /// 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 storage pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response RepairAvsConnection(string subscriptionId, string resourceGroupName, string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var message = CreateRepairAvsConnectionRequest(subscriptionId, resourceGroupName, storagePoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List storage pools by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StoragePoolListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = StoragePoolListResult.DeserializeStoragePoolListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List storage pools by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StoragePoolListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = StoragePoolListResult.DeserializeStoragePoolListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List storage pools by Azure subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StoragePoolListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = StoragePoolListResult.DeserializeStoragePoolListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List storage pools by Azure subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StoragePoolListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = StoragePoolListResult.DeserializeStoragePoolListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolCollection.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolCollection.cs new file mode 100644 index 000000000000..24b3196a4e8a --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// 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 GetStoragePools method from an instance of . + /// + public partial class StoragePoolCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _storagePoolClientDiagnostics; + private readonly StoragePoolsRestOperations _storagePoolRestClient; + + /// Initializes a new instance of the class for mocking. + protected StoragePoolCollection() + { + } + + /// 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 StoragePoolCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _storagePoolClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PureStorageBlock", StoragePoolResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(StoragePoolResource.ResourceType, out string storagePoolApiVersion); + _storagePoolRestClient = new StoragePoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, storagePoolApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Create + /// + /// + /// Default Api Version + /// 2024-11-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 storage pool. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string storagePoolName, StoragePoolData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _storagePoolRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, storagePoolName, data, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(new StoragePoolOperationSource(Client), _storagePoolClientDiagnostics, Pipeline, _storagePoolRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, storagePoolName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Create + /// + /// + /// Default Api Version + /// 2024-11-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 storage pool. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string storagePoolName, StoragePoolData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _storagePoolRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, storagePoolName, data, cancellationToken); + var operation = new PureStorageBlockArmOperation(new StoragePoolOperationSource(Client), _storagePoolClientDiagnostics, Pipeline, _storagePoolRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, storagePoolName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage pool. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolCollection.Get"); + scope.Start(); + try + { + var response = await _storagePoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, storagePoolName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new StoragePoolResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage pool. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolCollection.Get"); + scope.Start(); + try + { + var response = _storagePoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, storagePoolName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new StoragePoolResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List storage pools by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools + /// + /// + /// Operation Id + /// StoragePool_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _storagePoolRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _storagePoolRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StoragePoolResource(Client, StoragePoolData.DeserializeStoragePoolData(e)), _storagePoolClientDiagnostics, Pipeline, "StoragePoolCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List storage pools by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools + /// + /// + /// Operation Id + /// StoragePool_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _storagePoolRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _storagePoolRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StoragePoolResource(Client, StoragePoolData.DeserializeStoragePoolData(e)), _storagePoolClientDiagnostics, Pipeline, "StoragePoolCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage pool. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolCollection.Exists"); + scope.Start(); + try + { + var response = await _storagePoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, storagePoolName, 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/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage pool. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolCollection.Exists"); + scope.Start(); + try + { + var response = _storagePoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, storagePoolName, 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/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage pool. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _storagePoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, storagePoolName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new StoragePoolResource(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/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage pool. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string storagePoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(storagePoolName, nameof(storagePoolName)); + + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolCollection.GetIfExists"); + scope.Start(); + try + { + var response = _storagePoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, storagePoolName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new StoragePoolResource(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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolData.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolData.Serialization.cs new file mode 100644 index 000000000000..d9eb6b2c38c5 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolData.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + public partial class StoragePoolData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(StoragePoolData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + } + + StoragePoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StoragePoolData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStoragePoolData(document.RootElement, options); + } + + internal static StoragePoolData DeserializeStoragePoolData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + StoragePoolProperties properties = default; + ManagedServiceIdentity identity = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = StoragePoolProperties.DeserializeStoragePoolProperties(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StoragePoolData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + identity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerPureStorageBlockContext.Default); + default: + throw new FormatException($"The model {nameof(StoragePoolData)} does not support writing '{options.Format}' format."); + } + } + + StoragePoolData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStoragePoolData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StoragePoolData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolData.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolData.cs new file mode 100644 index 000000000000..98527f586701 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolData.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PureStorageBlock.Models; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A class representing the StoragePool data model. + /// Storage pool resource + /// + public partial class StoragePoolData : 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 StoragePoolData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. + /// Keeps track of any properties unknown to the library. + internal StoragePoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, StoragePoolProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StoragePoolData() + { + } + + /// The resource-specific properties for this resource. + public StoragePoolProperties Properties { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolResource.Serialization.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolResource.Serialization.cs new file mode 100644 index 000000000000..8bd708ae8c78 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolResource.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.PureStorageBlock +{ + public partial class StoragePoolResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + StoragePoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerPureStorageBlockContext.Default); + + StoragePoolData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerPureStorageBlockContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolResource.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolResource.cs new file mode 100644 index 000000000000..41ef312400de --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Generated/StoragePoolResource.cs @@ -0,0 +1,1425 @@ +// 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.PureStorageBlock.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.PureStorageBlock +{ + /// + /// A Class representing a StoragePool 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 GetStoragePoolResource method. + /// Otherwise you can get one from its parent resource using the GetStoragePool method. + /// + public partial class StoragePoolResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The storagePoolName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string storagePoolName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _storagePoolClientDiagnostics; + private readonly StoragePoolsRestOperations _storagePoolRestClient; + private readonly StoragePoolData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "PureStorage.Block/storagePools"; + + /// Initializes a new instance of the class for mocking. + protected StoragePoolResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal StoragePoolResource(ArmClient client, StoragePoolData 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 StoragePoolResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _storagePoolClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PureStorageBlock", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string storagePoolApiVersion); + _storagePoolRestClient = new StoragePoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, storagePoolApiVersion); +#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 StoragePoolData 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 AvsStorageContainerResources in the StoragePool. + /// An object representing collection of AvsStorageContainerResources and their operations over a AvsStorageContainerResource. + public virtual AvsStorageContainerCollection GetAvsStorageContainers() + { + return GetCachedClient(client => new AvsStorageContainerCollection(client, Id)); + } + + /// + /// Get an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName} + /// + /// + /// Operation Id + /// AvsStorageContainer_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage container. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAvsStorageContainerAsync(string storageContainerName, CancellationToken cancellationToken = default) + { + return await GetAvsStorageContainers().GetAsync(storageContainerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an AVS storage container + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsStorageContainers/{storageContainerName} + /// + /// + /// Operation Id + /// AvsStorageContainer_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the storage container. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAvsStorageContainer(string storageContainerName, CancellationToken cancellationToken = default) + { + return GetAvsStorageContainers().Get(storageContainerName, cancellationToken); + } + + /// Gets a collection of AvsVmResources in the StoragePool. + /// An object representing collection of AvsVmResources and their operations over a AvsVmResource. + public virtual AvsVmCollection GetAvsVms() + { + return GetCachedClient(client => new AvsVmCollection(client, Id)); + } + + /// + /// Get an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId} + /// + /// + /// Operation Id + /// AvsVm_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the AVS VM. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAvsVmAsync(string avsVmId, CancellationToken cancellationToken = default) + { + return await GetAvsVms().GetAsync(avsVmId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an AVS VM + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/avsVms/{avsVmId} + /// + /// + /// Operation Id + /// AvsVm_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ID of the AVS VM. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAvsVm(string avsVmId, CancellationToken cancellationToken = default) + { + return GetAvsVms().Get(avsVmId, cancellationToken); + } + + /// + /// Get a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.Get"); + scope.Start(); + try + { + var response = await _storagePoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new StoragePoolResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.Get"); + scope.Start(); + try + { + var response = _storagePoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new StoragePoolResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Delete + /// + /// + /// Default Api Version + /// 2024-11-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 = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.Delete"); + scope.Start(); + try + { + var response = await _storagePoolRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(_storagePoolClientDiagnostics, Pipeline, _storagePoolRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Delete + /// + /// + /// Default Api Version + /// 2024-11-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 = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.Delete"); + scope.Start(); + try + { + var response = _storagePoolRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new PureStorageBlockArmOperation(_storagePoolClientDiagnostics, Pipeline, _storagePoolRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Update + /// + /// + /// Default Api Version + /// 2024-11-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, StoragePoolPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.Update"); + scope.Start(); + try + { + var response = await _storagePoolRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(new StoragePoolOperationSource(Client), _storagePoolClientDiagnostics, Pipeline, _storagePoolRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Update + /// + /// + /// Default Api Version + /// 2024-11-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, StoragePoolPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.Update"); + scope.Start(); + try + { + var response = _storagePoolRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new PureStorageBlockArmOperation(new StoragePoolOperationSource(Client), _storagePoolClientDiagnostics, Pipeline, _storagePoolRestClient.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; + } + } + + /// + /// Retrieve health metrics of a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/getHealthStatus + /// + /// + /// Operation Id + /// StoragePools_GetHealthStatus + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetHealthStatusAsync(CancellationToken cancellationToken = default) + { + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.GetHealthStatus"); + scope.Start(); + try + { + var response = await _storagePoolRestClient.GetHealthStatusAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieve health metrics of a storage pool + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/getHealthStatus + /// + /// + /// Operation Id + /// StoragePools_GetHealthStatus + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetHealthStatus(CancellationToken cancellationToken = default) + { + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.GetHealthStatus"); + scope.Start(); + try + { + var response = _storagePoolRestClient.GetHealthStatus(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns current information about an on-going connection to an AVS instance + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/getAvsConnection + /// + /// + /// Operation Id + /// StoragePools_GetAvsConnection + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAvsConnectionAsync(CancellationToken cancellationToken = default) + { + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.GetAvsConnection"); + scope.Start(); + try + { + var response = await _storagePoolRestClient.GetAvsConnectionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns current information about an on-going connection to an AVS instance + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/getAvsConnection + /// + /// + /// Operation Id + /// StoragePools_GetAvsConnection + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetAvsConnection(CancellationToken cancellationToken = default) + { + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.GetAvsConnection"); + scope.Start(); + try + { + var response = _storagePoolRestClient.GetAvsConnection(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the status of the storage pool connection to AVS + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/getAvsStatus + /// + /// + /// Operation Id + /// StoragePools_GetAvsStatus + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAvsStatusAsync(CancellationToken cancellationToken = default) + { + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.GetAvsStatus"); + scope.Start(); + try + { + var response = await _storagePoolRestClient.GetAvsStatusAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the status of the storage pool connection to AVS + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/getAvsStatus + /// + /// + /// Operation Id + /// StoragePools_GetAvsStatus + /// + /// + /// Default Api Version + /// 2024-11-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetAvsStatus(CancellationToken cancellationToken = default) + { + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.GetAvsStatus"); + scope.Start(); + try + { + var response = _storagePoolRestClient.GetAvsStatus(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Initiate a connection between the storage pool and a specified AVS SDDC resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/enableAvsConnection + /// + /// + /// Operation Id + /// StoragePools_EnableAvsConnection + /// + /// + /// Default Api Version + /// 2024-11-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. + /// Storage pool EnableAvsConnection properties. + /// The cancellation token to use. + /// is null. + public virtual async Task EnableAvsConnectionAsync(WaitUntil waitUntil, StoragePoolEnableAvsConnectionPost properties, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(properties, nameof(properties)); + + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.EnableAvsConnection"); + scope.Start(); + try + { + var response = await _storagePoolRestClient.EnableAvsConnectionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, properties, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(_storagePoolClientDiagnostics, Pipeline, _storagePoolRestClient.CreateEnableAvsConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, properties).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Initiate a connection between the storage pool and a specified AVS SDDC resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/enableAvsConnection + /// + /// + /// Operation Id + /// StoragePools_EnableAvsConnection + /// + /// + /// Default Api Version + /// 2024-11-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. + /// Storage pool EnableAvsConnection properties. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation EnableAvsConnection(WaitUntil waitUntil, StoragePoolEnableAvsConnectionPost properties, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(properties, nameof(properties)); + + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.EnableAvsConnection"); + scope.Start(); + try + { + var response = _storagePoolRestClient.EnableAvsConnection(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, properties, cancellationToken); + var operation = new PureStorageBlockArmOperation(_storagePoolClientDiagnostics, Pipeline, _storagePoolRestClient.CreateEnableAvsConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, properties).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Disable the existing AVS connection + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/disableAvsConnection + /// + /// + /// Operation Id + /// StoragePools_DisableAvsConnection + /// + /// + /// Default Api Version + /// 2024-11-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 DisableAvsConnectionAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.DisableAvsConnection"); + scope.Start(); + try + { + var response = await _storagePoolRestClient.DisableAvsConnectionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(_storagePoolClientDiagnostics, Pipeline, _storagePoolRestClient.CreateDisableAvsConnectionRequest(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; + } + } + + /// + /// Disable the existing AVS connection + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/disableAvsConnection + /// + /// + /// Operation Id + /// StoragePools_DisableAvsConnection + /// + /// + /// Default Api Version + /// 2024-11-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 DisableAvsConnection(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.DisableAvsConnection"); + scope.Start(); + try + { + var response = _storagePoolRestClient.DisableAvsConnection(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new PureStorageBlockArmOperation(_storagePoolClientDiagnostics, Pipeline, _storagePoolRestClient.CreateDisableAvsConnectionRequest(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; + } + } + + /// + /// Finalize an already started AVS connection to a specific AVS SDDC + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/finalizeAvsConnection + /// + /// + /// Operation Id + /// StoragePools_FinalizeAvsConnection + /// + /// + /// Default Api Version + /// 2024-11-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. + /// Storage pool FinalizeAvsConnection properties. + /// The cancellation token to use. + /// is null. + public virtual async Task FinalizeAvsConnectionAsync(WaitUntil waitUntil, StoragePoolFinalizeAvsConnectionPost properties, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(properties, nameof(properties)); + + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.FinalizeAvsConnection"); + scope.Start(); + try + { + var response = await _storagePoolRestClient.FinalizeAvsConnectionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, properties, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(_storagePoolClientDiagnostics, Pipeline, _storagePoolRestClient.CreateFinalizeAvsConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, properties).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Finalize an already started AVS connection to a specific AVS SDDC + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/finalizeAvsConnection + /// + /// + /// Operation Id + /// StoragePools_FinalizeAvsConnection + /// + /// + /// Default Api Version + /// 2024-11-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. + /// Storage pool FinalizeAvsConnection properties. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation FinalizeAvsConnection(WaitUntil waitUntil, StoragePoolFinalizeAvsConnectionPost properties, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(properties, nameof(properties)); + + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.FinalizeAvsConnection"); + scope.Start(); + try + { + var response = _storagePoolRestClient.FinalizeAvsConnection(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, properties, cancellationToken); + var operation = new PureStorageBlockArmOperation(_storagePoolClientDiagnostics, Pipeline, _storagePoolRestClient.CreateFinalizeAvsConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, properties).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Test and repair, if needed, all configuration elements of the storage pool connection to the AVS instance + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/repairAvsConnection + /// + /// + /// Operation Id + /// StoragePools_RepairAvsConnection + /// + /// + /// Default Api Version + /// 2024-11-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 RepairAvsConnectionAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.RepairAvsConnection"); + scope.Start(); + try + { + var response = await _storagePoolRestClient.RepairAvsConnectionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new PureStorageBlockArmOperation(_storagePoolClientDiagnostics, Pipeline, _storagePoolRestClient.CreateRepairAvsConnectionRequest(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; + } + } + + /// + /// Test and repair, if needed, all configuration elements of the storage pool connection to the AVS instance + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName}/repairAvsConnection + /// + /// + /// Operation Id + /// StoragePools_RepairAvsConnection + /// + /// + /// Default Api Version + /// 2024-11-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 RepairAvsConnection(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.RepairAvsConnection"); + scope.Start(); + try + { + var response = _storagePoolRestClient.RepairAvsConnection(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new PureStorageBlockArmOperation(_storagePoolClientDiagnostics, Pipeline, _storagePoolRestClient.CreateRepairAvsConnectionRequest(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; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-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 = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.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 _storagePoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new StoragePoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new StoragePoolPatch(); + 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/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-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 = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.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 = _storagePoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new StoragePoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new StoragePoolPatch(); + 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/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-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 = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.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 _storagePoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new StoragePoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new StoragePoolPatch(); + 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/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-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 = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.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 = _storagePoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new StoragePoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new StoragePoolPatch(); + 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/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-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 = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.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 _storagePoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new StoragePoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new StoragePoolPatch(); + 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/PureStorage.Block/storagePools/{storagePoolName} + /// + /// + /// Operation Id + /// StoragePool_Get + /// + /// + /// Default Api Version + /// 2024-11-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 = _storagePoolClientDiagnostics.CreateScope("StoragePoolResource.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 = _storagePoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new StoragePoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new StoragePoolPatch(); + 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/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Properties/AssemblyInfo.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..539715979180 --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/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.PureStorageBlock.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("PureStorageBlock")] diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tests/Azure.ResourceManager.PureStorageBlock.Tests.csproj b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tests/Azure.ResourceManager.PureStorageBlock.Tests.csproj new file mode 100644 index 000000000000..330a81396e6a --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tests/Azure.ResourceManager.PureStorageBlock.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tests/PureStorageBlockManagementTestBase.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tests/PureStorageBlockManagementTestBase.cs new file mode 100644 index 000000000000..55b22d9186af --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tests/PureStorageBlockManagementTestBase.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.PureStorageBlock.Tests +{ + public class PureStorageBlockManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected PureStorageBlockManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected PureStorageBlockManagementTestBase(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/purestorageblock/Azure.ResourceManager.PureStorageBlock/tests/PureStorageBlockManagementTestEnvironment.cs b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tests/PureStorageBlockManagementTestEnvironment.cs new file mode 100644 index 000000000000..005766e8068e --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tests/PureStorageBlockManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.PureStorageBlock.Tests +{ + public class PureStorageBlockManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tsp-location.yaml b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tsp-location.yaml new file mode 100644 index 000000000000..088f34d18e5a --- /dev/null +++ b/sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/purestorage/PureStorage.Block.Management +commit: 6c18d6b7e414f9077bea45a930d07c91d6d949dc +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/purestorageblock/ci.mgmt.yml b/sdk/purestorageblock/ci.mgmt.yml new file mode 100644 index 000000000000..58058fa868eb --- /dev/null +++ b/sdk/purestorageblock/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/purestorageblock /ci.mgmt.yml + - sdk/purestorageblock /Azure.ResourceManager.PureStorageBlock / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: purestorageblock + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.PureStorageBlock + safeName: AzureResourceManagerPureStorageBlock diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 9ae0a7e75290..b6e28d8a10ec 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -161,6 +161,7 @@ trigger: - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated - sdk/privatedns/Azure.ResourceManager.PrivateDns - sdk/providerhub/Azure.ResourceManager.ProviderHub + - sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock - sdk/purview/Azure.ResourceManager.Purview - sdk/quantum/Azure.ResourceManager.Quantum - sdk/qumulo/Azure.ResourceManager.Qumulo @@ -377,6 +378,7 @@ pr: - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated - sdk/privatedns/Azure.ResourceManager.PrivateDns - sdk/providerhub/Azure.ResourceManager.ProviderHub + - sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock - sdk/purview/Azure.ResourceManager.Purview - sdk/quantum/Azure.ResourceManager.Quantum - sdk/qumulo/Azure.ResourceManager.Qumulo diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/