From d613bad8127be3a8d95a8adb0dda00460243a3dc Mon Sep 17 00:00:00 2001
From: azure-powershell-bot
<65331932+azure-powershell-bot@users.noreply.github.com>
Date: Tue, 22 Aug 2023 07:52:52 +0000
Subject: [PATCH 1/2] Move KeyVault to main
---
.../KeyVault.Autorest/Az.KeyVault.csproj | 10 +
.../Az.KeyVault.format.ps1xml | 1965 +++
.../KeyVault.Autorest/Az.KeyVault.psd1 | 23 +
.../KeyVault.Autorest/Az.KeyVault.psm1 | 115 +
.../Properties/AssemblyInfo.cs | 28 +
src/KeyVault/KeyVault.Autorest/README.md | 102 +
.../KeyVault.Autorest/build-module.ps1 | 174 +
.../KeyVault.Autorest/check-dependencies.ps1 | 65 +
.../create-model-cmdlets.ps1 | 262 +
.../custom/Add-AzKeyVaultManagedHsmRegion.ps1 | 136 +
.../custom/Az.KeyVault.custom.psm1 | 17 +
.../custom/ManagedHsm.json.cs | 20 +
.../KeyVault.Autorest/custom/README.md | 41 +
.../Remove-AzKeyVaultManagedHsmRegion.ps1 | 148 +
.../docs/Add-AzKeyVaultManagedHsmRegion.md | 176 +
.../KeyVault.Autorest/docs/Az.KeyVault.md | 28 +
.../docs/Get-AzKeyVaultManagedHsmRegion.md | 115 +
src/KeyVault/KeyVault.Autorest/docs/README.md | 11 +
.../docs/Remove-AzKeyVaultManagedHsmRegion.md | 192 +
...st-AzKeyVaultManagedHsmNameAvailability.md | 188 +
.../docs/Test-AzKeyVaultNameAvailability.md | 188 +
.../Add-AzKeyVaultManagedHsmRegion.md | 13 +
.../Get-AzKeyVaultManagedHsmRegion.md | 13 +
.../Remove-AzKeyVaultManagedHsmRegion.md | 13 +
...st-AzKeyVaultManagedHsmNameAvailability.md | 25 +
.../Test-AzKeyVaultNameAvailability.md | 25 +
.../KeyVault.Autorest/export-surface.ps1 | 41 +
.../Add-AzKeyVaultManagedHsmRegion.ps1 | 190 +
.../Get-AzKeyVaultManagedHsmRegion.ps1 | 178 +
.../exports/ProxyCmdletDefinitions.ps1 | 880 ++
.../KeyVault.Autorest/exports/README.md | 20 +
.../Remove-AzKeyVaultManagedHsmRegion.ps1 | 196 +
...t-AzKeyVaultManagedHsmNameAvailability.ps1 | 188 +
.../Test-AzKeyVaultNameAvailability.ps1 | 188 +
.../KeyVault.Autorest/generate-help.ps1 | 74 +
.../KeyVault.Autorest/generate-info.json | 8 +
.../KeyVault.Autorest/generate-portal-ux.ps1 | 390 +
.../KeyVault.Autorest/generated/Module.cs | 181 +
.../generated/api/KeyVault.cs | 12616 ++++++++++++++++
.../Models/AccessPolicyEntry.PowerShell.cs | 224 +
.../Models/AccessPolicyEntry.TypeConverter.cs | 147 +
.../generated/api/Models/AccessPolicyEntry.cs | 202 +
.../api/Models/AccessPolicyEntry.json.cs | 117 +
...smNameAvailabilityParameters.PowerShell.cs | 166 +
...ameAvailabilityParameters.TypeConverter.cs | 149 +
.../CheckMhsmNameAvailabilityParameters.cs | 54 +
...heckMhsmNameAvailabilityParameters.json.cs | 109 +
...ckMhsmNameAvailabilityResult.PowerShell.cs | 180 +
...hsmNameAvailabilityResult.TypeConverter.cs | 148 +
.../Models/CheckMhsmNameAvailabilityResult.cs | 120 +
.../CheckMhsmNameAvailabilityResult.json.cs | 121 +
.../CheckNameAvailabilityResult.PowerShell.cs | 180 +
...eckNameAvailabilityResult.TypeConverter.cs | 147 +
.../api/Models/CheckNameAvailabilityResult.cs | 120 +
.../CheckNameAvailabilityResult.json.cs | 121 +
.../api/Models/CloudError.PowerShell.cs | 180 +
.../api/Models/CloudError.TypeConverter.cs | 146 +
.../generated/api/Models/CloudError.cs | 86 +
.../generated/api/Models/CloudError.json.cs | 106 +
.../api/Models/CloudErrorBody.PowerShell.cs | 172 +
.../Models/CloudErrorBody.TypeConverter.cs | 147 +
.../generated/api/Models/CloudErrorBody.cs | 80 +
.../api/Models/CloudErrorBody.json.cs | 110 +
.../Models/DeletedManagedHsm.PowerShell.cs | 234 +
.../Models/DeletedManagedHsm.TypeConverter.cs | 147 +
.../generated/api/Models/DeletedManagedHsm.cs | 236 +
.../api/Models/DeletedManagedHsm.json.cs | 122 +
.../DeletedManagedHsmListResult.PowerShell.cs | 172 +
...letedManagedHsmListResult.TypeConverter.cs | 147 +
.../api/Models/DeletedManagedHsmListResult.cs | 74 +
.../DeletedManagedHsmListResult.json.cs | 118 +
.../DeletedManagedHsmProperties.PowerShell.cs | 204 +
...letedManagedHsmProperties.TypeConverter.cs | 147 +
.../api/Models/DeletedManagedHsmProperties.cs | 172 +
.../DeletedManagedHsmProperties.json.cs | 136 +
...etedManagedHsmPropertiesTags.PowerShell.cs | 160 +
...dManagedHsmPropertiesTags.TypeConverter.cs | 148 +
.../Models/DeletedManagedHsmPropertiesTags.cs | 35 +
...etedManagedHsmPropertiesTags.dictionary.cs | 75 +
.../DeletedManagedHsmPropertiesTags.json.cs | 109 +
.../api/Models/DeletedVault.PowerShell.cs | 236 +
.../api/Models/DeletedVault.TypeConverter.cs | 147 +
.../generated/api/Models/DeletedVault.cs | 239 +
.../generated/api/Models/DeletedVault.json.cs | 123 +
.../DeletedVaultListResult.PowerShell.cs | 172 +
.../DeletedVaultListResult.TypeConverter.cs | 147 +
.../api/Models/DeletedVaultListResult.cs | 74 +
.../api/Models/DeletedVaultListResult.json.cs | 118 +
.../DeletedVaultProperties.PowerShell.cs | 204 +
.../DeletedVaultProperties.TypeConverter.cs | 147 +
.../api/Models/DeletedVaultProperties.cs | 172 +
.../api/Models/DeletedVaultProperties.json.cs | 136 +
.../DeletedVaultPropertiesTags.PowerShell.cs | 160 +
...eletedVaultPropertiesTags.TypeConverter.cs | 147 +
.../api/Models/DeletedVaultPropertiesTags.cs | 35 +
.../DeletedVaultPropertiesTags.dictionary.cs | 75 +
.../Models/DeletedVaultPropertiesTags.json.cs | 109 +
.../generated/api/Models/Error.PowerShell.cs | 180 +
.../api/Models/Error.TypeConverter.cs | 146 +
.../generated/api/Models/Error.cs | 103 +
.../generated/api/Models/Error.json.cs | 119 +
.../generated/api/Models/IPRule.PowerShell.cs | 166 +
.../api/Models/IPRule.TypeConverter.cs | 146 +
.../generated/api/Models/IPRule.cs | 65 +
.../generated/api/Models/IPRule.json.cs | 108 +
.../api/Models/KeyVaultIdentity.PowerShell.cs | 218 +
.../Models/KeyVaultIdentity.TypeConverter.cs | 157 +
.../generated/api/Models/KeyVaultIdentity.cs | 202 +
.../api/Models/KeyVaultIdentity.json.cs | 121 +
.../api/Models/ManagedHsm.PowerShell.cs | 452 +
.../api/Models/ManagedHsm.TypeConverter.cs | 146 +
.../generated/api/Models/ManagedHsm.cs | 574 +
.../generated/api/Models/ManagedHsm.json.cs | 108 +
.../api/Models/ManagedHsmError.PowerShell.cs | 164 +
.../Models/ManagedHsmError.TypeConverter.cs | 147 +
.../generated/api/Models/ManagedHsmError.cs | 57 +
.../api/Models/ManagedHsmError.json.cs | 111 +
.../Models/ManagedHsmListResult.PowerShell.cs | 172 +
.../ManagedHsmListResult.TypeConverter.cs | 147 +
.../api/Models/ManagedHsmListResult.cs | 74 +
.../api/Models/ManagedHsmListResult.json.cs | 118 +
.../Models/ManagedHsmProperties.PowerShell.cs | 324 +
.../ManagedHsmProperties.TypeConverter.cs | 147 +
.../api/Models/ManagedHsmProperties.cs | 514 +
.../api/Models/ManagedHsmProperties.json.cs | 180 +
.../Models/ManagedHsmResource.PowerShell.cs | 276 +
.../ManagedHsmResource.TypeConverter.cs | 147 +
.../api/Models/ManagedHsmResource.cs | 316 +
.../api/Models/ManagedHsmResource.json.cs | 135 +
.../ManagedHsmResourceTags.PowerShell.cs | 160 +
.../ManagedHsmResourceTags.TypeConverter.cs | 147 +
.../api/Models/ManagedHsmResourceTags.cs | 35 +
.../ManagedHsmResourceTags.dictionary.cs | 75 +
.../api/Models/ManagedHsmResourceTags.json.cs | 109 +
...dHsmSecurityDomainProperties.PowerShell.cs | 174 +
...mSecurityDomainProperties.TypeConverter.cs | 149 +
.../ManagedHsmSecurityDomainProperties.cs | 82 +
...ManagedHsmSecurityDomainProperties.json.cs | 117 +
.../api/Models/ManagedHsmSku.PowerShell.cs | 172 +
.../api/Models/ManagedHsmSku.TypeConverter.cs | 147 +
.../generated/api/Models/ManagedHsmSku.cs | 79 +
.../api/Models/ManagedHsmSku.json.cs | 110 +
.../MhsmGeoReplicatedRegion.PowerShell.cs | 180 +
.../MhsmGeoReplicatedRegion.TypeConverter.cs | 147 +
.../api/Models/MhsmGeoReplicatedRegion.cs | 105 +
.../Models/MhsmGeoReplicatedRegion.json.cs | 115 +
.../Models/MhsmNetworkRuleSet.PowerShell.cs | 188 +
.../MhsmNetworkRuleSet.TypeConverter.cs | 147 +
.../api/Models/MhsmNetworkRuleSet.cs | 133 +
.../api/Models/MhsmNetworkRuleSet.json.cs | 130 +
.../Models/MhsmPrivateEndpoint.PowerShell.cs | 164 +
.../MhsmPrivateEndpoint.TypeConverter.cs | 147 +
.../api/Models/MhsmPrivateEndpoint.cs | 57 +
.../api/Models/MhsmPrivateEndpoint.json.cs | 111 +
...hsmPrivateEndpointConnection.PowerShell.cs | 364 +
...PrivateEndpointConnection.TypeConverter.cs | 147 +
.../Models/MhsmPrivateEndpointConnection.cs | 341 +
.../MhsmPrivateEndpointConnection.json.cs | 112 +
...rivateEndpointConnectionItem.PowerShell.cs | 238 +
...ateEndpointConnectionItem.TypeConverter.cs | 148 +
.../MhsmPrivateEndpointConnectionItem.cs | 208 +
.../MhsmPrivateEndpointConnectionItem.json.cs | 112 +
...EndpointConnectionProperties.PowerShell.cs | 217 +
...pointConnectionProperties.TypeConverter.cs | 151 +
...MhsmPrivateEndpointConnectionProperties.cs | 167 +
...rivateEndpointConnectionProperties.json.cs | 114 +
...ndpointConnectionsListResult.PowerShell.cs | 177 +
...ointConnectionsListResult.TypeConverter.cs | 151 +
...hsmPrivateEndpointConnectionsListResult.cs | 76 +
...ivateEndpointConnectionsListResult.json.cs | 120 +
.../MhsmPrivateLinkResource.PowerShell.cs | 308 +
.../MhsmPrivateLinkResource.TypeConverter.cs | 147 +
.../api/Models/MhsmPrivateLinkResource.cs | 202 +
.../Models/MhsmPrivateLinkResource.json.cs | 110 +
...rivateLinkResourceListResult.PowerShell.cs | 166 +
...ateLinkResourceListResult.TypeConverter.cs | 148 +
.../MhsmPrivateLinkResourceListResult.cs | 54 +
.../MhsmPrivateLinkResourceListResult.json.cs | 116 +
...rivateLinkResourceProperties.PowerShell.cs | 182 +
...ateLinkResourceProperties.TypeConverter.cs | 148 +
.../MhsmPrivateLinkResourceProperties.cs | 100 +
.../MhsmPrivateLinkResourceProperties.json.cs | 134 +
...teLinkServiceConnectionState.PowerShell.cs | 183 +
...inkServiceConnectionState.TypeConverter.cs | 150 +
.../MhsmPrivateLinkServiceConnectionState.cs | 110 +
...mPrivateLinkServiceConnectionState.json.cs | 113 +
.../MhsmRegionsListResult.PowerShell.cs | 172 +
.../MhsmRegionsListResult.TypeConverter.cs | 147 +
.../api/Models/MhsmRegionsListResult.cs | 74 +
.../api/Models/MhsmRegionsListResult.json.cs | 118 +
.../MhsmVirtualNetworkRule.PowerShell.cs | 166 +
.../MhsmVirtualNetworkRule.TypeConverter.cs | 147 +
.../api/Models/MhsmVirtualNetworkRule.cs | 62 +
.../api/Models/MhsmVirtualNetworkRule.json.cs | 110 +
.../api/Models/MhsmipRule.PowerShell.cs | 166 +
.../api/Models/MhsmipRule.TypeConverter.cs | 146 +
.../generated/api/Models/MhsmipRule.cs | 65 +
.../generated/api/Models/MhsmipRule.json.cs | 108 +
.../api/Models/NetworkRuleSet.PowerShell.cs | 188 +
.../Models/NetworkRuleSet.TypeConverter.cs | 147 +
.../generated/api/Models/NetworkRuleSet.cs | 133 +
.../api/Models/NetworkRuleSet.json.cs | 130 +
.../api/Models/Permissions.PowerShell.cs | 188 +
.../api/Models/Permissions.TypeConverter.cs | 147 +
.../generated/api/Models/Permissions.cs | 122 +
.../generated/api/Models/Permissions.json.cs | 144 +
.../api/Models/PrivateEndpoint.PowerShell.cs | 164 +
.../Models/PrivateEndpoint.TypeConverter.cs | 147 +
.../generated/api/Models/PrivateEndpoint.cs | 57 +
.../api/Models/PrivateEndpoint.json.cs | 111 +
.../PrivateEndpointConnection.PowerShell.cs | 284 +
...PrivateEndpointConnection.TypeConverter.cs | 147 +
.../api/Models/PrivateEndpointConnection.cs | 295 +
.../Models/PrivateEndpointConnection.json.cs | 112 +
...rivateEndpointConnectionItem.PowerShell.cs | 236 +
...ateEndpointConnectionItem.TypeConverter.cs | 147 +
.../Models/PrivateEndpointConnectionItem.cs | 208 +
.../PrivateEndpointConnectionItem.json.cs | 112 +
...EndpointConnectionListResult.PowerShell.cs | 174 +
...pointConnectionListResult.TypeConverter.cs | 149 +
.../PrivateEndpointConnectionListResult.cs | 74 +
...rivateEndpointConnectionListResult.json.cs | 119 +
...EndpointConnectionProperties.PowerShell.cs | 214 +
...pointConnectionProperties.TypeConverter.cs | 149 +
.../PrivateEndpointConnectionProperties.cs | 167 +
...rivateEndpointConnectionProperties.json.cs | 113 +
.../Models/PrivateLinkResource.PowerShell.cs | 228 +
.../PrivateLinkResource.TypeConverter.cs | 147 +
.../api/Models/PrivateLinkResource.cs | 156 +
.../api/Models/PrivateLinkResource.json.cs | 110 +
...rivateLinkResourceListResult.PowerShell.cs | 164 +
...ateLinkResourceListResult.TypeConverter.cs | 147 +
.../Models/PrivateLinkResourceListResult.cs | 54 +
.../PrivateLinkResourceListResult.json.cs | 116 +
...rivateLinkResourceProperties.PowerShell.cs | 180 +
...ateLinkResourceProperties.TypeConverter.cs | 147 +
.../Models/PrivateLinkResourceProperties.cs | 100 +
.../PrivateLinkResourceProperties.json.cs | 134 +
...teLinkServiceConnectionState.PowerShell.cs | 182 +
...inkServiceConnectionState.TypeConverter.cs | 148 +
.../PrivateLinkServiceConnectionState.cs | 110 +
.../PrivateLinkServiceConnectionState.json.cs | 112 +
.../api/Models/Resource.PowerShell.cs | 196 +
.../api/Models/Resource.TypeConverter.cs | 146 +
.../generated/api/Models/Resource.cs | 149 +
.../generated/api/Models/Resource.json.cs | 129 +
.../Models/ResourceListResult.PowerShell.cs | 172 +
.../ResourceListResult.TypeConverter.cs | 147 +
.../api/Models/ResourceListResult.cs | 74 +
.../api/Models/ResourceListResult.json.cs | 118 +
.../api/Models/ResourceTags.PowerShell.cs | 160 +
.../api/Models/ResourceTags.TypeConverter.cs | 147 +
.../generated/api/Models/ResourceTags.cs | 35 +
.../api/Models/ResourceTags.dictionary.cs | 75 +
.../generated/api/Models/ResourceTags.json.cs | 109 +
.../generated/api/Models/Sku.PowerShell.cs | 172 +
.../generated/api/Models/Sku.TypeConverter.cs | 146 +
.../generated/api/Models/Sku.cs | 85 +
.../generated/api/Models/Sku.json.cs | 108 +
.../api/Models/SystemData.PowerShell.cs | 206 +
.../api/Models/SystemData.TypeConverter.cs | 146 +
.../generated/api/Models/SystemData.cs | 160 +
.../generated/api/Models/SystemData.json.cs | 118 +
.../generated/api/Models/Vault.PowerShell.cs | 444 +
.../api/Models/Vault.TypeConverter.cs | 146 +
.../generated/api/Models/Vault.cs | 785 +
.../generated/api/Models/Vault.json.cs | 130 +
.../VaultAccessPolicyParameters.PowerShell.cs | 204 +
...ultAccessPolicyParameters.TypeConverter.cs | 147 +
.../api/Models/VaultAccessPolicyParameters.cs | 168 +
.../VaultAccessPolicyParameters.json.cs | 128 +
.../VaultAccessPolicyProperties.PowerShell.cs | 164 +
...ultAccessPolicyProperties.TypeConverter.cs | 147 +
.../api/Models/VaultAccessPolicyProperties.cs | 63 +
.../VaultAccessPolicyProperties.json.cs | 116 +
...ckNameAvailabilityParameters.PowerShell.cs | 174 +
...ameAvailabilityParameters.TypeConverter.cs | 150 +
.../VaultCheckNameAvailabilityParameters.cs | 77 +
...ultCheckNameAvailabilityParameters.json.cs | 111 +
...aultCreateOrUpdateParameters.PowerShell.cs | 364 +
...tCreateOrUpdateParameters.TypeConverter.cs | 147 +
.../Models/VaultCreateOrUpdateParameters.cs | 594 +
.../VaultCreateOrUpdateParameters.json.cs | 112 +
...CreateOrUpdateParametersTags.PowerShell.cs | 162 +
...ateOrUpdateParametersTags.TypeConverter.cs | 148 +
.../VaultCreateOrUpdateParametersTags.cs | 35 +
...CreateOrUpdateParametersTags.dictionary.cs | 75 +
.../VaultCreateOrUpdateParametersTags.json.cs | 109 +
.../api/Models/VaultListResult.PowerShell.cs | 172 +
.../Models/VaultListResult.TypeConverter.cs | 147 +
.../generated/api/Models/VaultListResult.cs | 74 +
.../api/Models/VaultListResult.json.cs | 118 +
.../Models/VaultPatchParameters.PowerShell.cs | 324 +
.../VaultPatchParameters.TypeConverter.cs | 147 +
.../api/Models/VaultPatchParameters.cs | 492 +
.../api/Models/VaultPatchParameters.json.cs | 110 +
.../VaultPatchParametersTags.PowerShell.cs | 160 +
.../VaultPatchParametersTags.TypeConverter.cs | 147 +
.../api/Models/VaultPatchParametersTags.cs | 35 +
.../VaultPatchParametersTags.dictionary.cs | 75 +
.../Models/VaultPatchParametersTags.json.cs | 109 +
.../Models/VaultPatchProperties.PowerShell.cs | 308 +
.../VaultPatchProperties.TypeConverter.cs | 147 +
.../api/Models/VaultPatchProperties.cs | 509 +
.../api/Models/VaultPatchProperties.json.cs | 140 +
.../api/Models/VaultProperties.PowerShell.cs | 340 +
.../Models/VaultProperties.TypeConverter.cs | 147 +
.../generated/api/Models/VaultProperties.cs | 603 +
.../api/Models/VaultProperties.json.cs | 164 +
.../api/Models/VaultTags.PowerShell.cs | 160 +
.../api/Models/VaultTags.TypeConverter.cs | 146 +
.../generated/api/Models/VaultTags.cs | 35 +
.../api/Models/VaultTags.dictionary.cs | 75 +
.../generated/api/Models/VaultTags.json.cs | 107 +
.../Models/VirtualNetworkRule.PowerShell.cs | 172 +
.../VirtualNetworkRule.TypeConverter.cs | 147 +
.../api/Models/VirtualNetworkRule.cs | 86 +
.../api/Models/VirtualNetworkRule.json.cs | 110 +
.../GetAzKeyVaultManagedHsmRegion_List.cs | 506 +
.../cmdlets/GetAzKeyVaultManagedHsm_Get.cs | 519 +
.../GetAzKeyVaultManagedHsm_GetViaIdentity.cs | 494 +
.../cmdlets/GetAzKeyVaultManagedHsm_List.cs | 508 +
.../cmdlets/GetAzKeyVaultManagedHsm_List1.cs | 493 +
...anagedHsmNameAvailability_CheckExpanded.cs | 463 +
...smNameAvailability_CheckViaJsonFilePath.cs | 466 +
...dHsmNameAvailability_CheckViaJsonString.cs | 463 +
...zKeyVaultNameAvailability_CheckExpanded.cs | 463 +
...ltNameAvailability_CheckViaJsonFilePath.cs | 465 +
...aultNameAvailability_CheckViaJsonString.cs | 463 +
.../UpdateAzKeyVaultManagedHsm_Update.cs | 575 +
...dateAzKeyVaultManagedHsm_UpdateExpanded.cs | 747 +
...eAzKeyVaultManagedHsm_UpdateViaIdentity.cs | 550 +
...ultManagedHsm_UpdateViaIdentityExpanded.cs | 722 +
...eyVaultManagedHsm_UpdateViaJsonFilePath.cs | 577 +
...zKeyVaultManagedHsm_UpdateViaJsonString.cs | 575 +
.../generated/runtime/AsyncCommandRuntime.cs | 832 +
.../generated/runtime/AsyncJob.cs | 270 +
.../runtime/AsyncOperationResponse.cs | 176 +
.../Attributes/ExternalDocsAttribute.cs | 30 +
.../PSArgumentCompleterAttribute.cs | 52 +
.../BuildTime/Cmdlets/ExportCmdletSurface.cs | 113 +
.../BuildTime/Cmdlets/ExportExampleStub.cs | 74 +
.../BuildTime/Cmdlets/ExportFormatPs1xml.cs | 103 +
.../BuildTime/Cmdlets/ExportHelpMarkdown.cs | 56 +
.../BuildTime/Cmdlets/ExportModelSurface.cs | 117 +
.../BuildTime/Cmdlets/ExportProxyCmdlet.cs | 180 +
.../runtime/BuildTime/Cmdlets/ExportPsd1.cs | 193 +
.../BuildTime/Cmdlets/ExportTestStub.cs | 148 +
.../BuildTime/Cmdlets/GetCommonParameter.cs | 52 +
.../BuildTime/Cmdlets/GetModuleGuid.cs | 31 +
.../BuildTime/Cmdlets/GetScriptCmdlet.cs | 54 +
.../runtime/BuildTime/CollectionExtensions.cs | 20 +
.../runtime/BuildTime/MarkdownRenderer.cs | 122 +
.../runtime/BuildTime/Models/PsFormatTypes.cs | 138 +
.../BuildTime/Models/PsHelpMarkdownOutputs.cs | 199 +
.../runtime/BuildTime/Models/PsHelpTypes.cs | 202 +
.../BuildTime/Models/PsMarkdownTypes.cs | 329 +
.../BuildTime/Models/PsProxyOutputs.cs | 634 +
.../runtime/BuildTime/Models/PsProxyTypes.cs | 546 +
.../runtime/BuildTime/PsAttributes.cs | 131 +
.../runtime/BuildTime/PsExtensions.cs | 176 +
.../generated/runtime/BuildTime/PsHelpers.cs | 105 +
.../runtime/BuildTime/StringExtensions.cs | 24 +
.../runtime/BuildTime/XmlExtensions.cs | 28 +
.../generated/runtime/CmdInfoHandler.cs | 40 +
.../generated/runtime/Context.cs | 33 +
.../Conversions/ConversionException.cs | 17 +
.../runtime/Conversions/IJsonConverter.cs | 13 +
.../Conversions/Instances/BinaryConverter.cs | 24 +
.../Conversions/Instances/BooleanConverter.cs | 13 +
.../Instances/DateTimeConverter.cs | 18 +
.../Instances/DateTimeOffsetConverter.cs | 15 +
.../Conversions/Instances/DecimalConverter.cs | 16 +
.../Conversions/Instances/DoubleConverter.cs | 13 +
.../Conversions/Instances/EnumConverter.cs | 30 +
.../Conversions/Instances/GuidConverter.cs | 15 +
.../Instances/HashSet'1Converter.cs | 27 +
.../Conversions/Instances/Int16Converter.cs | 13 +
.../Conversions/Instances/Int32Converter.cs | 13 +
.../Conversions/Instances/Int64Converter.cs | 13 +
.../Instances/JsonArrayConverter.cs | 13 +
.../Instances/JsonObjectConverter.cs | 13 +
.../Conversions/Instances/SingleConverter.cs | 13 +
.../Conversions/Instances/StringConverter.cs | 13 +
.../Instances/TimeSpanConverter.cs | 15 +
.../Conversions/Instances/UInt16Converter.cs | 13 +
.../Conversions/Instances/UInt32Converter.cs | 13 +
.../Conversions/Instances/UInt64Converter.cs | 13 +
.../Conversions/Instances/UriConverter.cs | 15 +
.../runtime/Conversions/JsonConverter.cs | 21 +
.../Conversions/JsonConverterAttribute.cs | 18 +
.../Conversions/JsonConverterFactory.cs | 91 +
.../Conversions/StringLikeConverter.cs | 45 +
.../Customizations/IJsonSerializable.cs | 263 +
.../runtime/Customizations/JsonArray.cs | 13 +
.../runtime/Customizations/JsonBoolean.cs | 16 +
.../runtime/Customizations/JsonNode.cs | 21 +
.../runtime/Customizations/JsonNumber.cs | 78 +
.../runtime/Customizations/JsonObject.cs | 183 +
.../runtime/Customizations/JsonString.cs | 34 +
.../runtime/Customizations/XNodeArray.cs | 44 +
.../generated/runtime/Debugging.cs | 28 +
.../generated/runtime/DictionaryExtensions.cs | 33 +
.../generated/runtime/EventData.cs | 78 +
.../generated/runtime/EventDataExtensions.cs | 94 +
.../generated/runtime/EventListener.cs | 247 +
.../generated/runtime/Events.cs | 27 +
.../generated/runtime/EventsExtensions.cs | 27 +
.../generated/runtime/Extensions.cs | 117 +
.../Extensions/StringBuilderExtensions.cs | 23 +
.../Helpers/Extensions/TypeExtensions.cs | 61 +
.../generated/runtime/Helpers/Seperator.cs | 11 +
.../generated/runtime/Helpers/TypeDetails.cs | 116 +
.../generated/runtime/Helpers/XHelper.cs | 75 +
.../generated/runtime/HttpPipeline.cs | 88 +
.../generated/runtime/HttpPipelineMocking.ps1 | 110 +
.../generated/runtime/IAssociativeArray.cs | 24 +
.../generated/runtime/IHeaderSerializable.cs | 14 +
.../generated/runtime/ISendAsync.cs | 413 +
.../generated/runtime/InfoAttribute.cs | 38 +
.../generated/runtime/InputHandler.cs | 22 +
.../generated/runtime/Iso/IsoDate.cs | 214 +
.../generated/runtime/JsonType.cs | 18 +
.../generated/runtime/MessageAttribute.cs | 331 +
.../runtime/MessageAttributeHelper.cs | 165 +
.../generated/runtime/Method.cs | 19 +
.../generated/runtime/Models/JsonMember.cs | 83 +
.../generated/runtime/Models/JsonModel.cs | 89 +
.../runtime/Models/JsonModelCache.cs | 19 +
.../runtime/Nodes/Collections/JsonArray.cs | 65 +
.../Nodes/Collections/XImmutableArray.cs | 62 +
.../runtime/Nodes/Collections/XList.cs | 64 +
.../runtime/Nodes/Collections/XNodeArray.cs | 73 +
.../runtime/Nodes/Collections/XSet.cs | 60 +
.../generated/runtime/Nodes/JsonBoolean.cs | 42 +
.../generated/runtime/Nodes/JsonDate.cs | 173 +
.../generated/runtime/Nodes/JsonNode.cs | 250 +
.../generated/runtime/Nodes/JsonNumber.cs | 109 +
.../generated/runtime/Nodes/JsonObject.cs | 172 +
.../generated/runtime/Nodes/JsonString.cs | 42 +
.../generated/runtime/Nodes/XBinary.cs | 40 +
.../generated/runtime/Nodes/XNull.cs | 15 +
.../Parser/Exceptions/ParseException.cs | 24 +
.../generated/runtime/Parser/JsonParser.cs | 180 +
.../generated/runtime/Parser/JsonToken.cs | 66 +
.../generated/runtime/Parser/JsonTokenizer.cs | 177 +
.../generated/runtime/Parser/Location.cs | 43 +
.../runtime/Parser/Readers/SourceReader.cs | 130 +
.../generated/runtime/Parser/TokenReader.cs | 39 +
.../generated/runtime/PipelineMocking.cs | 262 +
.../runtime/Properties/Resources.Designer.cs | 5646 +++++++
.../runtime/Properties/Resources.resx | 1744 +++
.../generated/runtime/Response.cs | 27 +
.../runtime/Serialization/JsonSerializer.cs | 350 +
.../Serialization/PropertyTransformation.cs | 21 +
.../Serialization/SerializationOptions.cs | 65 +
.../generated/runtime/SerializationMode.cs | 18 +
.../runtime/TypeConverterExtensions.cs | 261 +
.../runtime/UndeclaredResponseException.cs | 112 +
.../generated/runtime/Writers/JsonWriter.cs | 223 +
.../generated/runtime/delegates.cs | 23 +
src/KeyVault/KeyVault.Autorest/how-to.md | 58 +
.../internal/Az.KeyVault.internal.psm1 | 38 +
.../internal/Get-AzKeyVaultManagedHsm.ps1 | 191 +
.../internal/ProxyCmdletDefinitions.ps1 | 547 +
.../KeyVault.Autorest/internal/README.md | 14 +
.../internal/Update-AzKeyVaultManagedHsm.ps1 | 371 +
.../KeyVault.Autorest/pack-module.ps1 | 17 +
src/KeyVault/KeyVault.Autorest/run-module.ps1 | 62 +
.../KeyVault.Autorest/test-module.ps1 | 94 +
...-AzKeyVaultManagedHsmRegion.Recording.json | 3956 +++++
.../Add-AzKeyVaultManagedHsmRegion.Tests.ps1 | 22 +
...-AzKeyVaultManagedHsmRegion.Recording.json | 46 +
.../Get-AzKeyVaultManagedHsmRegion.Tests.ps1 | 22 +
src/KeyVault/KeyVault.Autorest/test/README.md | 17 +
...-AzKeyVaultManagedHsmRegion.Recording.json | 216 +
...emove-AzKeyVaultManagedHsmRegion.Tests.ps1 | 22 +
...tManagedHsmNameAvailability.Recording.json | 80 +
...yVaultManagedHsmNameAvailability.Tests.ps1 | 27 +
...-AzKeyVaultNameAvailability.Recording.json | 41 +
.../Test-AzKeyVaultNameAvailability.Tests.ps1 | 22 +
src/KeyVault/KeyVault.Autorest/test/env.json | 6 +
.../KeyVault.Autorest/test/loadEnv.ps1 | 29 +
src/KeyVault/KeyVault.Autorest/test/utils.ps1 | 34 +
.../utils/Unprotect-SecureString.ps1 | 16 +
src/KeyVault/KeyVault.sln | 8 +-
src/KeyVault/KeyVault/Az.KeyVault.psd1 | 26 +-
.../help/Add-AzKeyVaultCertificate.md | 2 +
.../KeyVault/help/Add-AzKeyVaultKey.md | 27 +-
.../help/Add-AzKeyVaultManagedHsmRegion.md | 175 +
src/KeyVault/KeyVault/help/Az.KeyVault.md | 21 +
.../help/Get-AzKeyVaultManagedHsmRegion.md | 114 +
.../help/Get-AzKeyVaultRoleDefinition.md | 2 +
.../KeyVault/help/Get-AzKeyVaultSetting.md | 19 +-
.../help/Invoke-AzKeyVaultKeyOperation.md | 18 +-
.../help/New-AzKeyVaultCertificatePolicy.md | 2 +
.../help/Remove-AzKeyVaultManagedHsmRegion.md | 190 +
.../help/Set-AzKeyVaultAccessPolicy.md | 2 +
...st-AzKeyVaultManagedHsmNameAvailability.md | 187 +
.../help/Test-AzKeyVaultNameAvailability.md | 187 +
.../help/Update-AzKeyVaultCertificate.md | 2 +
.../Update-AzKeyVaultManagedStorageAccount.md | 2 +
.../help/Update-AzKeyVaultNetworkRuleSet.md | 2 +
.../KeyVault/help/Update-AzKeyVaultSetting.md | 9 +-
504 files changed, 98689 insertions(+), 45 deletions(-)
create mode 100644 src/KeyVault/KeyVault.Autorest/Az.KeyVault.csproj
create mode 100644 src/KeyVault/KeyVault.Autorest/Az.KeyVault.format.ps1xml
create mode 100644 src/KeyVault/KeyVault.Autorest/Az.KeyVault.psd1
create mode 100644 src/KeyVault/KeyVault.Autorest/Az.KeyVault.psm1
create mode 100644 src/KeyVault/KeyVault.Autorest/Properties/AssemblyInfo.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/README.md
create mode 100644 src/KeyVault/KeyVault.Autorest/build-module.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/check-dependencies.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/create-model-cmdlets.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/custom/Add-AzKeyVaultManagedHsmRegion.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/custom/Az.KeyVault.custom.psm1
create mode 100644 src/KeyVault/KeyVault.Autorest/custom/ManagedHsm.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/custom/README.md
create mode 100644 src/KeyVault/KeyVault.Autorest/custom/Remove-AzKeyVaultManagedHsmRegion.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/docs/Add-AzKeyVaultManagedHsmRegion.md
create mode 100644 src/KeyVault/KeyVault.Autorest/docs/Az.KeyVault.md
create mode 100644 src/KeyVault/KeyVault.Autorest/docs/Get-AzKeyVaultManagedHsmRegion.md
create mode 100644 src/KeyVault/KeyVault.Autorest/docs/README.md
create mode 100644 src/KeyVault/KeyVault.Autorest/docs/Remove-AzKeyVaultManagedHsmRegion.md
create mode 100644 src/KeyVault/KeyVault.Autorest/docs/Test-AzKeyVaultManagedHsmNameAvailability.md
create mode 100644 src/KeyVault/KeyVault.Autorest/docs/Test-AzKeyVaultNameAvailability.md
create mode 100644 src/KeyVault/KeyVault.Autorest/examples/Add-AzKeyVaultManagedHsmRegion.md
create mode 100644 src/KeyVault/KeyVault.Autorest/examples/Get-AzKeyVaultManagedHsmRegion.md
create mode 100644 src/KeyVault/KeyVault.Autorest/examples/Remove-AzKeyVaultManagedHsmRegion.md
create mode 100644 src/KeyVault/KeyVault.Autorest/examples/Test-AzKeyVaultManagedHsmNameAvailability.md
create mode 100644 src/KeyVault/KeyVault.Autorest/examples/Test-AzKeyVaultNameAvailability.md
create mode 100644 src/KeyVault/KeyVault.Autorest/export-surface.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/exports/Add-AzKeyVaultManagedHsmRegion.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/exports/Get-AzKeyVaultManagedHsmRegion.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/exports/ProxyCmdletDefinitions.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/exports/README.md
create mode 100644 src/KeyVault/KeyVault.Autorest/exports/Remove-AzKeyVaultManagedHsmRegion.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/exports/Test-AzKeyVaultManagedHsmNameAvailability.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/exports/Test-AzKeyVaultNameAvailability.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/generate-help.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/generate-info.json
create mode 100644 src/KeyVault/KeyVault.Autorest/generate-portal-ux.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/Module.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/KeyVault.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/AccessPolicyEntry.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/AccessPolicyEntry.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/AccessPolicyEntry.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/AccessPolicyEntry.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CheckMhsmNameAvailabilityParameters.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CheckMhsmNameAvailabilityParameters.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CheckMhsmNameAvailabilityParameters.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CheckMhsmNameAvailabilityParameters.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CheckMhsmNameAvailabilityResult.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CheckMhsmNameAvailabilityResult.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CheckMhsmNameAvailabilityResult.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CheckMhsmNameAvailabilityResult.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CheckNameAvailabilityResult.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CheckNameAvailabilityResult.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CheckNameAvailabilityResult.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CheckNameAvailabilityResult.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CloudError.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CloudError.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CloudError.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CloudError.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CloudErrorBody.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CloudErrorBody.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CloudErrorBody.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/CloudErrorBody.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsm.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsm.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsm.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsm.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsmListResult.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsmListResult.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsmListResult.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsmListResult.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsmProperties.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsmProperties.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsmProperties.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsmProperties.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsmPropertiesTags.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsmPropertiesTags.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsmPropertiesTags.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsmPropertiesTags.dictionary.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedManagedHsmPropertiesTags.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVault.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVault.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVault.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVault.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVaultListResult.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVaultListResult.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVaultListResult.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVaultListResult.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVaultProperties.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVaultProperties.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVaultProperties.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVaultProperties.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVaultPropertiesTags.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVaultPropertiesTags.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVaultPropertiesTags.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVaultPropertiesTags.dictionary.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/DeletedVaultPropertiesTags.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Error.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Error.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Error.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Error.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/IPRule.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/IPRule.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/IPRule.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/IPRule.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/KeyVaultIdentity.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/KeyVaultIdentity.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/KeyVaultIdentity.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/KeyVaultIdentity.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsm.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsm.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsm.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsm.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmError.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmError.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmError.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmError.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmListResult.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmListResult.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmListResult.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmListResult.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmProperties.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmProperties.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmProperties.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmProperties.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmResource.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmResource.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmResource.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmResource.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmResourceTags.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmResourceTags.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmResourceTags.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmResourceTags.dictionary.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmResourceTags.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmSecurityDomainProperties.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmSecurityDomainProperties.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmSecurityDomainProperties.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmSecurityDomainProperties.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmSku.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmSku.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmSku.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ManagedHsmSku.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmGeoReplicatedRegion.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmGeoReplicatedRegion.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmGeoReplicatedRegion.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmGeoReplicatedRegion.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmNetworkRuleSet.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmNetworkRuleSet.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmNetworkRuleSet.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmNetworkRuleSet.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpoint.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpoint.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpoint.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpoint.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnection.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnection.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnection.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnection.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnectionItem.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnectionItem.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnectionItem.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnectionItem.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnectionProperties.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnectionProperties.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnectionProperties.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnectionProperties.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnectionsListResult.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnectionsListResult.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnectionsListResult.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateEndpointConnectionsListResult.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkResource.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkResource.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkResource.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkResource.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkResourceListResult.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkResourceListResult.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkResourceListResult.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkResourceListResult.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkResourceProperties.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkResourceProperties.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkResourceProperties.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkResourceProperties.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkServiceConnectionState.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkServiceConnectionState.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkServiceConnectionState.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmPrivateLinkServiceConnectionState.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmRegionsListResult.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmRegionsListResult.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmRegionsListResult.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmRegionsListResult.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmVirtualNetworkRule.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmVirtualNetworkRule.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmVirtualNetworkRule.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmVirtualNetworkRule.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmipRule.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmipRule.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmipRule.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/MhsmipRule.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/NetworkRuleSet.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/NetworkRuleSet.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/NetworkRuleSet.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/NetworkRuleSet.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Permissions.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Permissions.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Permissions.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Permissions.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpoint.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpoint.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpoint.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpoint.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnection.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnection.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnection.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnection.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnectionItem.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnectionItem.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnectionItem.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnectionItem.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnectionListResult.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkResource.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkResource.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkResource.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkResource.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkResourceListResult.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkResourceListResult.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkResourceListResult.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkResourceListResult.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkResourceProperties.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkResourceProperties.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkResourceProperties.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkResourceProperties.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Resource.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Resource.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Resource.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Resource.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ResourceListResult.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ResourceListResult.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ResourceListResult.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ResourceListResult.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ResourceTags.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ResourceTags.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ResourceTags.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ResourceTags.dictionary.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/ResourceTags.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Sku.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Sku.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Sku.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Sku.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/SystemData.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/SystemData.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/SystemData.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/SystemData.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Vault.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Vault.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Vault.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/Vault.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultAccessPolicyParameters.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultAccessPolicyParameters.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultAccessPolicyParameters.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultAccessPolicyParameters.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultAccessPolicyProperties.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultAccessPolicyProperties.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultAccessPolicyProperties.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultAccessPolicyProperties.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultCheckNameAvailabilityParameters.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultCheckNameAvailabilityParameters.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultCheckNameAvailabilityParameters.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultCheckNameAvailabilityParameters.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultCreateOrUpdateParameters.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultCreateOrUpdateParameters.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultCreateOrUpdateParameters.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultCreateOrUpdateParameters.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultCreateOrUpdateParametersTags.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultCreateOrUpdateParametersTags.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultCreateOrUpdateParametersTags.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultCreateOrUpdateParametersTags.dictionary.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultCreateOrUpdateParametersTags.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultListResult.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultListResult.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultListResult.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultListResult.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultPatchParameters.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultPatchParameters.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultPatchParameters.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultPatchParameters.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultPatchParametersTags.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultPatchParametersTags.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultPatchParametersTags.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultPatchParametersTags.dictionary.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultPatchParametersTags.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultPatchProperties.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultPatchProperties.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultPatchProperties.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultPatchProperties.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultProperties.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultProperties.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultProperties.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultProperties.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultTags.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultTags.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultTags.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultTags.dictionary.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VaultTags.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VirtualNetworkRule.PowerShell.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VirtualNetworkRule.TypeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VirtualNetworkRule.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/api/Models/VirtualNetworkRule.json.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/GetAzKeyVaultManagedHsmRegion_List.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/GetAzKeyVaultManagedHsm_Get.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/GetAzKeyVaultManagedHsm_GetViaIdentity.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/GetAzKeyVaultManagedHsm_List.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/GetAzKeyVaultManagedHsm_List1.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/TestAzKeyVaultManagedHsmNameAvailability_CheckExpanded.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/TestAzKeyVaultManagedHsmNameAvailability_CheckViaJsonFilePath.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/TestAzKeyVaultManagedHsmNameAvailability_CheckViaJsonString.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/TestAzKeyVaultNameAvailability_CheckExpanded.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/TestAzKeyVaultNameAvailability_CheckViaJsonFilePath.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/TestAzKeyVaultNameAvailability_CheckViaJsonString.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/UpdateAzKeyVaultManagedHsm_Update.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/UpdateAzKeyVaultManagedHsm_UpdateExpanded.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/UpdateAzKeyVaultManagedHsm_UpdateViaIdentity.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/UpdateAzKeyVaultManagedHsm_UpdateViaIdentityExpanded.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/UpdateAzKeyVaultManagedHsm_UpdateViaJsonFilePath.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/cmdlets/UpdateAzKeyVaultManagedHsm_UpdateViaJsonString.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/AsyncCommandRuntime.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/AsyncJob.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/AsyncOperationResponse.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/CollectionExtensions.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Models/PsFormatTypes.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/PsAttributes.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/PsExtensions.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/PsHelpers.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/StringExtensions.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/BuildTime/XmlExtensions.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/CmdInfoHandler.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Context.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/ConversionException.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/IJsonConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/BinaryConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/BooleanConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/DateTimeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/DecimalConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/DoubleConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/EnumConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/GuidConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/HashSet'1Converter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/Int16Converter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/Int32Converter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/Int64Converter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/JsonArrayConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/JsonObjectConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/SingleConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/StringConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/TimeSpanConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/UInt16Converter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/UInt32Converter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/UInt64Converter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/Instances/UriConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/JsonConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/JsonConverterAttribute.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/JsonConverterFactory.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Conversions/StringLikeConverter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Customizations/IJsonSerializable.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Customizations/JsonArray.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Customizations/JsonBoolean.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Customizations/JsonNode.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Customizations/JsonNumber.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Customizations/JsonObject.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Customizations/JsonString.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Customizations/XNodeArray.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Debugging.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/DictionaryExtensions.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/EventData.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/EventDataExtensions.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/EventListener.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Events.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/EventsExtensions.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Extensions.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Helpers/Extensions/TypeExtensions.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Helpers/Seperator.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Helpers/TypeDetails.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Helpers/XHelper.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/HttpPipeline.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/HttpPipelineMocking.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/IAssociativeArray.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/IHeaderSerializable.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/ISendAsync.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/InfoAttribute.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/InputHandler.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Iso/IsoDate.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/JsonType.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/MessageAttribute.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/MessageAttributeHelper.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Method.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Models/JsonMember.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Models/JsonModel.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Models/JsonModelCache.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Nodes/Collections/JsonArray.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Nodes/Collections/XImmutableArray.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Nodes/Collections/XList.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Nodes/Collections/XSet.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Nodes/JsonBoolean.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Nodes/JsonDate.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Nodes/JsonNode.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Nodes/JsonNumber.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Nodes/JsonObject.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Nodes/JsonString.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Nodes/XBinary.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Nodes/XNull.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Parser/Exceptions/ParseException.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Parser/JsonParser.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Parser/JsonToken.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Parser/JsonTokenizer.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Parser/Location.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Parser/Readers/SourceReader.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Parser/TokenReader.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/PipelineMocking.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Properties/Resources.Designer.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Properties/Resources.resx
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Response.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Serialization/JsonSerializer.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Serialization/PropertyTransformation.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Serialization/SerializationOptions.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/SerializationMode.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/TypeConverterExtensions.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/UndeclaredResponseException.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/Writers/JsonWriter.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/generated/runtime/delegates.cs
create mode 100644 src/KeyVault/KeyVault.Autorest/how-to.md
create mode 100644 src/KeyVault/KeyVault.Autorest/internal/Az.KeyVault.internal.psm1
create mode 100644 src/KeyVault/KeyVault.Autorest/internal/Get-AzKeyVaultManagedHsm.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/internal/ProxyCmdletDefinitions.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/internal/README.md
create mode 100644 src/KeyVault/KeyVault.Autorest/internal/Update-AzKeyVaultManagedHsm.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/pack-module.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/run-module.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/test-module.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/test/Add-AzKeyVaultManagedHsmRegion.Recording.json
create mode 100644 src/KeyVault/KeyVault.Autorest/test/Add-AzKeyVaultManagedHsmRegion.Tests.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/test/Get-AzKeyVaultManagedHsmRegion.Recording.json
create mode 100644 src/KeyVault/KeyVault.Autorest/test/Get-AzKeyVaultManagedHsmRegion.Tests.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/test/README.md
create mode 100644 src/KeyVault/KeyVault.Autorest/test/Remove-AzKeyVaultManagedHsmRegion.Recording.json
create mode 100644 src/KeyVault/KeyVault.Autorest/test/Remove-AzKeyVaultManagedHsmRegion.Tests.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/test/Test-AzKeyVaultManagedHsmNameAvailability.Recording.json
create mode 100644 src/KeyVault/KeyVault.Autorest/test/Test-AzKeyVaultManagedHsmNameAvailability.Tests.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/test/Test-AzKeyVaultNameAvailability.Recording.json
create mode 100644 src/KeyVault/KeyVault.Autorest/test/Test-AzKeyVaultNameAvailability.Tests.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/test/env.json
create mode 100644 src/KeyVault/KeyVault.Autorest/test/loadEnv.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/test/utils.ps1
create mode 100644 src/KeyVault/KeyVault.Autorest/utils/Unprotect-SecureString.ps1
create mode 100644 src/KeyVault/KeyVault/help/Add-AzKeyVaultManagedHsmRegion.md
create mode 100644 src/KeyVault/KeyVault/help/Get-AzKeyVaultManagedHsmRegion.md
create mode 100644 src/KeyVault/KeyVault/help/Remove-AzKeyVaultManagedHsmRegion.md
create mode 100644 src/KeyVault/KeyVault/help/Test-AzKeyVaultManagedHsmNameAvailability.md
create mode 100644 src/KeyVault/KeyVault/help/Test-AzKeyVaultNameAvailability.md
diff --git a/src/KeyVault/KeyVault.Autorest/Az.KeyVault.csproj b/src/KeyVault/KeyVault.Autorest/Az.KeyVault.csproj
new file mode 100644
index 000000000000..fcdf859b1579
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/Az.KeyVault.csproj
@@ -0,0 +1,10 @@
+
+
+ KeyVault
+ KeyVault
+ KeyVault.Autorest
+
+
+
+
+
diff --git a/src/KeyVault/KeyVault.Autorest/Az.KeyVault.format.ps1xml b/src/KeyVault/KeyVault.Autorest/Az.KeyVault.format.ps1xml
new file mode 100644
index 000000000000..339276fe5dc2
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/Az.KeyVault.format.ps1xml
@@ -0,0 +1,1965 @@
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsm
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsm#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+ SkuFamily
+
+
+ SkuName
+
+
+ SystemDataCreatedAt
+
+
+ SystemDataCreatedBy
+
+
+ SystemDataCreatedByType
+
+
+ SystemDataLastModifiedAt
+
+
+ SystemDataLastModifiedBy
+
+
+ SystemDataLastModifiedByType
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.AccessPolicyEntry
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.AccessPolicyEntry#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ApplicationId
+
+
+ ObjectId
+
+
+ TenantId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.CheckMhsmNameAvailabilityParameters
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.CheckMhsmNameAvailabilityParameters#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.CheckMhsmNameAvailabilityResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.CheckMhsmNameAvailabilityResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Message
+
+
+ NameAvailable
+
+
+ Reason
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.CheckNameAvailabilityResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.CheckNameAvailabilityResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Message
+
+
+ NameAvailable
+
+
+ Reason
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.CloudErrorBody
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.CloudErrorBody#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Message
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedManagedHsm
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedManagedHsm#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedManagedHsmListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedManagedHsmListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedManagedHsmProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedManagedHsmProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DeletionDate
+
+
+ Location
+
+
+ MhsmId
+
+
+ PurgeProtectionEnabled
+
+
+ ScheduledPurgeDate
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedManagedHsmPropertiesTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedManagedHsmPropertiesTags#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedVault
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedVault#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedVaultListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedVaultListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedVaultProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedVaultProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DeletionDate
+
+
+ Location
+
+
+ PurgeProtectionEnabled
+
+
+ ScheduledPurgeDate
+
+
+ VaultId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedVaultPropertiesTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedVaultPropertiesTags#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.Error
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.Error#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Message
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IPRule
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IPRule#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Value
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.KeyVaultIdentity
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.KeyVaultIdentity#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+ OperationKind
+
+
+ PrivateEndpointConnectionName
+
+
+ ResourceGroupName
+
+
+ SubscriptionId
+
+
+ VaultName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreateMode
+
+
+ EnablePurgeProtection
+
+
+ EnableSoftDelete
+
+
+ HsmUri
+
+
+ ProvisioningState
+
+
+ PublicNetworkAccess
+
+
+ ScheduledPurgeDate
+
+
+ SoftDeleteRetentionInDay
+
+
+ StatusMessage
+
+
+ TenantId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmResource
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmResource#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmResourceTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmResourceTags#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmSecurityDomainProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmSecurityDomainProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ActivationStatus
+
+
+ ActivationStatusMessage
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmSku
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmSku#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Family
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmGeoReplicatedRegion
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmGeoReplicatedRegion#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IsPrimary
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmipRule
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmipRule#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Value
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmNetworkRuleSet
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmNetworkRuleSet#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Bypass
+
+
+ DefaultAction
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateEndpointConnection
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateEndpointConnection#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+ SkuFamily
+
+
+ SkuName
+
+
+ SystemDataCreatedAt
+
+
+ SystemDataCreatedBy
+
+
+ SystemDataCreatedByType
+
+
+ SystemDataLastModifiedAt
+
+
+ SystemDataLastModifiedBy
+
+
+ SystemDataLastModifiedByType
+
+
+ AzureAsyncOperation
+
+
+ Etag
+
+
+ ResourceGroupName
+
+
+ RetryAfter
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateEndpointConnectionItem
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateEndpointConnectionItem#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateEndpointConnectionProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateEndpointConnectionProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateEndpointConnectionsListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateEndpointConnectionsListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateLinkResource
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateLinkResource#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+ SkuFamily
+
+
+ SkuName
+
+
+ SystemDataCreatedAt
+
+
+ SystemDataCreatedBy
+
+
+ SystemDataCreatedByType
+
+
+ SystemDataLastModifiedAt
+
+
+ SystemDataLastModifiedBy
+
+
+ SystemDataLastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateLinkResourceProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateLinkResourceProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ GroupId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateLinkServiceConnectionState
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateLinkServiceConnectionState#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ActionsRequired
+
+
+ Description
+
+
+ Status
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmRegionsListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmRegionsListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.NetworkRuleSet
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.NetworkRuleSet#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Bypass
+
+
+ DefaultAction
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.PrivateEndpointConnection
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.PrivateEndpointConnection#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+ AzureAsyncOperation
+
+
+ Etag
+
+
+ ResourceGroupName
+
+
+ RetryAfter
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.PrivateEndpointConnectionItem
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.PrivateEndpointConnectionItem#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.PrivateEndpointConnectionListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.PrivateEndpointConnectionListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.PrivateEndpointConnectionProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.PrivateEndpointConnectionProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.PrivateLinkResource
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.PrivateLinkResource#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.PrivateLinkResourceProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.PrivateLinkResourceProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ GroupId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.PrivateLinkServiceConnectionState
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.PrivateLinkServiceConnectionState#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ActionsRequired
+
+
+ Description
+
+
+ Status
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.Resource
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.Resource#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ResourceListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ResourceListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ResourceTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ResourceTags#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.Sku
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.Sku#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Family
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.SystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.SystemData#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.Vault
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.Vault#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultAccessPolicyParameters
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultAccessPolicyParameters#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultCheckNameAvailabilityParameters
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultCheckNameAvailabilityParameters#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultCreateOrUpdateParameters
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultCreateOrUpdateParameters#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultCreateOrUpdateParametersTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultCreateOrUpdateParametersTags#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultListResult#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultPatchParametersTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultPatchParametersTags#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultPatchProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultPatchProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreateMode
+
+
+ EnablePurgeProtection
+
+
+ EnableRbacAuthorization
+
+
+ EnableSoftDelete
+
+
+ EnabledForDeployment
+
+
+ EnabledForDiskEncryption
+
+
+ EnabledForTemplateDeployment
+
+
+ PublicNetworkAccess
+
+
+ SoftDeleteRetentionInDay
+
+
+ TenantId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultProperties#Multiple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreateMode
+
+
+ EnablePurgeProtection
+
+
+ EnableRbacAuthorization
+
+
+ EnableSoftDelete
+
+
+ EnabledForDeployment
+
+
+ EnabledForDiskEncryption
+
+
+ EnabledForTemplateDeployment
+
+
+ HsmPoolResourceId
+
+
+ ProvisioningState
+
+
+ PublicNetworkAccess
+
+
+ SoftDeleteRetentionInDay
+
+
+ TenantId
+
+
+ VaultUri
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VaultTags#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VirtualNetworkRule
+
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.VirtualNetworkRule#Multiple
+
+
+
+
+
+
+
+
+
+
+
+ IgnoreMissingVnetServiceEndpoint
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/KeyVault/KeyVault.Autorest/Az.KeyVault.psd1 b/src/KeyVault/KeyVault.Autorest/Az.KeyVault.psd1
new file mode 100644
index 000000000000..03f45831c409
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/Az.KeyVault.psd1
@@ -0,0 +1,23 @@
+@{
+ GUID = 'e0f28b9c-6a6b-4b66-833e-c01780a5577b'
+ RootModule = './Az.KeyVault.psm1'
+ ModuleVersion = '0.1.0'
+ CompatiblePSEditions = 'Core', 'Desktop'
+ Author = 'Microsoft Corporation'
+ CompanyName = 'Microsoft Corporation'
+ Copyright = 'Microsoft Corporation. All rights reserved.'
+ Description = 'Microsoft Azure PowerShell: KeyVault cmdlets'
+ PowerShellVersion = '5.1'
+ DotNetFrameworkVersion = '4.7.2'
+ RequiredAssemblies = './bin/Az.KeyVault.private.dll'
+ FormatsToProcess = './Az.KeyVault.format.ps1xml'
+ FunctionsToExport = 'Add-AzKeyVaultManagedHsmRegion', 'Get-AzKeyVaultManagedHsmRegion', 'Remove-AzKeyVaultManagedHsmRegion', 'Test-AzKeyVaultManagedHsmNameAvailability', 'Test-AzKeyVaultNameAvailability'
+ PrivateData = @{
+ PSData = @{
+ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'KeyVault'
+ LicenseUri = 'https://aka.ms/azps-license'
+ ProjectUri = 'https://github.com/Azure/azure-powershell'
+ ReleaseNotes = ''
+ }
+ }
+}
diff --git a/src/KeyVault/KeyVault.Autorest/Az.KeyVault.psm1 b/src/KeyVault/KeyVault.Autorest/Az.KeyVault.psm1
new file mode 100644
index 000000000000..0d7bf2a7c642
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/Az.KeyVault.psm1
@@ -0,0 +1,115 @@
+# region Generated
+ # ----------------------------------------------------------------------------------
+ # Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+ # ----------------------------------------------------------------------------------
+ # Load required Az.Accounts module
+ $accountsName = 'Az.Accounts'
+ $accountsModule = Get-Module -Name $accountsName
+ if(-not $accountsModule) {
+ $localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
+ if(Test-Path -Path $localAccountsPath) {
+ $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
+ if($localAccounts) {
+ $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru
+ }
+ }
+ if(-not $accountsModule) {
+ $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0
+ if($hasAdequateVersion) {
+ $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru
+ }
+ }
+ }
+
+ if(-not $accountsModule) {
+ Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://learn.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
+ } elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) {
+ Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
+ }
+ Write-Information "Loaded Module '$($accountsModule.Name)'"
+
+ # Load the private module dll
+ $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.KeyVault.private.dll')
+
+ # Get the private module's instance
+ $instance = [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Module]::Instance
+
+ # Ask for the shared functionality table
+ $VTable = Register-AzModule
+
+ # Tweaks the pipeline on module load
+ $instance.OnModuleLoad = $VTable.OnModuleLoad
+
+ # Following two delegates are added for telemetry
+ $instance.GetTelemetryId = $VTable.GetTelemetryId
+ $instance.Telemetry = $VTable.Telemetry
+
+
+ # Tweaks the pipeline per call
+ $instance.OnNewRequest = $VTable.OnNewRequest
+
+ # Gets shared parameter values
+ $instance.GetParameterValue = $VTable.GetParameterValue
+
+ # Allows shared module to listen to events from this module
+ $instance.EventListener = $VTable.EventListener
+
+ # Gets shared argument completers
+ $instance.ArgumentCompleter = $VTable.ArgumentCompleter
+
+ # The name of the currently selected Azure profile
+ $instance.ProfileName = $VTable.ProfileName
+
+
+ # Load the custom module
+ $customModulePath = Join-Path $PSScriptRoot './custom/Az.KeyVault.custom.psm1'
+ if(Test-Path $customModulePath) {
+ $null = Import-Module -Name $customModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export proxy cmdlet scripts
+ $exportsPath = Join-Path $PSScriptRoot './exports'
+ $directories = Get-ChildItem -Directory -Path $exportsPath
+ $profileDirectory = $null
+ if($instance.ProfileName) {
+ if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) {
+ $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName }
+ } else {
+ # Don't export anything if the profile doesn't exist for the module
+ $exportsPath = $null
+ Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded."
+ }
+ } elseif(($directories | Measure-Object).Count -gt 0) {
+ # Load the last folder if no profile is selected
+ $profileDirectory = $directories | Select-Object -Last 1
+ }
+
+ if($profileDirectory) {
+ Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
+ $exportsPath = $profileDirectory.FullName
+ }
+
+ if($exportsPath) {
+ Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
+ Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias)
+ }
+
+ # Finalize initialization of this module
+ $instance.Init();
+ Write-Information "Loaded Module '$($instance.Name)'"
+# endregion
diff --git a/src/KeyVault/KeyVault.Autorest/Properties/AssemblyInfo.cs b/src/KeyVault/KeyVault.Autorest/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000000..55c7eaa7d087
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/Properties/AssemblyInfo.cs
@@ -0,0 +1,28 @@
+// ----------------------------------------------------------------------------------
+//
+// Copyright Microsoft Corporation
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ----------------------------------------------------------------------------------
+
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Microsoft Azure Powershell - KeyVault")]
+[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
+[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
+[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
+
+[assembly: ComVisible(false)]
+[assembly: CLSCompliant(false)]
+[assembly: Guid("d817ec88-d3fd-4bfc-80e5-6a296703712a")]
+[assembly: AssemblyVersion("0.1.0")]
+[assembly: AssemblyFileVersion("0.1.0")]
diff --git a/src/KeyVault/KeyVault.Autorest/README.md b/src/KeyVault/KeyVault.Autorest/README.md
new file mode 100644
index 000000000000..bf4a1711d693
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/README.md
@@ -0,0 +1,102 @@
+
+# Az.KeyVault
+This directory contains the PowerShell module for the KeyVault service.
+
+---
+## Status
+[](https://www.powershellgallery.com/packages/Az.KeyVault/)
+
+## Info
+- Modifiable: yes
+- Generated: all
+- Committed: yes
+- Packaged: yes
+
+---
+## Detail
+This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
+
+## Module Requirements
+- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
+
+## Authentication
+AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
+
+## Development
+For information on how to develop for `Az.KeyVault`, see [how-to.md](how-to.md).
+
+
+### AutoRest Configuration
+> see https://aka.ms/autorest
+
+``` yaml
+# Please specify the commit id that includes your features to make sure generated codes stable.
+branch: 8fa9b5051129dd4808c9be1f5b753af226b044db
+require:
+# readme.azure.noprofile.md is the common configuration file
+ - $(this-folder)/../../readme.azure.noprofile.md
+
+input-file:
+# You need to specify your swagger files here.
+ - $(repo)/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/keyvault.json
+ - $(repo)/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/managedHsm.json
+# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
+# - (this-folder)/relative-path-to-your-swagger
+
+# For new RP, the version is 0.1.0
+module-version: 0.1.0
+# Normally, title is the service name
+title: KeyVault
+subject-prefix: $(service-name)
+use-extension:
+ "@autorest/powershell": "4.x"
+
+# If there are post APIs for some kinds of actions in the RP, you may need to
+# uncomment following line to support viaIdentity for these post APIs
+# identity-correction-for-post: true
+
+directive:
+ # Following is two common directive which are normally required in all the RPs
+ # 1. Remove the unexpanded parameter set
+ # 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
+ - where:
+ variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Check$|^CheckViaIdentity$|^CheckViaIdentityExpanded$
+ remove: true
+ # Remove the set-* cmdlet
+ - where:
+ verb: Set
+ remove: true
+ # Combine Test-AzKeyVaultNameAvailability and Test-AzKeyVaultManagedHsmNameAvailability
+ - from: swagger-document
+ where: $.paths..operationId
+ transform: return $.replace(/^ManagedHsms_CheckMhsmNameAvailability$/g, "ManagedHsms_CheckNameAvailability")
+ - no-inline:
+ - Error
+ # Remove all commands except Test-AzKeyVault*NameAvailability, *-AzKeyVaultManagedHsm, *-AzKeyVaultRegion
+ - where:
+ subject: ^((?!MhsmRegion|ManagedHsm|NameAvailability).)*$
+ remove: true
+ # Rename *-AzKeyVaultMhsmRegion to *-AzKeyVaultManagedHsmRegion
+ - where:
+ subject: ^MhsmRegion$
+ set:
+ subject: ManagedHsmRegion
+ - where:
+ subject: ^ManagedHsmRegion$
+ parameter-name: Name
+ set:
+ parameter-name: HsmName
+ # Remove *-AzKeyVaultManagedHsmDeleted
+ - where:
+ subject: ^ManagedHsmDeleted$
+ remove: true
+ # Hide *-AzKeyVaultManagedHsm
+ - where:
+ subject: ^ManagedHsm$
+ hide: true
+ # Remove New|Remove-AzKeyVaultManagedHsm
+ - where:
+ verb: New|Remove
+ subject: ^ManagedHsm$
+ remove: true
+```
diff --git a/src/KeyVault/KeyVault.Autorest/build-module.ps1 b/src/KeyVault/KeyVault.Autorest/build-module.ps1
new file mode 100644
index 000000000000..dd1b97bf1d8c
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/build-module.ps1
@@ -0,0 +1,174 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX)
+$ErrorActionPreference = 'Stop'
+
+if($PSEdition -ne 'Core') {
+ Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.'
+}
+
+if(-not $NotIsolated -and -not $Debugger) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+
+ if($LastExitCode -ne 0) {
+ # Build failed. Don't attempt to run the module.
+ return
+ }
+
+ if($Test) {
+ . (Join-Path $PSScriptRoot 'test-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Tests failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Docs) {
+ . (Join-Path $PSScriptRoot 'generate-help.ps1')
+ if($LastExitCode -ne 0) {
+ # Docs generation failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($UX) {
+ . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
+ if($LastExitCode -ne 0) {
+ # UX generation failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Pack) {
+ . (Join-Path $PSScriptRoot 'pack-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Packing failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1'
+ if($Code) {
+ . $runModulePath -Code
+ } elseif($Run) {
+ . $runModulePath
+ } else {
+ Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script."
+ }
+ return
+}
+
+$binFolder = Join-Path $PSScriptRoot 'bin'
+$objFolder = Join-Path $PSScriptRoot 'obj'
+
+if(-not $Debugger) {
+ Write-Host -ForegroundColor Green 'Cleaning build folders...'
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
+
+ if((Test-Path $binFolder) -or (Test-Path $objFolder)) {
+ Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?'
+ Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.'
+ }
+
+ Write-Host -ForegroundColor Green 'Compiling module...'
+ $buildConfig = 'Debug'
+ if($Release) {
+ $buildConfig = 'Release'
+ }
+ dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo
+ if($LastExitCode -ne 0) {
+ Write-Error 'Compilation failed.'
+ }
+
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.KeyVault.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+
+# Load DLL to use build-time cmdlets
+$null = Import-Module -Name $dll
+
+$modulePaths = $dll
+$customPsm1 = Join-Path $PSScriptRoot 'custom\Az.KeyVault.custom.psm1'
+if(Test-Path $customPsm1) {
+ $modulePaths = @($dll, $customPsm1)
+}
+
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+if(Test-Path $exportsFolder) {
+ $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $exportsFolder
+
+$internalFolder = Join-Path $PSScriptRoot 'internal'
+if(Test-Path $internalFolder) {
+ $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $internalFolder
+
+$psd1 = Join-Path $PSScriptRoot './Az.KeyVault.psd1'
+$guid = Get-ModuleGuid -Psd1Path $psd1
+$moduleName = 'Az.KeyVault'
+$examplesFolder = Join-Path $PSScriptRoot 'examples'
+$null = New-Item -ItemType Directory -Force -Path $examplesFolder
+
+Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
+$modelCmdlets = @()
+$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets'
+if (Test-Path $modelCmdletFolder) {
+ $null = Remove-Item -Force -Recurse -Path $modelCmdletFolder
+}
+if ($modelCmdlets.Count -gt 0) {
+ . (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
+ CreateModelCmdlet($modelCmdlets)
+}
+
+if($NoDocs) {
+ Write-Host -ForegroundColor Green 'Creating exports...'
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder
+} else {
+ Write-Host -ForegroundColor Green 'Creating exports and docs...'
+ $moduleDescription = 'Microsoft Azure PowerShell: KeyVault cmdlets'
+ $docsFolder = Join-Path $PSScriptRoot 'docs'
+ if(Test-Path $docsFolder) {
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+ }
+ $null = New-Item -ItemType Directory -Force -Path $docsFolder
+ $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
+}
+
+Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
+$formatPs1xml = Join-Path $PSScriptRoot './Az.KeyVault.format.ps1xml'
+Export-FormatPs1xml -FilePath $formatPs1xml
+
+Write-Host -ForegroundColor Green 'Creating psd1...'
+$customFolder = Join-Path $PSScriptRoot 'custom'
+Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid
+
+Write-Host -ForegroundColor Green 'Creating test stubs...'
+$testFolder = Join-Path $PSScriptRoot 'test'
+$null = New-Item -ItemType Directory -Force -Path $testFolder
+Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder
+
+Write-Host -ForegroundColor Green 'Creating example stubs...'
+Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
diff --git a/src/KeyVault/KeyVault.Autorest/check-dependencies.ps1 b/src/KeyVault/KeyVault.Autorest/check-dependencies.ps1
new file mode 100644
index 000000000000..90ca9867ae40
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/check-dependencies.ps1
@@ -0,0 +1,65 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
+$ErrorActionPreference = 'Stop'
+
+if(-not $NotIsolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+ return
+}
+
+function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
+ if($predicate) {
+ $module = Get-Module -ListAvailable -Name $moduleName
+ if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) {
+ $null = New-Item -ItemType Directory -Force -Path $path
+ Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
+ if ($requiredVersion) {
+ Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path
+ }elseif($versionMinimum) {
+ Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path
+ } else {
+ Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path
+ }
+ }
+ }
+}
+
+$ProgressPreference = 'SilentlyContinue'
+$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1
+
+$localModulesPath = Join-Path $PSScriptRoot 'generated\modules'
+if(Test-Path -Path $localModulesPath) {
+ $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
+}
+
+DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5'
+DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
+
+$tools = Join-Path $PSScriptRoot 'tools'
+$resourceDir = Join-Path $tools 'Resources'
+$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1'
+
+if ($Resources.IsPresent -and ((-not (Test-Path -Path $resourceModule)) -or $RegenerateSupportModule.IsPresent)) {
+ Write-Host -ForegroundColor Green "Building local Resource module used for test..."
+ Set-Location $resourceDir
+ $null = autorest .\README.md --use:@autorest/powershell@3.0.414 --output-folder=$HOME/.PSSharedModules/Resources
+ $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/
+ Set-Location $HOME/.PSSharedModules/Resources
+ $null = .\build-module.ps1
+ Set-Location $PSScriptRoot
+}
diff --git a/src/KeyVault/KeyVault.Autorest/create-model-cmdlets.ps1 b/src/KeyVault/KeyVault.Autorest/create-model-cmdlets.ps1
new file mode 100644
index 000000000000..a43a894d768c
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/create-model-cmdlets.ps1
@@ -0,0 +1,262 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+function CreateModelCmdlet {
+
+ param([Hashtable[]]$Models)
+
+ if ($Models.Count -eq 0)
+ {
+ return
+ }
+
+ $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
+ $OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
+ $null = New-Item -ItemType Directory -Force -Path $OutputDir
+ if (''.length -gt 0) {
+ $ModuleName = ''
+ } else {
+ $ModuleName = 'Az.KeyVault'
+ }
+ $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
+ $Content = ''
+ $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 )
+ { $Content += get-content $_.fullname -raw
+ } }
+
+ $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content)
+ $Nodes = $Tree.ChildNodes().ChildNodes()
+ $classConstantMember = @{}
+ foreach ($Model in $Models)
+ {
+ $ModelName = $Model.modelName
+ $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$ModelName") }
+ $ClassNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'class') -and ($_.Identifier.value -eq "$ModelName") }
+ $classConstantMember = @()
+ foreach ($class in $ClassNode) {
+ foreach ($member in $class.Members) {
+ $isConstant = $false
+ foreach ($attr in $member.AttributeLists) {
+ $memberName = $attr.Attributes.Name.ToString()
+ if ($memberName.EndsWith('.Constant')) {
+ $isConstant = $true
+ break
+ }
+ }
+ if (($member.Modifiers.ToString() -eq 'public') -and $isConstant) {
+ $classConstantMember += $member.Identifier.Value
+ }
+ }
+ }
+ if ($InterfaceNode.count -eq 0) {
+ continue
+ }
+ # through a queue, we iterate all the parent models.
+ $Queue = @($InterfaceNode)
+ $visited = @("I$ModelName")
+ $AllInterfaceNodes = @()
+ while ($Queue.count -ne 0)
+ {
+ $AllInterfaceNodes += $Queue[0]
+ # Baselist contains the direct parent models.
+ foreach ($parent in $Queue[0].BaseList.Types)
+ {
+ if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value)))
+ {
+ $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) })
+ $visited = [Array]$visited + $parent.Type.Right.Identifier.Value
+ }
+ }
+ $first, $Queue = $Queue
+ }
+
+ $Namespace = $InterfaceNode.Parent.Name
+ $ObjectType = $ModelName
+ $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
+ # remove duplicated module name
+ if ($ObjectType.StartsWith('KeyVault')) {
+ $ModulePrefix = ''
+ } else {
+ $ModulePrefix = 'KeyVault'
+ }
+ $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
+
+ $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string]
+ $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string]
+ foreach ($Node in $AllInterfaceNodes)
+ {
+ foreach ($Member in $Node.Members)
+ {
+ if ($classConstantMember.Contains($Member.Identifier.Value)) {
+ # skip constant member
+ continue
+ }
+ $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments
+ $Required = $false
+ $Description = ""
+ $Readonly = $False
+ $mutability = @{Read = $true; Create = $true; Update = $true}
+ foreach ($Argument in $Arguments)
+ {
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Required")
+ {
+ $Required = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Description")
+ {
+ $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"')
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly")
+ {
+ $Readonly = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Read")
+ {
+ $mutability.Read = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Create")
+ {
+ $mutability.Create = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Update")
+ {
+ $mutability.Update = $Argument.Expression.Token.Value
+ }
+ }
+ if ($Readonly)
+ {
+ continue
+ }
+ $Identifier = $Member.Identifier.Value
+ $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1]
+ $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1]
+ if ($Type.StartsWith("System.Collections.Generic.List"))
+ {
+ # if the type is a list, we need to convert it to array
+ $matched = $Type -match '\<(?.+)\>$'
+ if ($matched)
+ {
+ $Type = $matches.Name + '[]';
+ }
+ }
+ $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string]
+ if ($Required -and $mutability.Create -and $mutability.Update)
+ {
+ $ParameterDefinePropertyList.Add("Mandatory")
+ }
+ if ($Description -ne "")
+ {
+ $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"")
+ }
+ $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList)
+ # check whether completer is needed
+ $completer = '';
+ if(IsEnumType($Member)){
+ $completer += GetCompleter($Member)
+ }
+ $ParameterDefineScript = "
+ [Parameter($ParameterDefineProperty)]${completer}
+ [${Type}]
+ `$${Identifier}"
+ $ParameterDefineScriptList.Add($ParameterDefineScript)
+ $ParameterAssignScriptList.Add("
+ if (`$PSBoundParameters.ContainsKey('${Identifier}')) {
+ `$Object.${Identifier} = `$${Identifier}
+ }")
+ }
+ }
+ $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator ","
+ $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator ""
+
+ $cmdletName = "New-Az${ModulePrefix}${ObjectType}Object"
+ if ('' -ne $Model.cmdletName) {
+ $cmdletName = $Model.cmdletName
+ }
+ $OutputPath = Join-Path -ChildPath "${cmdletName}.ps1" -Path $OutputDir
+ $cmdletNameInLowerCase = $cmdletName.ToLower()
+ $Script = "
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the ""License"");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an ""AS IS"" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create an in-memory object for ${ObjectType}.
+.Description
+Create an in-memory object for ${ObjectType}.
+
+.Outputs
+${ObjectTypeWithNamespace}
+.Link
+https://learn.microsoft.com/powershell/module/${ModuleName}/${cmdletNameInLowerCase}
+#>
+function ${cmdletName} {
+ [OutputType('${ObjectTypeWithNamespace}')]
+ [CmdletBinding(PositionalBinding=`$false)]
+ Param(
+${ParameterDefineScript}
+ )
+
+ process {
+ `$Object = [${ObjectTypeWithNamespace}]::New()
+${ParameterAssignScript}
+ return `$Object
+ }
+}
+"
+ Set-Content -Path $OutputPath -Value $Script
+ }
+}
+
+function IsEnumType {
+ param (
+ [Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax]$property
+ )
+ $isEnum = $false
+ foreach ($attr in $property.AttributeLists) {
+ $attributeName = $attr.Attributes.Name.ToString()
+ if ($attributeName.Contains('ArgumentCompleter')) {
+ $isEnum = $true
+ break
+ }
+ }
+ return $isEnum;
+}
+
+function GetCompleter {
+ param (
+ [Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax]$property
+ )
+ foreach ($attr in $property.AttributeLists) {
+ $attributeName = $attr.Attributes.Name.ToString()
+ if ($attributeName.Contains('ArgumentCompleter')) {
+ $attributeName = $attributeName.Split("::")[-1]
+ $possibleValues = [System.String]::Join(", ", $attr.Attributes.ArgumentList.Arguments)
+ $completer += "`n [${attributeName}(${possibleValues})]"
+ return $completer
+ }
+ }
+}
diff --git a/src/KeyVault/KeyVault.Autorest/custom/Add-AzKeyVaultManagedHsmRegion.ps1 b/src/KeyVault/KeyVault.Autorest/custom/Add-AzKeyVaultManagedHsmRegion.ps1
new file mode 100644
index 000000000000..8541d3d65614
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/custom/Add-AzKeyVaultManagedHsmRegion.ps1
@@ -0,0 +1,136 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Description
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Example
+{{ Add code here }}
+.Example
+{{ Add code here }}
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion
+.Link
+https://learn.microsoft.com/powershell/module/az.keyvault/add-azkeyvaultmanagedhsmregion
+#>
+function Add-AzKeyVaultManagedHsmRegion {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion])]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the managed HSM Pool
+ ${HsmName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the resource group that contains the managed HSM pool.
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String[]]
+ # List of regions to be added associated with the managed hsm pool.
+ # To construct, see NOTES section for REGION properties and create a hash table.
+ ${Region},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Subscription credentials which uniquely identify Microsoft Azure subscription.
+ # The subscription ID forms part of the URI for every service call.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+ process {
+ try {
+ $null = $PSBoundParameters.Remove('HsmName')
+ $null = $PSBoundParameters.Add('Name', $HsmName)
+ $null = $PSBoundParameters.Remove('Region')
+ $Parameter = Az.KeyVault.internal\Get-AzKeyVaultManagedHsm @PSBoundParameters
+ for ($i = 0; $i -lt $Region.Count; $i++) {
+ $Parameter.Region += New-Object Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmGeoReplicatedRegion -Property @{Name = $Region[$i]}
+ }
+ $null = $PSBoundParameters.Add('Parameter', $Parameter)
+ $null = Az.KeyVault.internal\Update-AzKeyVaultManagedHsm @PSBoundParameters
+ $null = $PSBoundParameters.Remove('Parameter')
+ $null = $PSBoundParameters.Remove('Name')
+ $null = $PSBoundParameters.Add('HsmName', $HsmName)
+ Az.KeyVault\Get-AzKeyVaultManagedHsmRegion @PSBoundParameters
+ } catch {
+ throw
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/KeyVault/KeyVault.Autorest/custom/Az.KeyVault.custom.psm1 b/src/KeyVault/KeyVault.Autorest/custom/Az.KeyVault.custom.psm1
new file mode 100644
index 000000000000..8352a4d3a608
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/custom/Az.KeyVault.custom.psm1
@@ -0,0 +1,17 @@
+# region Generated
+ # Load the private module dll
+ $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.KeyVault.private.dll')
+
+ # Load the internal module
+ $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.KeyVault.internal.psm1'
+ if(Test-Path $internalModulePath) {
+ $null = Import-Module -Name $internalModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export script cmdlets
+ Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias)
+# endregion
diff --git a/src/KeyVault/KeyVault.Autorest/custom/ManagedHsm.json.cs b/src/KeyVault/KeyVault.Autorest/custom/ManagedHsm.json.cs
new file mode 100644
index 000000000000..1d48590cddaf
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/custom/ManagedHsm.json.cs
@@ -0,0 +1,20 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Extensions;
+
+ /// Resource information with extended details.
+ public partial class ManagedHsm
+ {
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonObject container)
+ {
+ if (this.Tag != null && this.Tag.Count == 0) {
+ container.Add("tags", new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonObject());
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/KeyVault/KeyVault.Autorest/custom/README.md b/src/KeyVault/KeyVault.Autorest/custom/README.md
new file mode 100644
index 000000000000..7d410d4892dc
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/custom/README.md
@@ -0,0 +1,41 @@
+# Custom
+This directory contains custom implementation for non-generated cmdlets for the `Az.KeyVault` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.KeyVault.custom.psm1`. This file should not be modified.
+
+## Info
+- Modifiable: yes
+- Generated: partial
+- Committed: yes
+- Packaged: yes
+
+## Details
+For `Az.KeyVault` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*.
+
+For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.KeyVault.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder.
+
+For script cmdlets, these are loaded via the `Az.KeyVault.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
+
+## Purpose
+This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder.
+
+## Usage
+The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
+- Break
+- DefaultProfile
+- HttpPipelineAppend
+- HttpPipelinePrepend
+- Proxy
+- ProxyCredential
+- ProxyUseDefaultCredentials
+
+These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.KeyVault`. For C#, follow the usage seen in the `ProcessRecordAsync` method.
+
+### Attributes
+For processing the cmdlets, we've created some additional attributes:
+- `Microsoft.Azure.PowerShell.Cmdlets.KeyVault.DescriptionAttribute`
+ - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
+- `Microsoft.Azure.PowerShell.Cmdlets.KeyVault.DoNotExportAttribute`
+ - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.KeyVault`.
+- `Microsoft.Azure.PowerShell.Cmdlets.KeyVault.InternalExportAttribute`
+ - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.KeyVault`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
+- `Microsoft.Azure.PowerShell.Cmdlets.KeyVault.ProfileAttribute`
+ - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
\ No newline at end of file
diff --git a/src/KeyVault/KeyVault.Autorest/custom/Remove-AzKeyVaultManagedHsmRegion.ps1 b/src/KeyVault/KeyVault.Autorest/custom/Remove-AzKeyVaultManagedHsmRegion.ps1
new file mode 100644
index 000000000000..f6b794e35eca
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/custom/Remove-AzKeyVaultManagedHsmRegion.ps1
@@ -0,0 +1,148 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Description
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Example
+{{ Add code here }}
+.Example
+{{ Add code here }}
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion
+.Link
+https://learn.microsoft.com/powershell/module/az.keyvault/remove-azkeyvaultmanagedhsmregion
+#>
+function Remove-AzKeyVaultManagedHsmRegion {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion])]
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+ param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the managed HSM Pool
+ ${HsmName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the resource group that contains the managed HSM pool.
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String[]]
+ # List of regions to be removed associated with the managed hsm pool.
+ ${Region},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Subscription credentials which uniquely identify Microsoft Azure subscription.
+ # The subscription ID forms part of the URI for every service call.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+ process {
+ try {
+ $null = $PSBoundParameters.Remove('PassThru')
+ $null = $PSBoundParameters.Remove('HsmName')
+ $null = $PSBoundParameters.Add('Name', $HsmName)
+ $null = $PSBoundParameters.Remove('Region')
+ $Parameter = Az.KeyVault.internal\Get-AzKeyVaultManagedHsm @PSBoundParameters
+ $remainingRegions = @()
+ for ($i = 0; $i -lt $Parameter.Region.Count; $i++) {
+ if($Region -notcontains $Parameter.Region[$i].Name){
+ $remainingRegions += $Parameter.Region[$i]
+ }
+ }
+ $Parameter.Region = $remainingRegions
+ $null = $PSBoundParameters.Add('Parameter', $Parameter)
+ $null = Az.KeyVault.internal\Update-AzKeyVaultManagedHsm @PSBoundParameters
+ $null = $PSBoundParameters.Remove('Parameter')
+ $null = $PSBoundParameters.Remove('Name')
+ $null = $PSBoundParameters.Add('HsmName', $HsmName)
+ if($PassThru.IsPresent){
+ Az.KeyVault\Get-AzKeyVaultManagedHsmRegion @PSBoundParameters
+ }
+ } catch {
+ throw
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/KeyVault/KeyVault.Autorest/docs/Add-AzKeyVaultManagedHsmRegion.md b/src/KeyVault/KeyVault.Autorest/docs/Add-AzKeyVaultManagedHsmRegion.md
new file mode 100644
index 000000000000..f71f808689b1
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/docs/Add-AzKeyVaultManagedHsmRegion.md
@@ -0,0 +1,176 @@
+---
+external help file:
+Module Name: Az.KeyVault
+online version: https://learn.microsoft.com/powershell/module/az.keyvault/add-azkeyvaultmanagedhsmregion
+schema: 2.0.0
+---
+
+# Add-AzKeyVaultManagedHsmRegion
+
+## SYNOPSIS
+The List operation gets information about the regions associated with the managed HSM Pool.
+
+## SYNTAX
+
+```
+Add-AzKeyVaultManagedHsmRegion -HsmName -ResourceGroupName -Region
+ [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-Confirm] [-WhatIf] []
+```
+
+## DESCRIPTION
+The List operation gets information about the regions associated with the managed HSM Pool.
+
+## EXAMPLES
+
+### Example 1: Add a region for Managed HSM
+```powershell
+Add-AzKeyVaultManagedHsmRegion -HsmName testmhsm -ResourceGroupName test-rg -Region eastus2
+```
+
+```output
+IsPrimary Name ProvisioningState
+--------- ---- -----------------
+True eastus Succeeded
+False eastus2 Succeeded
+```
+
+This command adds `eastus` as the region extension for Managed HSM named `testmhsm`.
+
+## PARAMETERS
+
+### -AsJob
+Run the command as a job
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -DefaultProfile
+The DefaultProfile parameter is not functional.
+Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+
+```yaml
+Type: System.Management.Automation.PSObject
+Parameter Sets: (All)
+Aliases: AzureRMContext, AzureCredential
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -HsmName
+Name of the managed HSM Pool
+
+```yaml
+Type: System.String
+Parameter Sets: (All)
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Region
+List of regions to be added associated with the managed hsm pool.
+
+```yaml
+Type: System.String[]
+Parameter Sets: (All)
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceGroupName
+Name of the resource group that contains the managed HSM pool.
+
+```yaml
+Type: System.String
+Parameter Sets: (All)
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -SubscriptionId
+Subscription credentials which uniquely identify Microsoft Azure subscription.
+The subscription ID forms part of the URI for every service call.
+
+```yaml
+Type: System.String
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: (Get-AzContext).Subscription.Id
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Confirm
+Prompts you for confirmation before running the cmdlet.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases: cf
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -WhatIf
+Shows what would happen if the cmdlet runs.
+The cmdlet is not run.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases: wi
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+## OUTPUTS
+
+### Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion
+
+## NOTES
+
+## RELATED LINKS
+
diff --git a/src/KeyVault/KeyVault.Autorest/docs/Az.KeyVault.md b/src/KeyVault/KeyVault.Autorest/docs/Az.KeyVault.md
new file mode 100644
index 000000000000..41d27fbe94f6
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/docs/Az.KeyVault.md
@@ -0,0 +1,28 @@
+---
+Module Name: Az.KeyVault
+Module Guid: e0f28b9c-6a6b-4b66-833e-c01780a5577b
+Download Help Link: https://learn.microsoft.com/powershell/module/az.keyvault
+Help Version: 1.0.0.0
+Locale: en-US
+---
+
+# Az.KeyVault Module
+## Description
+Microsoft Azure PowerShell: KeyVault cmdlets
+
+## Az.KeyVault Cmdlets
+### [Add-AzKeyVaultManagedHsmRegion](Add-AzKeyVaultManagedHsmRegion.md)
+The List operation gets information about the regions associated with the managed HSM Pool.
+
+### [Get-AzKeyVaultManagedHsmRegion](Get-AzKeyVaultManagedHsmRegion.md)
+The List operation gets information about the regions associated with the managed HSM Pool.
+
+### [Remove-AzKeyVaultManagedHsmRegion](Remove-AzKeyVaultManagedHsmRegion.md)
+The List operation gets information about the regions associated with the managed HSM Pool.
+
+### [Test-AzKeyVaultManagedHsmNameAvailability](Test-AzKeyVaultManagedHsmNameAvailability.md)
+Checks that the managed hsm name is valid and is not already in use.
+
+### [Test-AzKeyVaultNameAvailability](Test-AzKeyVaultNameAvailability.md)
+Checks that the vault name is valid and is not already in use.
+
diff --git a/src/KeyVault/KeyVault.Autorest/docs/Get-AzKeyVaultManagedHsmRegion.md b/src/KeyVault/KeyVault.Autorest/docs/Get-AzKeyVaultManagedHsmRegion.md
new file mode 100644
index 000000000000..b95b9ec8986f
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/docs/Get-AzKeyVaultManagedHsmRegion.md
@@ -0,0 +1,115 @@
+---
+external help file:
+Module Name: Az.KeyVault
+online version: https://learn.microsoft.com/powershell/module/az.keyvault/get-azkeyvaultmanagedhsmregion
+schema: 2.0.0
+---
+
+# Get-AzKeyVaultManagedHsmRegion
+
+## SYNOPSIS
+The List operation gets information about the regions associated with the managed HSM Pool.
+
+## SYNTAX
+
+```
+Get-AzKeyVaultManagedHsmRegion -HsmName -ResourceGroupName [-SubscriptionId ]
+ [-DefaultProfile ] []
+```
+
+## DESCRIPTION
+The List operation gets information about the regions associated with the managed HSM Pool.
+
+## EXAMPLES
+
+### Example 1: list all regions for a specified Managed HSM
+```powershell
+Get-AzKeyVaultManagedHsmRegion -HsmName testmhsm -ResourceGroupName test-rg
+```
+
+```output
+IsPrimary Name ProvisioningState
+--------- ---- -----------------
+True eastus Succeeded
+False westus Succeeded
+```
+
+This command lists all regions for Managed HSM named `testmhsm` in resource group `test-rg`.
+
+## PARAMETERS
+
+### -DefaultProfile
+The DefaultProfile parameter is not functional.
+Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+
+```yaml
+Type: System.Management.Automation.PSObject
+Parameter Sets: (All)
+Aliases: AzureRMContext, AzureCredential
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -HsmName
+Name of the managed HSM Pool
+
+```yaml
+Type: System.String
+Parameter Sets: (All)
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceGroupName
+Name of the resource group that contains the managed HSM pool.
+
+```yaml
+Type: System.String
+Parameter Sets: (All)
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -SubscriptionId
+Subscription credentials which uniquely identify Microsoft Azure subscription.
+The subscription ID forms part of the URI for every service call.
+
+```yaml
+Type: System.String[]
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: (Get-AzContext).Subscription.Id
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+## OUTPUTS
+
+### Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion
+
+## NOTES
+
+## RELATED LINKS
+
diff --git a/src/KeyVault/KeyVault.Autorest/docs/README.md b/src/KeyVault/KeyVault.Autorest/docs/README.md
new file mode 100644
index 000000000000..2c95c9e1ecfd
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/docs/README.md
@@ -0,0 +1,11 @@
+# Docs
+This directory contains the documentation of the cmdlets for the `Az.KeyVault` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `..\examples` folder.
+
+## Info
+- Modifiable: no
+- Generated: all
+- Committed: yes
+- Packaged: yes
+
+## Details
+The process of documentation generation loads `Az.KeyVault` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder.
\ No newline at end of file
diff --git a/src/KeyVault/KeyVault.Autorest/docs/Remove-AzKeyVaultManagedHsmRegion.md b/src/KeyVault/KeyVault.Autorest/docs/Remove-AzKeyVaultManagedHsmRegion.md
new file mode 100644
index 000000000000..3e5ab778ffb4
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/docs/Remove-AzKeyVaultManagedHsmRegion.md
@@ -0,0 +1,192 @@
+---
+external help file:
+Module Name: Az.KeyVault
+online version: https://learn.microsoft.com/powershell/module/az.keyvault/remove-azkeyvaultmanagedhsmregion
+schema: 2.0.0
+---
+
+# Remove-AzKeyVaultManagedHsmRegion
+
+## SYNOPSIS
+The List operation gets information about the regions associated with the managed HSM Pool.
+
+## SYNTAX
+
+```
+Remove-AzKeyVaultManagedHsmRegion -HsmName -ResourceGroupName -Region
+ [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-PassThru] [-Confirm] [-WhatIf]
+ []
+```
+
+## DESCRIPTION
+The List operation gets information about the regions associated with the managed HSM Pool.
+
+## EXAMPLES
+
+### Example 1: Remove a region for Managed HSM
+```powershell
+Remove-AzKeyVaultManagedHsmRegion -HsmName testmhsm -ResourceGroupName test-rg -Region eastus2 -PassThru
+```
+
+```output
+IsPrimary Name ProvisioningState
+--------- ---- -----------------
+True eastus Succeeded
+False westus Succeeded
+```
+
+This command removes `eastus2` from region extension for Managed HSM named `testmhsm`.
+
+## PARAMETERS
+
+### -AsJob
+Run the command as a job
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -DefaultProfile
+The DefaultProfile parameter is not functional.
+Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+
+```yaml
+Type: System.Management.Automation.PSObject
+Parameter Sets: (All)
+Aliases: AzureRMContext, AzureCredential
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -HsmName
+Name of the managed HSM Pool
+
+```yaml
+Type: System.String
+Parameter Sets: (All)
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -PassThru
+Returns true when the command succeeds
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Region
+List of regions to be removed associated with the managed hsm pool.
+
+```yaml
+Type: System.String[]
+Parameter Sets: (All)
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ResourceGroupName
+Name of the resource group that contains the managed HSM pool.
+
+```yaml
+Type: System.String
+Parameter Sets: (All)
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -SubscriptionId
+Subscription credentials which uniquely identify Microsoft Azure subscription.
+The subscription ID forms part of the URI for every service call.
+
+```yaml
+Type: System.String
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: (Get-AzContext).Subscription.Id
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Confirm
+Prompts you for confirmation before running the cmdlet.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases: cf
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -WhatIf
+Shows what would happen if the cmdlet runs.
+The cmdlet is not run.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases: wi
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+## OUTPUTS
+
+### Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion
+
+## NOTES
+
+## RELATED LINKS
+
diff --git a/src/KeyVault/KeyVault.Autorest/docs/Test-AzKeyVaultManagedHsmNameAvailability.md b/src/KeyVault/KeyVault.Autorest/docs/Test-AzKeyVaultManagedHsmNameAvailability.md
new file mode 100644
index 000000000000..66c87b272be1
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/docs/Test-AzKeyVaultManagedHsmNameAvailability.md
@@ -0,0 +1,188 @@
+---
+external help file:
+Module Name: Az.KeyVault
+online version: https://learn.microsoft.com/powershell/module/az.keyvault/test-azkeyvaultmanagedhsmnameavailability
+schema: 2.0.0
+---
+
+# Test-AzKeyVaultManagedHsmNameAvailability
+
+## SYNOPSIS
+Checks that the managed hsm name is valid and is not already in use.
+
+## SYNTAX
+
+### CheckExpanded (Default)
+```
+Test-AzKeyVaultManagedHsmNameAvailability -Name [-SubscriptionId ]
+ [-DefaultProfile ] [-Confirm] [-WhatIf] []
+```
+
+### CheckViaJsonFilePath
+```
+Test-AzKeyVaultManagedHsmNameAvailability -JsonFilePath [-SubscriptionId ]
+ [-DefaultProfile ] [-Confirm] [-WhatIf] []
+```
+
+### CheckViaJsonString
+```
+Test-AzKeyVaultManagedHsmNameAvailability -JsonString [-SubscriptionId ]
+ [-DefaultProfile ] [-Confirm] [-WhatIf] []
+```
+
+## DESCRIPTION
+Checks that the managed hsm name is valid and is not already in use.
+
+## EXAMPLES
+
+### Example 1: Test the availability of an unused HSM name
+```powershell
+Test-AzKeyVaultManagedHsmNameAvailability -Name testmhsm0818
+```
+
+```output
+Message NameAvailable Reason
+------- ------------- ------
+ True
+```
+
+This commands tests the availability of vault name `testmhsm0818`.
+The results shows `testmhsm0818` is not occupied.
+
+### Example 2: Test the availability of an used HSM name
+```powershell
+Test-AzKeyVaultNameAvailability -Name testmhsm
+```
+
+```output
+Message NameAvailable Reason
+------- ------------- ------
+The name 'testmhsm' is already in use. False AlreadyExists
+```
+
+This commands tests the availability of HSM name `testmhsm`.
+The results shows `testmhsm` is already in use.
+
+## PARAMETERS
+
+### -DefaultProfile
+The DefaultProfile parameter is not functional.
+Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+
+```yaml
+Type: System.Management.Automation.PSObject
+Parameter Sets: (All)
+Aliases: AzureRMContext, AzureCredential
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -JsonFilePath
+Path of Json file supplied to the Check operation
+
+```yaml
+Type: System.String
+Parameter Sets: CheckViaJsonFilePath
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -JsonString
+Json string supplied to the Check operation
+
+```yaml
+Type: System.String
+Parameter Sets: CheckViaJsonString
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Name
+The managed hsm name.
+
+```yaml
+Type: System.String
+Parameter Sets: CheckExpanded
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -SubscriptionId
+Subscription credentials which uniquely identify Microsoft Azure subscription.
+The subscription ID forms part of the URI for every service call.
+
+```yaml
+Type: System.String
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: (Get-AzContext).Subscription.Id
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Confirm
+Prompts you for confirmation before running the cmdlet.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases: cf
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -WhatIf
+Shows what would happen if the cmdlet runs.
+The cmdlet is not run.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases: wi
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+## OUTPUTS
+
+### Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckMhsmNameAvailabilityResult
+
+## NOTES
+
+## RELATED LINKS
+
diff --git a/src/KeyVault/KeyVault.Autorest/docs/Test-AzKeyVaultNameAvailability.md b/src/KeyVault/KeyVault.Autorest/docs/Test-AzKeyVaultNameAvailability.md
new file mode 100644
index 000000000000..6271e2cc5995
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/docs/Test-AzKeyVaultNameAvailability.md
@@ -0,0 +1,188 @@
+---
+external help file:
+Module Name: Az.KeyVault
+online version: https://learn.microsoft.com/powershell/module/az.keyvault/test-azkeyvaultnameavailability
+schema: 2.0.0
+---
+
+# Test-AzKeyVaultNameAvailability
+
+## SYNOPSIS
+Checks that the vault name is valid and is not already in use.
+
+## SYNTAX
+
+### CheckExpanded (Default)
+```
+Test-AzKeyVaultNameAvailability -Name [-SubscriptionId ] [-DefaultProfile ]
+ [-Confirm] [-WhatIf] []
+```
+
+### CheckViaJsonFilePath
+```
+Test-AzKeyVaultNameAvailability -JsonFilePath [-SubscriptionId ] [-DefaultProfile ]
+ [-Confirm] [-WhatIf] []
+```
+
+### CheckViaJsonString
+```
+Test-AzKeyVaultNameAvailability -JsonString [-SubscriptionId ] [-DefaultProfile ]
+ [-Confirm] [-WhatIf] []
+```
+
+## DESCRIPTION
+Checks that the vault name is valid and is not already in use.
+
+## EXAMPLES
+
+### Example 1: Test the availability of an unused vault name
+```powershell
+Test-AzKeyVaultNameAvailability -Name test-kv0818
+```
+
+```output
+Message NameAvailable Reason
+------- ------------- ------
+ True
+```
+
+This commands tests the availability of vault name `test-kv0818`.
+The results shows `test-kv0818` is not occupied.
+
+### Example 2: Test the availability of an used vault name
+```powershell
+Test-AzKeyVaultNameAvailability -Name testkv
+```
+
+```output
+Message
+-------
+The vault name 'testkv' is already in use. Vault names are globally unique so it is possible that the name is already taken. If you are sure that the vault name was not …
+```
+
+This commands tests the availability of vault name `testkv`.
+The results shows `testkv` is already in use.
+
+## PARAMETERS
+
+### -DefaultProfile
+The DefaultProfile parameter is not functional.
+Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+
+```yaml
+Type: System.Management.Automation.PSObject
+Parameter Sets: (All)
+Aliases: AzureRMContext, AzureCredential
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -JsonFilePath
+Path of Json file supplied to the Check operation
+
+```yaml
+Type: System.String
+Parameter Sets: CheckViaJsonFilePath
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -JsonString
+Json string supplied to the Check operation
+
+```yaml
+Type: System.String
+Parameter Sets: CheckViaJsonString
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Name
+The vault name.
+
+```yaml
+Type: System.String
+Parameter Sets: CheckExpanded
+Aliases:
+
+Required: True
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -SubscriptionId
+Subscription credentials which uniquely identify Microsoft Azure subscription.
+The subscription ID forms part of the URI for every service call.
+
+```yaml
+Type: System.String
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: (Get-AzContext).Subscription.Id
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Confirm
+Prompts you for confirmation before running the cmdlet.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases: cf
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -WhatIf
+Shows what would happen if the cmdlet runs.
+The cmdlet is not run.
+
+```yaml
+Type: System.Management.Automation.SwitchParameter
+Parameter Sets: (All)
+Aliases: wi
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+## OUTPUTS
+
+### Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckNameAvailabilityResult
+
+## NOTES
+
+## RELATED LINKS
+
diff --git a/src/KeyVault/KeyVault.Autorest/examples/Add-AzKeyVaultManagedHsmRegion.md b/src/KeyVault/KeyVault.Autorest/examples/Add-AzKeyVaultManagedHsmRegion.md
new file mode 100644
index 000000000000..2319a4158cf8
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/examples/Add-AzKeyVaultManagedHsmRegion.md
@@ -0,0 +1,13 @@
+### Example 1: Add a region for Managed HSM
+```powershell
+Add-AzKeyVaultManagedHsmRegion -HsmName testmhsm -ResourceGroupName test-rg -Region eastus2
+```
+
+```output
+IsPrimary Name ProvisioningState
+--------- ---- -----------------
+True eastus Succeeded
+False eastus2 Succeeded
+```
+
+This command adds `eastus` as the region extension for Managed HSM named `testmhsm`.
\ No newline at end of file
diff --git a/src/KeyVault/KeyVault.Autorest/examples/Get-AzKeyVaultManagedHsmRegion.md b/src/KeyVault/KeyVault.Autorest/examples/Get-AzKeyVaultManagedHsmRegion.md
new file mode 100644
index 000000000000..335d00bdf593
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/examples/Get-AzKeyVaultManagedHsmRegion.md
@@ -0,0 +1,13 @@
+### Example 1: list all regions for a specified Managed HSM
+```powershell
+Get-AzKeyVaultManagedHsmRegion -HsmName testmhsm -ResourceGroupName test-rg
+```
+
+```output
+IsPrimary Name ProvisioningState
+--------- ---- -----------------
+True eastus Succeeded
+False westus Succeeded
+```
+
+This command lists all regions for Managed HSM named `testmhsm` in resource group `test-rg`.
\ No newline at end of file
diff --git a/src/KeyVault/KeyVault.Autorest/examples/Remove-AzKeyVaultManagedHsmRegion.md b/src/KeyVault/KeyVault.Autorest/examples/Remove-AzKeyVaultManagedHsmRegion.md
new file mode 100644
index 000000000000..3ae9e979e98d
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/examples/Remove-AzKeyVaultManagedHsmRegion.md
@@ -0,0 +1,13 @@
+### Example 1: Remove a region for Managed HSM
+```powershell
+Remove-AzKeyVaultManagedHsmRegion -HsmName testmhsm -ResourceGroupName test-rg -Region eastus2 -PassThru
+```
+
+```output
+IsPrimary Name ProvisioningState
+--------- ---- -----------------
+True eastus Succeeded
+False westus Succeeded
+```
+
+This command removes `eastus2` from region extension for Managed HSM named `testmhsm`.
\ No newline at end of file
diff --git a/src/KeyVault/KeyVault.Autorest/examples/Test-AzKeyVaultManagedHsmNameAvailability.md b/src/KeyVault/KeyVault.Autorest/examples/Test-AzKeyVaultManagedHsmNameAvailability.md
new file mode 100644
index 000000000000..5ed0b388276e
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/examples/Test-AzKeyVaultManagedHsmNameAvailability.md
@@ -0,0 +1,25 @@
+### Example 1: Test the availability of an unused HSM name
+```powershell
+Test-AzKeyVaultManagedHsmNameAvailability -Name testmhsm0818
+```
+
+```output
+Message NameAvailable Reason
+------- ------------- ------
+ True
+```
+
+This commands tests the availability of vault name `testmhsm0818`. The results shows `testmhsm0818` is not occupied.
+
+### Example 2: Test the availability of an used HSM name
+```powershell
+Test-AzKeyVaultNameAvailability -Name testmhsm
+```
+
+```output
+Message NameAvailable Reason
+------- ------------- ------
+The name 'testmhsm' is already in use. False AlreadyExists
+```
+
+This commands tests the availability of HSM name `testmhsm`. The results shows `testmhsm` is already in use.
diff --git a/src/KeyVault/KeyVault.Autorest/examples/Test-AzKeyVaultNameAvailability.md b/src/KeyVault/KeyVault.Autorest/examples/Test-AzKeyVaultNameAvailability.md
new file mode 100644
index 000000000000..c323d45bde1e
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/examples/Test-AzKeyVaultNameAvailability.md
@@ -0,0 +1,25 @@
+### Example 1: Test the availability of an unused vault name
+```powershell
+Test-AzKeyVaultNameAvailability -Name test-kv0818
+```
+
+```output
+Message NameAvailable Reason
+------- ------------- ------
+ True
+```
+
+This commands tests the availability of vault name `test-kv0818`. The results shows `test-kv0818` is not occupied.
+
+### Example 2: Test the availability of an used vault name
+```powershell
+Test-AzKeyVaultNameAvailability -Name testkv
+```
+
+```output
+Message
+-------
+The vault name 'testkv' is already in use. Vault names are globally unique so it is possible that the name is already taken. If you are sure that the vault name was not …
+```
+
+This commands tests the availability of vault name `testkv`. The results shows `testkv` is already in use.
diff --git a/src/KeyVault/KeyVault.Autorest/export-surface.ps1 b/src/KeyVault/KeyVault.Autorest/export-surface.ps1
new file mode 100644
index 000000000000..a02ccba768ab
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/export-surface.ps1
@@ -0,0 +1,41 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $NotIsolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+ return
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.KeyVault.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+$null = Import-Module -Name $dll
+
+$moduleName = 'Az.KeyVault'
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+$resourcesFolder = Join-Path $PSScriptRoot 'resources'
+
+Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'"
+
+Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'"
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
\ No newline at end of file
diff --git a/src/KeyVault/KeyVault.Autorest/exports/Add-AzKeyVaultManagedHsmRegion.ps1 b/src/KeyVault/KeyVault.Autorest/exports/Add-AzKeyVaultManagedHsmRegion.ps1
new file mode 100644
index 000000000000..9e426f198222
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/exports/Add-AzKeyVaultManagedHsmRegion.ps1
@@ -0,0 +1,190 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Description
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Example
+Add-AzKeyVaultManagedHsmRegion -HsmName testmhsm -ResourceGroupName test-rg -Region eastus2
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion
+.Link
+https://learn.microsoft.com/powershell/module/az.keyvault/add-azkeyvaultmanagedhsmregion
+#>
+function Add-AzKeyVaultManagedHsmRegion {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion])]
+[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the managed HSM Pool
+ ${HsmName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the resource group that contains the managed HSM pool.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Subscription credentials which uniquely identify Microsoft Azure subscription.
+ # The subscription ID forms part of the URI for every service call.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String[]]
+ # List of regions to be added associated with the managed hsm pool.
+ ${Region},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ __AllParameterSets = 'Az.KeyVault.custom\Add-AzKeyVaultManagedHsmRegion';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/KeyVault/KeyVault.Autorest/exports/Get-AzKeyVaultManagedHsmRegion.ps1 b/src/KeyVault/KeyVault.Autorest/exports/Get-AzKeyVaultManagedHsmRegion.ps1
new file mode 100644
index 000000000000..eef13ebeb871
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/exports/Get-AzKeyVaultManagedHsmRegion.ps1
@@ -0,0 +1,178 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Description
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Example
+Get-AzKeyVaultManagedHsmRegion -HsmName testmhsm -ResourceGroupName test-rg
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion
+.Link
+https://learn.microsoft.com/powershell/module/az.keyvault/get-azkeyvaultmanagedhsmregion
+#>
+function Get-AzKeyVaultManagedHsmRegion {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the managed HSM Pool
+ ${HsmName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the resource group that contains the managed HSM pool.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Subscription credentials which uniquely identify Microsoft Azure subscription.
+ # The subscription ID forms part of the URI for every service call.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ List = 'Az.KeyVault.private\Get-AzKeyVaultManagedHsmRegion_List';
+ }
+ if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/KeyVault/KeyVault.Autorest/exports/ProxyCmdletDefinitions.ps1 b/src/KeyVault/KeyVault.Autorest/exports/ProxyCmdletDefinitions.ps1
new file mode 100644
index 000000000000..8aa587d1ca7d
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/exports/ProxyCmdletDefinitions.ps1
@@ -0,0 +1,880 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Description
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Example
+Get-AzKeyVaultManagedHsmRegion -HsmName testmhsm -ResourceGroupName test-rg
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion
+.Link
+https://learn.microsoft.com/powershell/module/az.keyvault/get-azkeyvaultmanagedhsmregion
+#>
+function Get-AzKeyVaultManagedHsmRegion {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the managed HSM Pool
+ ${HsmName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the resource group that contains the managed HSM pool.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Subscription credentials which uniquely identify Microsoft Azure subscription.
+ # The subscription ID forms part of the URI for every service call.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ List = 'Az.KeyVault.private\Get-AzKeyVaultManagedHsmRegion_List';
+ }
+ if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Checks that the managed hsm name is valid and is not already in use.
+.Description
+Checks that the managed hsm name is valid and is not already in use.
+.Example
+Test-AzKeyVaultManagedHsmNameAvailability -Name testmhsm0818
+.Example
+Test-AzKeyVaultNameAvailability -Name testmhsm
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckMhsmNameAvailabilityResult
+.Link
+https://learn.microsoft.com/powershell/module/az.keyvault/test-azkeyvaultmanagedhsmnameavailability
+#>
+function Test-AzKeyVaultManagedHsmNameAvailability {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckMhsmNameAvailabilityResult])]
+[CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Subscription credentials which uniquely identify Microsoft Azure subscription.
+ # The subscription ID forms part of the URI for every service call.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='CheckExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String]
+ # The managed hsm name.
+ ${Name},
+
+ [Parameter(ParameterSetName='CheckViaJsonFilePath', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String]
+ # Path of Json file supplied to the Check operation
+ ${JsonFilePath},
+
+ [Parameter(ParameterSetName='CheckViaJsonString', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String]
+ # Json string supplied to the Check operation
+ ${JsonString},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ CheckExpanded = 'Az.KeyVault.private\Test-AzKeyVaultManagedHsmNameAvailability_CheckExpanded';
+ CheckViaJsonFilePath = 'Az.KeyVault.private\Test-AzKeyVaultManagedHsmNameAvailability_CheckViaJsonFilePath';
+ CheckViaJsonString = 'Az.KeyVault.private\Test-AzKeyVaultManagedHsmNameAvailability_CheckViaJsonString';
+ }
+ if (('CheckExpanded', 'CheckViaJsonFilePath', 'CheckViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Checks that the vault name is valid and is not already in use.
+.Description
+Checks that the vault name is valid and is not already in use.
+.Example
+Test-AzKeyVaultNameAvailability -Name test-kv0818
+.Example
+Test-AzKeyVaultNameAvailability -Name testkv
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckNameAvailabilityResult
+.Link
+https://learn.microsoft.com/powershell/module/az.keyvault/test-azkeyvaultnameavailability
+#>
+function Test-AzKeyVaultNameAvailability {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckNameAvailabilityResult])]
+[CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Subscription credentials which uniquely identify Microsoft Azure subscription.
+ # The subscription ID forms part of the URI for every service call.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='CheckExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String]
+ # The vault name.
+ ${Name},
+
+ [Parameter(ParameterSetName='CheckViaJsonFilePath', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String]
+ # Path of Json file supplied to the Check operation
+ ${JsonFilePath},
+
+ [Parameter(ParameterSetName='CheckViaJsonString', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String]
+ # Json string supplied to the Check operation
+ ${JsonString},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ CheckExpanded = 'Az.KeyVault.private\Test-AzKeyVaultNameAvailability_CheckExpanded';
+ CheckViaJsonFilePath = 'Az.KeyVault.private\Test-AzKeyVaultNameAvailability_CheckViaJsonFilePath';
+ CheckViaJsonString = 'Az.KeyVault.private\Test-AzKeyVaultNameAvailability_CheckViaJsonString';
+ }
+ if (('CheckExpanded', 'CheckViaJsonFilePath', 'CheckViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Description
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Example
+Add-AzKeyVaultManagedHsmRegion -HsmName testmhsm -ResourceGroupName test-rg -Region eastus2
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion
+.Link
+https://learn.microsoft.com/powershell/module/az.keyvault/add-azkeyvaultmanagedhsmregion
+#>
+function Add-AzKeyVaultManagedHsmRegion {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion])]
+[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the managed HSM Pool
+ ${HsmName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the resource group that contains the managed HSM pool.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Subscription credentials which uniquely identify Microsoft Azure subscription.
+ # The subscription ID forms part of the URI for every service call.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String[]]
+ # List of regions to be added associated with the managed hsm pool.
+ ${Region},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ __AllParameterSets = 'Az.KeyVault.custom\Add-AzKeyVaultManagedHsmRegion';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Description
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Example
+Remove-AzKeyVaultManagedHsmRegion -HsmName testmhsm -ResourceGroupName test-rg -Region eastus2 -PassThru
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion
+.Link
+https://learn.microsoft.com/powershell/module/az.keyvault/remove-azkeyvaultmanagedhsmregion
+#>
+function Remove-AzKeyVaultManagedHsmRegion {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion])]
+[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the managed HSM Pool
+ ${HsmName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the resource group that contains the managed HSM pool.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Subscription credentials which uniquely identify Microsoft Azure subscription.
+ # The subscription ID forms part of the URI for every service call.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String[]]
+ # List of regions to be removed associated with the managed hsm pool.
+ ${Region},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ __AllParameterSets = 'Az.KeyVault.custom\Remove-AzKeyVaultManagedHsmRegion';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/KeyVault/KeyVault.Autorest/exports/README.md b/src/KeyVault/KeyVault.Autorest/exports/README.md
new file mode 100644
index 000000000000..c5834afee838
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/exports/README.md
@@ -0,0 +1,20 @@
+# Exports
+This directory contains the cmdlets *exported by* `Az.KeyVault`. No other cmdlets in this repository are directly exported. What that means is the `Az.KeyVault` module will run [Export-ModuleMember](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation.
+
+## Info
+- Modifiable: no
+- Generated: all
+- Committed: no
+- Packaged: yes
+
+## Details
+The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`..\bin\Az.KeyVault.private.dll`) and from the `..\custom\Az.KeyVault.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [README.md](..\internal/README.md) in the `..\internal` folder.
+
+## Purpose
+We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles.
+
+## Structure
+The cmdlets generated here will flat in the directory (no sub-folders) as long as there are no Azure profiles specified for any cmdlets. Azure profiles (the `Profiles` attribute) is only applied when generating with the `--azure` attribute (or `azure: true` in the configuration). When Azure profiles are applied, the folder structure has a folder per profile. Each profile folder has only those cmdlets that apply to that profile.
+
+## Usage
+When `./Az.KeyVault.psm1` is loaded, it dynamically exports cmdlets here based on the folder structure and on the selected profile. If there are no sub-folders, it exports all cmdlets at the root of this folder. If there are sub-folders, it checks to see the selected profile. If no profile is selected, it exports the cmdlets in the last sub-folder (alphabetically). If a profile is selected, it exports the cmdlets in the sub-folder that matches the profile name. If there is no sub-folder that matches the profile name, it exports no cmdlets and writes a warning message.
\ No newline at end of file
diff --git a/src/KeyVault/KeyVault.Autorest/exports/Remove-AzKeyVaultManagedHsmRegion.ps1 b/src/KeyVault/KeyVault.Autorest/exports/Remove-AzKeyVaultManagedHsmRegion.ps1
new file mode 100644
index 000000000000..bc98b85f1002
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/exports/Remove-AzKeyVaultManagedHsmRegion.ps1
@@ -0,0 +1,196 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Description
+The List operation gets information about the regions associated with the managed HSM Pool.
+.Example
+Remove-AzKeyVaultManagedHsmRegion -HsmName testmhsm -ResourceGroupName test-rg -Region eastus2 -PassThru
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion
+.Link
+https://learn.microsoft.com/powershell/module/az.keyvault/remove-azkeyvaultmanagedhsmregion
+#>
+function Remove-AzKeyVaultManagedHsmRegion {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IMhsmGeoReplicatedRegion])]
+[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the managed HSM Pool
+ ${HsmName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [System.String]
+ # Name of the resource group that contains the managed HSM pool.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Subscription credentials which uniquely identify Microsoft Azure subscription.
+ # The subscription ID forms part of the URI for every service call.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String[]]
+ # List of regions to be removed associated with the managed hsm pool.
+ ${Region},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Run the command as a job
+ ${AsJob},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ __AllParameterSets = 'Az.KeyVault.custom\Remove-AzKeyVaultManagedHsmRegion';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/KeyVault/KeyVault.Autorest/exports/Test-AzKeyVaultManagedHsmNameAvailability.ps1 b/src/KeyVault/KeyVault.Autorest/exports/Test-AzKeyVaultManagedHsmNameAvailability.ps1
new file mode 100644
index 000000000000..71c0806ba629
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/exports/Test-AzKeyVaultManagedHsmNameAvailability.ps1
@@ -0,0 +1,188 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Checks that the managed hsm name is valid and is not already in use.
+.Description
+Checks that the managed hsm name is valid and is not already in use.
+.Example
+Test-AzKeyVaultManagedHsmNameAvailability -Name testmhsm0818
+.Example
+Test-AzKeyVaultNameAvailability -Name testmhsm
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckMhsmNameAvailabilityResult
+.Link
+https://learn.microsoft.com/powershell/module/az.keyvault/test-azkeyvaultmanagedhsmnameavailability
+#>
+function Test-AzKeyVaultManagedHsmNameAvailability {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckMhsmNameAvailabilityResult])]
+[CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Subscription credentials which uniquely identify Microsoft Azure subscription.
+ # The subscription ID forms part of the URI for every service call.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='CheckExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String]
+ # The managed hsm name.
+ ${Name},
+
+ [Parameter(ParameterSetName='CheckViaJsonFilePath', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String]
+ # Path of Json file supplied to the Check operation
+ ${JsonFilePath},
+
+ [Parameter(ParameterSetName='CheckViaJsonString', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String]
+ # Json string supplied to the Check operation
+ ${JsonString},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ CheckExpanded = 'Az.KeyVault.private\Test-AzKeyVaultManagedHsmNameAvailability_CheckExpanded';
+ CheckViaJsonFilePath = 'Az.KeyVault.private\Test-AzKeyVaultManagedHsmNameAvailability_CheckViaJsonFilePath';
+ CheckViaJsonString = 'Az.KeyVault.private\Test-AzKeyVaultManagedHsmNameAvailability_CheckViaJsonString';
+ }
+ if (('CheckExpanded', 'CheckViaJsonFilePath', 'CheckViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/KeyVault/KeyVault.Autorest/exports/Test-AzKeyVaultNameAvailability.ps1 b/src/KeyVault/KeyVault.Autorest/exports/Test-AzKeyVaultNameAvailability.ps1
new file mode 100644
index 000000000000..1b49448b6d7b
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/exports/Test-AzKeyVaultNameAvailability.ps1
@@ -0,0 +1,188 @@
+
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Checks that the vault name is valid and is not already in use.
+.Description
+Checks that the vault name is valid and is not already in use.
+.Example
+Test-AzKeyVaultNameAvailability -Name test-kv0818
+.Example
+Test-AzKeyVaultNameAvailability -Name testkv
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckNameAvailabilityResult
+.Link
+https://learn.microsoft.com/powershell/module/az.keyvault/test-azkeyvaultnameavailability
+#>
+function Test-AzKeyVaultNameAvailability {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckNameAvailabilityResult])]
+[CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Subscription credentials which uniquely identify Microsoft Azure subscription.
+ # The subscription ID forms part of the URI for every service call.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='CheckExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String]
+ # The vault name.
+ ${Name},
+
+ [Parameter(ParameterSetName='CheckViaJsonFilePath', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String]
+ # Path of Json file supplied to the Check operation
+ ${JsonFilePath},
+
+ [Parameter(ParameterSetName='CheckViaJsonString', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Body')]
+ [System.String]
+ # Json string supplied to the Check operation
+ ${JsonString},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The DefaultProfile parameter is not functional.
+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ CheckExpanded = 'Az.KeyVault.private\Test-AzKeyVaultNameAvailability_CheckExpanded';
+ CheckViaJsonFilePath = 'Az.KeyVault.private\Test-AzKeyVaultNameAvailability_CheckViaJsonFilePath';
+ CheckViaJsonString = 'Az.KeyVault.private\Test-AzKeyVaultNameAvailability_CheckViaJsonString';
+ }
+ if (('CheckExpanded', 'CheckViaJsonFilePath', 'CheckViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/KeyVault/KeyVault.Autorest/generate-help.ps1 b/src/KeyVault/KeyVault.Autorest/generate-help.ps1
new file mode 100644
index 000000000000..5ef6f322d5af
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/generate-help.ps1
@@ -0,0 +1,74 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $NotIsolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+ return
+}
+
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+if(-not (Test-Path $exportsFolder)) {
+ Write-Error "Exports folder '$exportsFolder' was not found."
+}
+
+$directories = Get-ChildItem -Directory -Path $exportsFolder
+$hasProfiles = ($directories | Measure-Object).Count -gt 0
+if(-not $hasProfiles) {
+ $directories = Get-Item -Path $exportsFolder
+}
+
+$docsFolder = Join-Path $PSScriptRoot 'docs'
+if(Test-Path $docsFolder) {
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $docsFolder -ErrorAction SilentlyContinue
+$examplesFolder = Join-Path $PSScriptRoot 'examples'
+
+$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.KeyVault.psd1')
+$modulePath = $modulePsd1.FullName
+$moduleName = $modulePsd1.BaseName
+
+# Load DLL to use build-time cmdlets
+Import-Module -Name $modulePath
+Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.KeyVault.private.dll')
+$instance = [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Module]::Instance
+# Module info is shared per profile
+$moduleInfo = Get-Module -Name $moduleName
+
+foreach($directory in $directories)
+{
+ if($hasProfiles) {
+ Select-AzProfile -Name $directory.Name
+ }
+ # Reload module per profile
+ Import-Module -Name $modulePath -Force
+
+ $cmdletNames = Get-ScriptCmdlet -ScriptFolder $directory.FullName
+ $cmdletHelpInfo = $cmdletNames | ForEach-Object { Get-Help -Name $_ -Full }
+ $cmdletFunctionInfo = Get-ScriptCmdlet -ScriptFolder $directory.FullName -AsFunctionInfo
+
+ $docsPath = Join-Path $docsFolder $directory.Name
+ $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue
+ $examplesPath = Join-Path $examplesFolder $directory.Name
+ $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
+ Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath -AddComplexInterfaceInfo:$addComplexInterfaceInfo
+ Write-Host -ForegroundColor Green "Created documentation in '$docsPath'"
+}
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
\ No newline at end of file
diff --git a/src/KeyVault/KeyVault.Autorest/generate-info.json b/src/KeyVault/KeyVault.Autorest/generate-info.json
new file mode 100644
index 000000000000..ae7324df85de
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/generate-info.json
@@ -0,0 +1,8 @@
+{
+ "swagger_commit": "7a929a631841e4401b7df995ce03d73af3e177f6",
+ "autorest_core": "3.9.7",
+ "node": "v14.15.5",
+ "autorest": "`-- (empty)",
+ "autorest_modelerfour": "4.26.2",
+ "autorest_powershell": "4.0.631"
+}
diff --git a/src/KeyVault/KeyVault.Autorest/generate-portal-ux.ps1 b/src/KeyVault/KeyVault.Autorest/generate-portal-ux.ps1
new file mode 100644
index 000000000000..2601b2037349
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/generate-portal-ux.ps1
@@ -0,0 +1,390 @@
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+param([switch]$NotIsolated)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $NotIsolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
+ return
+}
+
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+if(-not (Test-Path $exportsFolder)) {
+ Write-Error "Exports folder '$exportsFolder' was not found."
+}
+
+$directories = Get-ChildItem -Directory -Path $exportsFolder
+$hasProfiles = ($directories | Measure-Object).Count -gt 0
+if(-not $hasProfiles) {
+ $directories = Get-Item -Path $exportsFolder
+}
+
+$docsFolder = Join-Path $PSScriptRoot 'docs'
+if(Test-Path $docsFolder) {
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $docsFolder -ErrorAction SilentlyContinue
+
+$moduleName = 'Az.KeyVault'
+$rootModuleName = ''
+if ($rootModuleName -eq "")
+{
+ $rootModuleName = $moduleName
+}
+$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot "./$moduleName.psd1")
+$modulePath = $modulePsd1.FullName
+
+# Load DLL to use build-time cmdlets
+Import-Module -Name $modulePath
+Import-Module -Name (Join-Path $PSScriptRoot "./bin/$moduleName.private.dll")
+$instance = [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Module]::Instance
+# Module info is shared per profile
+$moduleInfo = Get-Module -Name $moduleName
+$parameterSetsInfo = Get-Module -Name "$moduleName.private"
+
+$buildinFunctions = @("Export-CmdletSurface", "Export-ExampleStub", "Export-FormatPs1xml", "Export-HelpMarkdown", "Export-ModelSurface", "Export-ProxyCmdlet", "Export-Psd1", "Export-TestStub", "Get-CommonParameter", "Get-ModuleGuid", "Get-ScriptCmdlet")
+
+function Test-FunctionSupported()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [string]
+ $FunctionName
+ )
+
+ If ($buildinfunctions.Contains($FunctionName)) {
+ return $false
+ }
+
+ $cmdletName, $parameterSetName = $FunctionName.Split("_")
+ If ($parameterSetName.Contains("List") -or $parameterSetName.Contains("ViaIdentity")) {
+ return $false
+ }
+ If ($cmdletName.StartsWith("New") -or $cmdletName.StartsWith("Set") -or $cmdletName.StartsWith("Update")) {
+ return $false
+ }
+
+ $parameterSetInfo = $parameterSetsInfo.ExportedCmdlets[$FunctionName]
+ foreach ($parameterInfo in $parameterSetInfo.Parameters.Values)
+ {
+ $category = (Get-ParameterAttribute -ParameterInfo $parameterInfo -AttributeName "CategoryAttribute").Categories
+ $invalideCategory = @('Query', 'Body')
+ if ($invalideCategory -contains $category)
+ {
+ return $false
+ }
+ }
+
+ $customFiles = Get-ChildItem -Path custom -Filter "$cmdletName.*"
+ if ($customFiles.Length -ne 0)
+ {
+ Write-Host -ForegroundColor Yellow "There are come custom files for $cmdletName, skip generate UX data for it."
+ return $false
+ }
+
+ return $true
+}
+
+function Get-MappedCmdletFromFunctionName()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [string]
+ $FunctionName
+ )
+
+ $cmdletName, $parameterSetName = $FunctionName.Split("_")
+
+ return $cmdletName
+}
+
+function Get-ParameterAttribute()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [System.Management.Automation.ParameterMetadata]
+ $ParameterInfo,
+ [Parameter()]
+ [String]
+ $AttributeName
+ )
+ return $ParameterInfo.Attributes | Where-Object { $_.TypeId.Name -eq $AttributeName }
+}
+
+function Get-CmdletAttribute()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [System.Management.Automation.CommandInfo]
+ $CmdletInfo,
+ [Parameter()]
+ [String]
+ $AttributeName
+ )
+
+ return $CmdletInfo.ImplementingType.GetTypeInfo().GetCustomAttributes([System.object], $true) | Where-Object { $_.TypeId.Name -eq $AttributeName }
+}
+
+function Get-CmdletDescription()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [String]
+ $CmdletName
+ )
+ $helpInfo = Get-Help $CmdletName -Full
+
+ $description = $helpInfo.Description.Text
+ if ($null -eq $description)
+ {
+ return ""
+ }
+ return $description
+}
+
+# Test whether the parameter is from swagger http path
+function Test-ParameterFromSwagger()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [System.Management.Automation.ParameterMetadata]
+ $ParameterInfo
+ )
+ $category = (Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "CategoryAttribute").Categories
+ $doNotExport = Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "DoNotExportAttribute"
+ if ($null -ne $doNotExport)
+ {
+ return $false
+ }
+
+ $valideCategory = @('Path')
+ if ($valideCategory -contains $category)
+ {
+ return $true
+ }
+ return $false
+}
+
+function New-ExampleForParameterSet()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [System.Management.Automation.CommandInfo]
+ $ParameterSetInfo
+ )
+ $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ }
+ $result = @()
+ foreach ($parameter in $parameters)
+ {
+ $category = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "CategoryAttribute").Categories
+ $sourceName = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "InfoAttribute").SerializedName
+ $name = $parameter.Name
+ $result += [ordered]@{
+ name = "-$Name"
+ value = "[$category.$sourceName]"
+ }
+ }
+
+ return $result
+}
+
+function New-ParameterArrayInParameterSet()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [System.Management.Automation.CommandInfo]
+ $ParameterSetInfo
+ )
+ $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ }
+ $result = @()
+ foreach ($parameter in $parameters)
+ {
+ $isMandatory = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "ParameterAttribute").Mandatory
+ $parameterName = $parameter.Name
+ $parameterType = $parameter.ParameterType.ToString().Split('.')[1]
+ if ($parameter.SwitchParameter)
+ {
+ $parameterSignature = "-$parameterName"
+ }
+ else
+ {
+ $parameterSignature = "-$parameterName <$parameterType>"
+ }
+ if ($parameterName -eq "SubscriptionId")
+ {
+ $isMandatory = $false
+ }
+ if (-not $isMandatory)
+ {
+ $parameterSignature = "[$parameterSignature]"
+ }
+ $result += $parameterSignature
+ }
+
+ return $result
+}
+
+function New-MetadataForParameterSet()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [System.Management.Automation.CommandInfo]
+ $ParameterSetInfo
+ )
+ $httpAttribute = Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "HttpPathAttribute"
+ $httpPath = $httpAttribute.Path
+ $apiVersion = $httpAttribute.ApiVersion
+ $provider = [System.Text.RegularExpressions.Regex]::New("/providers/([\w+\.]+)/").Match($httpPath).Groups[1].Value
+ $resourcePath = "/" + $httpPath.Split("$provider/")[1]
+ $resourceType = [System.Text.RegularExpressions.Regex]::New("/([\w]+)/\{\w+\}").Matches($resourcePath) | ForEach-Object {$_.groups[1].Value} | Join-String -Separator "/"
+ $cmdletName = Get-MappedCmdletFromFunctionName $ParameterSetInfo.Name
+ $description = (Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "DescriptionAttribute").Description
+ [object[]]$example = New-ExampleForParameterSet $ParameterSetInfo
+ [string[]]$signature = New-ParameterArrayInParameterSet $ParameterSetInfo
+
+ return @{
+ Path = $httpPath
+ Provider = $provider
+ ResourceType = $resourceType
+ ApiVersion = $apiVersion
+ CmdletName = $cmdletName
+ Description = $description
+ Example = $example
+ Signature = @{
+ parameters = $signature
+ }
+ }
+}
+
+function Merge-WithExistCmdletMetadata()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [System.Collections.Specialized.OrderedDictionary]
+ $ExistedCmdletInfo,
+ [Parameter()]
+ [Hashtable]
+ $ParameterSetMetadata
+ )
+ $ExistedCmdletInfo.help.parameterSets += $ParameterSetMetadata.Signature
+ $ExistedCmdletInfo.examples += [ordered]@{
+ description = $ParameterSetMetadata.Description
+ parameters = $ParameterSetMetadata.Example
+ }
+
+ return $ExistedCmdletInfo
+}
+
+function New-MetadataForCmdlet()
+{
+ [CmdletBinding()]
+ Param (
+ [Parameter()]
+ [Hashtable]
+ $ParameterSetMetadata
+ )
+ $cmdletName = $ParameterSetMetadata.CmdletName
+ $description = Get-CmdletDescription $cmdletName
+ $result = [ordered]@{
+ name = $cmdletName
+ description = $description
+ path = $ParameterSetMetadata.Path
+ help = [ordered]@{
+ learnMore = [ordered]@{
+ url = "https://learn.microsoft.com/powershell/module/$rootModuleName/$cmdletName".ToLower()
+ }
+ parameterSets = @()
+ }
+ examples = @()
+ }
+ $result = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $result -ParameterSetMetadata $ParameterSetMetadata
+ return $result
+}
+
+$parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-functionSupported($_) }
+$resourceTypes = @{}
+foreach ($parameterSetName in $parameterSets)
+{
+ $cmdletInfo = $parameterSetsInfo.ExportedCommands[$parameterSetName]
+ $parameterSetMetadata = New-MetadataForParameterSet -ParameterSetInfo $cmdletInfo
+ $cmdletName = $parameterSetMetadata.CmdletName
+ if (-not ($moduleInfo.ExportedCommands.ContainsKey($cmdletName)))
+ {
+ continue
+ }
+ if ($resourceTypes.ContainsKey($parameterSetMetadata.ResourceType))
+ {
+ $ExistedCmdletInfo = $resourceTypes[$parameterSetMetadata.ResourceType].commands | Where-Object { $_.name -eq $cmdletName }
+ if ($ExistedCmdletInfo)
+ {
+ $ExistedCmdletInfo = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $ExistedCmdletInfo -ParameterSetMetadata $parameterSetMetadata
+ }
+ else
+ {
+ $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata
+ $resourceTypes[$parameterSetMetadata.ResourceType].commands += $cmdletInfo
+ }
+ }
+ else
+ {
+ $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata
+ $resourceTypes[$parameterSetMetadata.ResourceType] = [ordered]@{
+ resourceType = $parameterSetMetadata.ResourceType
+ apiVersion = $parameterSetMetadata.ApiVersion
+ learnMore = @{
+ url = "https://learn.microsoft.com/powershell/module/$rootModuleName".ToLower()
+ }
+ commands = @($cmdletInfo)
+ provider = $parameterSetMetadata.Provider
+ }
+ }
+}
+
+$UXFolder = 'UX'
+if (Test-Path $UXFolder)
+{
+ Remove-Item -Path $UXFolder -Recurse
+}
+$null = New-Item -ItemType Directory -Path $UXFolder
+
+foreach ($resourceType in $resourceTypes.Keys)
+{
+ $resourceTypeFileName = $resourceType -replace "/", "-"
+ if ($resourceTypeFileName -eq "")
+ {
+ continue
+ }
+ $resourceTypeInfo = $resourceTypes[$resourceType]
+ $provider = $resourceTypeInfo.provider
+ $providerFolder = "$UXFolder/$provider"
+ if (-not (Test-Path $providerFolder))
+ {
+ $null = New-Item -ItemType Directory -Path $providerFolder
+ }
+ $resourceTypeInfo.Remove("provider")
+ $resourceTypeInfo | ConvertTo-Json -Depth 10 | Out-File "$providerFolder/$resourceTypeFileName.json"
+}
diff --git a/src/KeyVault/KeyVault.Autorest/generated/Module.cs b/src/KeyVault/KeyVault.Autorest/generated/Module.cs
new file mode 100644
index 000000000000..0bebcf1f989a
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/generated/Module.cs
@@ -0,0 +1,181 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.KeyVault
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Extensions;
+ using SendAsyncStepDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>;
+ using PipelineChangeDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>;
+ using GetParameterDelegate = global::System.Func;
+ using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>;
+ using ArgumentCompleterDelegate = global::System.Func;
+ using GetTelemetryIdDelegate = global::System.Func;
+ using TelemetryDelegate = global::System.Action;
+ using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>;
+ using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>;
+ using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>;
+ using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>;
+
+ /// A class that contains the module-common code and data.
+ public partial class Module
+ {
+ /// The currently selected profile.
+ public string Profile = global::System.String.Empty;
+
+ public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler();
+
+ /// the ISendAsync pipeline instance
+ private Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.HttpPipeline _pipeline;
+
+ /// the ISendAsync pipeline instance (when proxy is enabled)
+ private Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.HttpPipeline _pipelineWithProxy;
+
+ public bool _useProxy = false;
+
+ public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy();
+
+ /// Gets completion data for azure specific fields
+ public ArgumentCompleterDelegate ArgumentCompleter { get; set; }
+
+ /// The instance of the Client API
+ public Microsoft.Azure.PowerShell.Cmdlets.KeyVault.KeyVault ClientAPI { get; set; }
+
+ /// A delegate that gets called for each signalled event
+ public EventListenerDelegate EventListener { get; set; }
+
+ /// The delegate to call to get parameter data from a common module.
+ public GetParameterDelegate GetParameterValue { get; set; }
+
+ /// The delegate to get the telemetry Id.
+ public GetTelemetryIdDelegate GetTelemetryId { get; set; }
+
+ /// Backing field for property.
+ private static Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Module _instance;
+
+ /// the singleton of this module class
+ public static Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Module());
+
+ /// The Name of this module
+ public string Name => @"Az.KeyVault";
+
+ /// The delegate to call when this module is loaded (supporting a commmon module).
+ public ModuleLoadPipelineDelegate OnModuleLoad { get; set; }
+
+ /// The delegate to call before each new request (supporting a commmon module).
+ public NewRequestPipelineDelegate OnNewRequest { get; set; }
+
+ /// The name of the currently selected Azure profile
+ public global::System.String ProfileName { get; set; }
+
+ /// The ResourceID for this module (azure arm).
+ public string ResourceId => @"Az.KeyVault";
+
+ /// The delegate for creating a telemetry.
+ public TelemetryDelegate Telemetry { get; set; }
+
+ /// The from the cmdlet
+ /// The HttpPipeline for the request
+
+ partial void AfterCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.HttpPipeline pipeline);
+
+ /// The from the cmdlet
+ /// The HttpPipeline for the request
+
+ partial void BeforeCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.HttpPipeline pipeline);
+
+ partial void CustomInit();
+
+ /// Creates an instance of the HttpPipeline for each call.
+ /// The from the cmdlet
+ /// the cmdlet's correlation id.
+ /// the cmdlet's process record correlation id.
+ /// the cmdlet's parameterset name.
+ /// a dict for extensible parameters
+ /// An instance of Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.HttpPipeline for the remote call.
+ public Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.HttpPipeline CreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string processRecordId, string parameterSetName = null, global::System.Collections.Generic.IDictionary extensibleParameters = null)
+ {
+ Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.HttpPipeline pipeline = null;
+ BeforeCreatePipeline(invocationInfo, ref pipeline);
+ pipeline = (pipeline ?? (_useProxy ? _pipelineWithProxy : _pipeline)).Clone();
+ AfterCreatePipeline(invocationInfo, ref pipeline);
+ pipeline.Append(new Runtime.CmdInfoHandler(processRecordId, invocationInfo, parameterSetName).SendAsync);
+ OnNewRequest?.Invoke( invocationInfo, correlationId,processRecordId, (step)=> { pipeline.Prepend(step); } , (step)=> { pipeline.Append(step); } );
+ return pipeline;
+ }
+
+ /// Gets parameters from a common module.
+ /// The from the cmdlet
+ /// the cmdlet's correlation id.
+ /// The name of the parameter to get the value for.
+ ///
+ /// The parameter value from the common module. (Note: this should be type converted on the way back)
+ ///
+ public object GetParameter(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string parameterName) => GetParameterValue?.Invoke( ResourceId, Name, invocationInfo, correlationId,parameterName );
+
+ /// Initialization steps performed after the module is loaded.
+ public void Init()
+ {
+ OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } );
+ OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } );
+ CustomInit();
+ }
+
+ /// Creates the module instance.
+ private Module()
+ {
+ // constructor
+ ClientAPI = new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.KeyVault();
+ _handler.Proxy = _webProxy;
+ _pipeline = new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient()));
+ _pipelineWithProxy = new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient(_handler)));
+ }
+
+ /// The HTTP Proxy to use.
+ /// The HTTP Proxy Credentials
+ /// True if the proxy should use default credentials
+ public void SetProxyConfiguration(global::System.Uri proxy, global::System.Management.Automation.PSCredential proxyCredential, bool proxyUseDefaultCredentials)
+ {
+ _useProxy = proxy != null;
+ if (proxy == null)
+ {
+ return;
+ }
+ // set the proxy configuration
+ _webProxy.Address = proxy;
+ _webProxy.BypassProxyOnLocal = false;
+ if (proxyUseDefaultCredentials)
+ {
+ _webProxy.Credentials = null;
+ _webProxy.UseDefaultCredentials = true;
+ }
+ else
+ {
+ _webProxy.UseDefaultCredentials = false;
+ _webProxy.Credentials = proxyCredential ?.GetNetworkCredential();
+ }
+ }
+
+ /// Called to dispatch events to the common module listener
+ /// The ID of the event
+ /// The cancellation token for the event
+ /// A delegate to get the detailed event data
+ /// The callback for the event dispatcher
+ /// The from the cmdlet
+ /// the cmdlet's parameterset name.
+ /// the cmdlet's correlation id.
+ /// the cmdlet's process record correlation id.
+ /// the exception that is being thrown (if available)
+ ///
+ /// A that will be complete when handling of the event is completed.
+ ///
+ public async global::System.Threading.Tasks.Task Signal(string id, global::System.Threading.CancellationToken token, global::System.Func getEventData, SignalDelegate signal, global::System.Management.Automation.InvocationInfo invocationInfo, string parameterSetName, string correlationId, string processRecordId, global::System.Exception exception)
+ {
+ using( NoSynchronizationContext )
+ {
+ await EventListener?.Invoke(id,token,getEventData, signal, invocationInfo, parameterSetName, correlationId,processRecordId,exception);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/KeyVault/KeyVault.Autorest/generated/api/KeyVault.cs b/src/KeyVault/KeyVault.Autorest/generated/api/KeyVault.cs
new file mode 100644
index 000000000000..8906556596a2
--- /dev/null
+++ b/src/KeyVault/KeyVault.Autorest/generated/api/KeyVault.cs
@@ -0,0 +1,12616 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.KeyVault
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Extensions;
+
+ ///
+ /// Low-level API implementation for the KeyVault service.
+ /// The Azure management API provides a RESTful set of web services that interact with Azure Key Vault.
+ ///
+ public partial class KeyVault
+ {
+
+ /// Checks that the managed hsm name is valid and is not already in use.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// The name of the managed hsm.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsCheckNameAvailability(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckMhsmNameAvailabilityParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.KeyVault/checkMhsmNameAvailability"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsCheckNameAvailability_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Checks that the managed hsm name is valid and is not already in use.
+ ///
+ /// The name of the managed hsm.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsCheckNameAvailabilityViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckMhsmNameAvailabilityParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.KeyVault$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/providers/Microsoft.KeyVault/checkMhsmNameAvailability"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsCheckNameAvailability_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Checks that the managed hsm name is valid and is not already in use.
+ ///
+ /// The name of the managed hsm.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsCheckNameAvailabilityViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckMhsmNameAvailabilityParameters body, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.KeyVault$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/providers/Microsoft.KeyVault/checkMhsmNameAvailability"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsCheckNameAvailabilityWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Checks that the managed hsm name is valid and is not already in use.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Json string supplied to the ManagedHsmsCheckNameAvailability operation
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsCheckNameAvailabilityViaJsonString(string subscriptionId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.KeyVault/checkMhsmNameAvailability"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsCheckNameAvailability_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Checks that the managed hsm name is valid and is not already in use.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Json string supplied to the ManagedHsmsCheckNameAvailability operation
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsCheckNameAvailabilityViaJsonStringWithResult(string subscriptionId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.KeyVault/checkMhsmNameAvailability"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsCheckNameAvailabilityWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Checks that the managed hsm name is valid and is not already in use.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// The name of the managed hsm.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsCheckNameAvailabilityWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckMhsmNameAvailabilityParameters body, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.KeyVault/checkMhsmNameAvailability"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsCheckNameAvailabilityWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ ///
+ /// Actual wire call for method.
+ ///
+ /// the prepared HttpRequestMessage to send.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsCheckNameAvailabilityWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.CheckMhsmNameAvailabilityResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ // Error Response : default
+ var code = (await _result)?.Code;
+ var message = (await _result)?.Message;
+ if ((null == code || null == message))
+ {
+ // Unrecognized Response. Create an error record based on what we have.
+ var ex = new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.RestException(_response, await _result);
+ throw ex;
+ }
+ else
+ {
+ throw new global::System.Exception($"[{code}] : {message}");
+ }
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsCheckNameAvailability_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.CheckMhsmNameAvailabilityResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you
+ /// will get validation events back.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// The name of the managed hsm.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsCheckNameAvailability_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ICheckMhsmNameAvailabilityParameters body, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(body), body);
+ await eventListener.AssertObjectIsValid(nameof(body), body);
+ }
+ }
+
+ /// Create a managed HSM Pool in the specified subscription.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Name of the managed HSM Pool
+ /// Parameters to create or update the managed HSM Pool
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsCreateOrUpdate(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IManagedHsm body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Create a managed HSM Pool in the specified subscription.
+ ///
+ /// Parameters to create or update the managed HSM Pool
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IManagedHsm body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.KeyVault/managedHSMs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var name = _match.Groups["name"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + name
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Create a managed HSM Pool in the specified subscription.
+ ///
+ /// Parameters to create or update the managed HSM Pool
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that
+ /// will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IManagedHsm body, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.KeyVault/managedHSMs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var name = _match.Groups["name"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + name
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsCreateOrUpdateWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Create a managed HSM Pool in the specified subscription.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Name of the managed HSM Pool
+ /// Json string supplied to the ManagedHsmsCreateOrUpdate operation
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string name, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Create a managed HSM Pool in the specified subscription.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Name of the managed HSM Pool
+ /// Json string supplied to the ManagedHsmsCreateOrUpdate operation
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that
+ /// will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string name, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsCreateOrUpdateWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Create a managed HSM Pool in the specified subscription.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Name of the managed HSM Pool
+ /// Parameters to create or update the managed HSM Pool
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that
+ /// will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IManagedHsm body, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsCreateOrUpdateWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ ///
+ /// Actual wire call for method.
+ ///
+ /// the prepared HttpRequestMessage to send.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that
+ /// will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // this operation supports x-ms-long-running-operation
+ var _originalUri = request.RequestUri.AbsoluteUri;
+ // declared final-state-via: default
+ var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ var location = _response.GetFirstHeader(@"Location");
+ while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ // delay before making the next polling request
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // while we wait, let's grab the headers and get ready to poll.
+ if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) {
+ asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ }
+ if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) {
+ location = _response.GetFirstHeader(@"Location");
+ }
+ var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation;
+ request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get);
+
+ // and let's look at the current response body and see if we have some information we can give back to the listener
+ var content = await _response.Content.ReadAsStringAsync();
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the polling call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // if we got back an OK, take a peek inside and see if it's done
+ if( _response.StatusCode == global::System.Net.HttpStatusCode.OK)
+ {
+ var error = false;
+ try {
+ if( Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonObject json)
+ {
+ var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status");
+ if( state is null )
+ {
+ // the body doesn't contain any information that has the state of the LRO
+ // we're going to just get out, and let the consumer have the result
+ break;
+ }
+
+ switch( state?.ToString()?.ToLower() )
+ {
+ case "failed":
+ error = true;
+ break;
+ case "succeeded":
+ case "canceled":
+ // we're done polling.
+ break;
+
+ default:
+ // need to keep polling!
+ _response.StatusCode = global::System.Net.HttpStatusCode.Created;
+ continue;
+ }
+ }
+ } catch {
+ // if we run into a problem peeking into the result,
+ // we really don't want to do anything special.
+ }
+ if (error) {
+ throw new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.UndeclaredResponseException(_response);
+ }
+ }
+
+ // check for terminal status code
+ if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ continue;
+ }
+ // we are done polling, do a request on final target?
+ if (!string.IsNullOrWhiteSpace(_originalUri))
+ {
+ // create a new request with the final uri
+ request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get);
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the final call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ break;
+ }
+ }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsm.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ // Error Response : default
+ var code = (await _result)?.Error?.Code;
+ var message = (await _result)?.Error?.Message;
+ if ((null == code || null == message))
+ {
+ // Unrecognized Response. Create an error record based on what we have.
+ var ex = new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.RestException(_response, await _result);
+ throw ex;
+ }
+ else
+ {
+ throw new global::System.Exception($"[{code}] : {message}");
+ }
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // this operation supports x-ms-long-running-operation
+ var _originalUri = request.RequestUri.AbsoluteUri;
+ // declared final-state-via: default
+ var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ var location = _response.GetFirstHeader(@"Location");
+ while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ // delay before making the next polling request
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // while we wait, let's grab the headers and get ready to poll.
+ if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) {
+ asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ }
+ if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) {
+ location = _response.GetFirstHeader(@"Location");
+ }
+ var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation;
+ request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get);
+
+ // and let's look at the current response body and see if we have some information we can give back to the listener
+ var content = await _response.Content.ReadAsStringAsync();
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the polling call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // if we got back an OK, take a peek inside and see if it's done
+ if( _response.StatusCode == global::System.Net.HttpStatusCode.OK)
+ {
+ var error = false;
+ try {
+ if( Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonObject json)
+ {
+ var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status");
+ if( state is null )
+ {
+ // the body doesn't contain any information that has the state of the LRO
+ // we're going to just get out, and let the consumer have the result
+ break;
+ }
+
+ switch( state?.ToString()?.ToLower() )
+ {
+ case "failed":
+ error = true;
+ break;
+ case "succeeded":
+ case "canceled":
+ // we're done polling.
+ break;
+
+ default:
+ // need to keep polling!
+ _response.StatusCode = global::System.Net.HttpStatusCode.Created;
+ continue;
+ }
+ }
+ } catch {
+ // if we run into a problem peeking into the result,
+ // we really don't want to do anything special.
+ }
+ if (error) {
+ throw new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.UndeclaredResponseException(_response);
+ }
+ }
+
+ // check for terminal status code
+ if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ continue;
+ }
+ // we are done polling, do a request on final target?
+ if (!string.IsNullOrWhiteSpace(_originalUri))
+ {
+ // create a new request with the final uri
+ request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get);
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the final call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ break;
+ }
+ }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsm.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get
+ /// validation events back.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Name of the managed HSM Pool
+ /// Parameters to create or update the managed HSM Pool
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IManagedHsm body, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertNotNull(nameof(name),name);
+ await eventListener.AssertNotNull(nameof(body), body);
+ await eventListener.AssertObjectIsValid(nameof(body), body);
+ }
+ }
+
+ /// Deletes the specified managed HSM Pool.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// The name of the managed HSM Pool to delete
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsDelete(string subscriptionId, string resourceGroupName, string name, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Delete, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Deletes the specified managed HSM Pool.
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.KeyVault/managedHSMs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var name = _match.Groups["name"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + name
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Delete, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // this operation supports x-ms-long-running-operation
+ var _originalUri = request.RequestUri.AbsoluteUri;
+ // declared final-state-via: default
+ var _finalUri = _response.GetFirstHeader(@"Location");
+ var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ var location = _response.GetFirstHeader(@"Location");
+ while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ // delay before making the next polling request
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // while we wait, let's grab the headers and get ready to poll.
+ if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) {
+ asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ }
+ if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) {
+ location = _response.GetFirstHeader(@"Location");
+ }
+ var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation;
+ request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get);
+
+ // and let's look at the current response body and see if we have some information we can give back to the listener
+ var content = await _response.Content.ReadAsStringAsync();
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the polling call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // if we got back an OK, take a peek inside and see if it's done
+ if( _response.StatusCode == global::System.Net.HttpStatusCode.OK)
+ {
+ var error = false;
+ try {
+ if( Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonObject json)
+ {
+ var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status");
+ if( state is null )
+ {
+ // the body doesn't contain any information that has the state of the LRO
+ // we're going to just get out, and let the consumer have the result
+ break;
+ }
+
+ switch( state?.ToString()?.ToLower() )
+ {
+ case "failed":
+ error = true;
+ break;
+ case "succeeded":
+ case "canceled":
+ // we're done polling.
+ break;
+
+ default:
+ // need to keep polling!
+ _response.StatusCode = global::System.Net.HttpStatusCode.Created;
+ continue;
+ }
+ }
+ } catch {
+ // if we run into a problem peeking into the result,
+ // we really don't want to do anything special.
+ }
+ if (error) {
+ throw new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.UndeclaredResponseException(_response);
+ }
+ }
+
+ // check for terminal status code
+ if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ continue;
+ }
+ // we are done polling, do a request on final target?
+ if (!string.IsNullOrWhiteSpace(_finalUri))
+ {
+ // create a new request with the final uri
+ request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get);
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the final call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ break;
+ }
+ }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response);
+ break;
+ }
+ case global::System.Net.HttpStatusCode.NoContent:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onNoContent(_response);
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// The name of the managed HSM Pool to delete
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsDelete_Validate(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertNotNull(nameof(name),name);
+ }
+ }
+
+ /// Gets the specified managed HSM Pool.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// The name of the managed HSM Pool.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsGet(string subscriptionId, string resourceGroupName, string name, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsGet_Call (request, onOk,onNoContent,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Gets the specified deleted managed HSM.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// The name of the deleted managed HSM.
+ /// The location of the deleted managed HSM.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsGetDeleted(string subscriptionId, string name, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.KeyVault/locations/"
+ + global::System.Uri.EscapeDataString(location)
+ + "/deletedManagedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsGetDeleted_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Gets the specified deleted managed HSM.
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsGetDeletedViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.KeyVault/locations/(?[^/]+)/deletedManagedHSMs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedManagedHSMs/{name}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var name = _match.Groups["name"].Value;
+ var location = _match.Groups["location"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/providers/Microsoft.KeyVault/locations/"
+ + location
+ + "/deletedManagedHSMs/"
+ + name
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsGetDeleted_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Gets the specified deleted managed HSM.
+ ///
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsGetDeletedViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.KeyVault/locations/(?[^/]+)/deletedManagedHSMs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedManagedHSMs/{name}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var name = _match.Groups["name"].Value;
+ var location = _match.Groups["location"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/providers/Microsoft.KeyVault/locations/"
+ + location
+ + "/deletedManagedHSMs/"
+ + name
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsGetDeletedWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Gets the specified deleted managed HSM.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// The name of the deleted managed HSM.
+ /// The location of the deleted managed HSM.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsGetDeletedWithResult(string subscriptionId, string name, string location, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.KeyVault/locations/"
+ + global::System.Uri.EscapeDataString(location)
+ + "/deletedManagedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsGetDeletedWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsGetDeletedWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedManagedHsm.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ // Error Response : default
+ var code = (await _result)?.Error?.Code;
+ var message = (await _result)?.Error?.Message;
+ if ((null == code || null == message))
+ {
+ // Unrecognized Response. Create an error record based on what we have.
+ var ex = new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.RestException(_response, await _result);
+ throw ex;
+ }
+ else
+ {
+ throw new global::System.Exception($"[{code}] : {message}");
+ }
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsGetDeleted_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedManagedHsm.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// The name of the deleted managed HSM.
+ /// The location of the deleted managed HSM.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsGetDeleted_Validate(string subscriptionId, string name, string location, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(name),name);
+ await eventListener.AssertNotNull(nameof(location),location);
+ }
+ }
+
+ /// Gets the specified managed HSM Pool.
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.KeyVault/managedHSMs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var name = _match.Groups["name"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + name
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsGet_Call (request, onOk,onNoContent,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Gets the specified managed HSM Pool.
+ ///
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that
+ /// will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.KeyVault/managedHSMs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var name = _match.Groups["name"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + name
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsGetWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Gets the specified managed HSM Pool.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// The name of the managed HSM Pool.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that
+ /// will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsGetWithResult(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsGetWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that
+ /// will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsm.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ case global::System.Net.HttpStatusCode.NoContent:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ throw new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.UndeclaredResponseException(_response);
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ // Error Response : default
+ var code = (await _result)?.Error?.Code;
+ var message = (await _result)?.Error?.Message;
+ if ((null == code || null == message))
+ {
+ // Unrecognized Response. Create an error record based on what we have.
+ var ex = new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.RestException(_response, await _result);
+ throw ex;
+ }
+ else
+ {
+ throw new global::System.Exception($"[{code}] : {message}");
+ }
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsm.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ case global::System.Net.HttpStatusCode.NoContent:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onNoContent(_response);
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// The name of the managed HSM Pool.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsGet_Validate(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertNotNull(nameof(name),name);
+ }
+ }
+
+ ///
+ /// The List operation gets information about the managed HSM Pools associated with the subscription and within the specified
+ /// resource group.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Maximum number of results to return.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsListByResourceGroup(string subscriptionId, string resourceGroupName, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs"
+ + "?"
+ + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString()))
+ + "&"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// The List operation gets information about the managed HSM Pools associated with the subscription and within the specified
+ /// resource group.
+ ///
+ ///
+ /// Maximum number of results to return.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsListByResourceGroupViaIdentity(global::System.String viaIdentity, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.KeyVault/managedHSMs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.KeyVault/managedHSMs"
+ + "?"
+ + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString()))
+ + "&"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// The List operation gets information about the managed HSM Pools associated with the subscription and within the specified
+ /// resource group.
+ ///
+ ///
+ /// Maximum number of results to return.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, int? Top, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.KeyVault/managedHSMs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.KeyVault/managedHSMs"
+ + "?"
+ + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString()))
+ + "&"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsListByResourceGroupWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ ///
+ /// The List operation gets information about the managed HSM Pools associated with the subscription and within the specified
+ /// resource group.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Maximum number of results to return.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, int? Top, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs"
+ + "?"
+ + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString()))
+ + "&"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsListByResourceGroupWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ ///
+ /// Actual wire call for method.
+ ///
+ /// the prepared HttpRequestMessage to send.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ // Error Response : default
+ var code = (await _result)?.Error?.Code;
+ var message = (await _result)?.Error?.Message;
+ if ((null == code || null == message))
+ {
+ // Unrecognized Response. Create an error record based on what we have.
+ var ex = new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.RestException(_response, await _result);
+ throw ex;
+ }
+ else
+ {
+ throw new global::System.Exception($"[{code}] : {message}");
+ }
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will
+ /// get validation events back.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Maximum number of results to return.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, int? Top, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ }
+ }
+
+ ///
+ /// The List operation gets information about the managed HSM Pools associated with the subscription.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Maximum number of results to return.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsListBySubscription(string subscriptionId, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.KeyVault/managedHSMs"
+ + "?"
+ + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString()))
+ + "&"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsListBySubscription_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// The List operation gets information about the managed HSM Pools associated with the subscription.
+ ///
+ ///
+ /// Maximum number of results to return.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsListBySubscriptionViaIdentity(global::System.String viaIdentity, int? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.KeyVault/managedHSMs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/managedHSMs'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/providers/Microsoft.KeyVault/managedHSMs"
+ + "?"
+ + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString()))
+ + "&"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsListBySubscription_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// The List operation gets information about the managed HSM Pools associated with the subscription.
+ ///
+ ///
+ /// Maximum number of results to return.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, int? Top, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.KeyVault/managedHSMs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/managedHSMs'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/providers/Microsoft.KeyVault/managedHSMs"
+ + "?"
+ + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString()))
+ + "&"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsListBySubscriptionWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ ///
+ /// The List operation gets information about the managed HSM Pools associated with the subscription.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Maximum number of results to return.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsListBySubscriptionWithResult(string subscriptionId, int? Top, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.KeyVault/managedHSMs"
+ + "?"
+ + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString()))
+ + "&"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsListBySubscriptionWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ ///
+ /// Actual wire call for method.
+ ///
+ /// the prepared HttpRequestMessage to send.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ // Error Response : default
+ var code = (await _result)?.Error?.Code;
+ var message = (await _result)?.Error?.Message;
+ if ((null == code || null == message))
+ {
+ // Unrecognized Response. Create an error record based on what we have.
+ var ex = new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.RestException(_response, await _result);
+ throw ex;
+ }
+ else
+ {
+ throw new global::System.Exception($"[{code}] : {message}");
+ }
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will
+ /// get validation events back.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Maximum number of results to return.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsListBySubscription_Validate(string subscriptionId, int? Top, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ }
+ }
+
+ ///
+ /// The List operation gets information about the deleted managed HSMs associated with the subscription.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsListDeleted(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.KeyVault/deletedManagedHSMs"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsListDeleted_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// The List operation gets information about the deleted managed HSMs associated with the subscription.
+ ///
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsListDeletedViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.KeyVault/deletedManagedHSMs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedManagedHSMs'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/providers/Microsoft.KeyVault/deletedManagedHSMs"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsListDeleted_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// The List operation gets information about the deleted managed HSMs associated with the subscription.
+ ///
+ ///
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsListDeletedViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.KeyVault/deletedManagedHSMs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedManagedHSMs'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/providers/Microsoft.KeyVault/deletedManagedHSMs"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsListDeletedWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ ///
+ /// The List operation gets information about the deleted managed HSMs associated with the subscription.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsListDeletedWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.KeyVault/deletedManagedHSMs"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsListDeletedWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsListDeletedWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedManagedHsmListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ // Error Response : default
+ var code = (await _result)?.Error?.Code;
+ var message = (await _result)?.Error?.Message;
+ if ((null == code || null == message))
+ {
+ // Unrecognized Response. Create an error record based on what we have.
+ var ex = new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.RestException(_response, await _result);
+ throw ex;
+ }
+ else
+ {
+ throw new global::System.Exception($"[{code}] : {message}");
+ }
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsListDeleted_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.DeletedManagedHsmListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsListDeleted_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ }
+ }
+
+ /// Permanently deletes the specified managed HSM.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// The name of the soft-deleted managed HSM.
+ /// The location of the soft-deleted managed HSM.
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsPurgeDeleted(string subscriptionId, string name, string location, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.KeyVault/locations/"
+ + global::System.Uri.EscapeDataString(location)
+ + "/deletedManagedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "/purge"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsPurgeDeleted_Call (request, onDefault,eventListener,sender);
+ }
+ }
+
+ /// Permanently deletes the specified managed HSM.
+ ///
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsPurgeDeletedViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.KeyVault/locations/(?[^/]+)/deletedManagedHSMs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedManagedHSMs/{name}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var name = _match.Groups["name"].Value;
+ var location = _match.Groups["location"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/providers/Microsoft.KeyVault/locations/"
+ + location
+ + "/deletedManagedHSMs/"
+ + name
+ + "/purge"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsPurgeDeleted_Call (request, onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsPurgeDeleted_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // this operation supports x-ms-long-running-operation
+ var _originalUri = request.RequestUri.AbsoluteUri;
+ // declared final-state-via: default
+ var _finalUri = _response.GetFirstHeader(@"Location");
+ var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ var location = _response.GetFirstHeader(@"Location");
+ while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ // delay before making the next polling request
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // while we wait, let's grab the headers and get ready to poll.
+ if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) {
+ asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ }
+ if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) {
+ location = _response.GetFirstHeader(@"Location");
+ }
+ var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation;
+ request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get);
+
+ // and let's look at the current response body and see if we have some information we can give back to the listener
+ var content = await _response.Content.ReadAsStringAsync();
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the polling call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // if we got back an OK, take a peek inside and see if it's done
+ if( _response.StatusCode == global::System.Net.HttpStatusCode.OK)
+ {
+ var error = false;
+ try {
+ if( Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonObject json)
+ {
+ var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status");
+ if( state is null )
+ {
+ // the body doesn't contain any information that has the state of the LRO
+ // we're going to just get out, and let the consumer have the result
+ break;
+ }
+
+ switch( state?.ToString()?.ToLower() )
+ {
+ case "failed":
+ error = true;
+ break;
+ case "succeeded":
+ case "canceled":
+ // we're done polling.
+ break;
+
+ default:
+ // need to keep polling!
+ _response.StatusCode = global::System.Net.HttpStatusCode.Created;
+ continue;
+ }
+ }
+ } catch {
+ // if we run into a problem peeking into the result,
+ // we really don't want to do anything special.
+ }
+ if (error) {
+ throw new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.UndeclaredResponseException(_response);
+ }
+ }
+
+ // check for terminal status code
+ if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ continue;
+ }
+ // we are done polling, do a request on final target?
+ if (!string.IsNullOrWhiteSpace(_finalUri))
+ {
+ // create a new request with the final uri
+ request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get);
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the final call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ break;
+ }
+ }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get
+ /// validation events back.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// The name of the soft-deleted managed HSM.
+ /// The location of the soft-deleted managed HSM.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsPurgeDeleted_Validate(string subscriptionId, string name, string location, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(name),name);
+ await eventListener.AssertNotNull(nameof(location),location);
+ }
+ }
+
+ /// Update a managed HSM Pool in the specified subscription.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Name of the managed HSM Pool
+ /// Parameters to patch the managed HSM Pool
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsUpdate(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IManagedHsm body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Patch, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsUpdate_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Update a managed HSM Pool in the specified subscription.
+ ///
+ /// Parameters to patch the managed HSM Pool
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IManagedHsm body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.KeyVault/managedHSMs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var name = _match.Groups["name"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + name
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Patch, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsUpdate_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Update a managed HSM Pool in the specified subscription.
+ ///
+ /// Parameters to patch the managed HSM Pool
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that
+ /// will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IManagedHsm body, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.KeyVault/managedHSMs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var name = _match.Groups["name"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + name
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Patch, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsUpdateWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Update a managed HSM Pool in the specified subscription.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Name of the managed HSM Pool
+ /// Json string supplied to the ManagedHsmsUpdate operation
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string name, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Patch, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ManagedHsmsUpdate_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Update a managed HSM Pool in the specified subscription.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Name of the managed HSM Pool
+ /// Json string supplied to the ManagedHsmsUpdate operation
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that
+ /// will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string name, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Patch, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsUpdateWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Update a managed HSM Pool in the specified subscription.
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Name of the managed HSM Pool
+ /// Parameters to patch the managed HSM Pool
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// A that
+ /// will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ManagedHsmsUpdateWithResult(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IManagedHsm body, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Patch, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ManagedHsmsUpdateWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that
+ /// will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // this operation supports x-ms-long-running-operation
+ var _originalUri = request.RequestUri.AbsoluteUri;
+ // declared final-state-via: default
+ var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ var location = _response.GetFirstHeader(@"Location");
+ while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ // delay before making the next polling request
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // while we wait, let's grab the headers and get ready to poll.
+ if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) {
+ asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ }
+ if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) {
+ location = _response.GetFirstHeader(@"Location");
+ }
+ var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation;
+ request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get);
+
+ // and let's look at the current response body and see if we have some information we can give back to the listener
+ var content = await _response.Content.ReadAsStringAsync();
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the polling call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // if we got back an OK, take a peek inside and see if it's done
+ if( _response.StatusCode == global::System.Net.HttpStatusCode.OK)
+ {
+ var error = false;
+ try {
+ if( Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonObject json)
+ {
+ var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status");
+ if( state is null )
+ {
+ // the body doesn't contain any information that has the state of the LRO
+ // we're going to just get out, and let the consumer have the result
+ break;
+ }
+
+ switch( state?.ToString()?.ToLower() )
+ {
+ case "failed":
+ error = true;
+ break;
+ case "succeeded":
+ case "canceled":
+ // we're done polling.
+ break;
+
+ default:
+ // need to keep polling!
+ _response.StatusCode = global::System.Net.HttpStatusCode.Created;
+ continue;
+ }
+ }
+ } catch {
+ // if we run into a problem peeking into the result,
+ // we really don't want to do anything special.
+ }
+ if (error) {
+ throw new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.UndeclaredResponseException(_response);
+ }
+ }
+
+ // check for terminal status code
+ if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ continue;
+ }
+ // we are done polling, do a request on final target?
+ if (!string.IsNullOrWhiteSpace(_originalUri))
+ {
+ // create a new request with the final uri
+ request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get);
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the final call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ break;
+ }
+ }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsm.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ // Error Response : default
+ var code = (await _result)?.Error?.Code;
+ var message = (await _result)?.Error?.Message;
+ if ((null == code || null == message))
+ {
+ // Unrecognized Response. Create an error record based on what we have.
+ var ex = new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.RestException(_response, await _result);
+ throw ex;
+ }
+ else
+ {
+ throw new global::System.Exception($"[{code}] : {message}");
+ }
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // this operation supports x-ms-long-running-operation
+ var _originalUri = request.RequestUri.AbsoluteUri;
+ // declared final-state-via: default
+ var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ var location = _response.GetFirstHeader(@"Location");
+ while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ // delay before making the next polling request
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // while we wait, let's grab the headers and get ready to poll.
+ if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) {
+ asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ }
+ if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) {
+ location = _response.GetFirstHeader(@"Location");
+ }
+ var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation;
+ request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get);
+
+ // and let's look at the current response body and see if we have some information we can give back to the listener
+ var content = await _response.Content.ReadAsStringAsync();
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the polling call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // if we got back an OK, take a peek inside and see if it's done
+ if( _response.StatusCode == global::System.Net.HttpStatusCode.OK)
+ {
+ var error = false;
+ try {
+ if( Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonObject json)
+ {
+ var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status");
+ if( state is null )
+ {
+ // the body doesn't contain any information that has the state of the LRO
+ // we're going to just get out, and let the consumer have the result
+ break;
+ }
+
+ switch( state?.ToString()?.ToLower() )
+ {
+ case "failed":
+ error = true;
+ break;
+ case "succeeded":
+ case "canceled":
+ // we're done polling.
+ break;
+
+ default:
+ // need to keep polling!
+ _response.StatusCode = global::System.Net.HttpStatusCode.Created;
+ continue;
+ }
+ }
+ } catch {
+ // if we run into a problem peeking into the result,
+ // we really don't want to do anything special.
+ }
+ if (error) {
+ throw new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.UndeclaredResponseException(_response);
+ }
+ }
+
+ // check for terminal status code
+ if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ continue;
+ }
+ // we are done polling, do a request on final target?
+ if (!string.IsNullOrWhiteSpace(_originalUri))
+ {
+ // create a new request with the final uri
+ request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get);
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the final call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ break;
+ }
+ }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsm.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.ManagedHsmError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Name of the managed HSM Pool
+ /// Parameters to patch the managed HSM Pool
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ManagedHsmsUpdate_Validate(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IManagedHsm body, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertNotNull(nameof(name),name);
+ await eventListener.AssertNotNull(nameof(body), body);
+ await eventListener.AssertObjectIsValid(nameof(body), body);
+ }
+ }
+
+ ///
+ /// Deletes the specified private endpoint connection associated with the managed hsm pool.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Name of the managed HSM Pool
+ /// Name of the private endpoint connection associated with the managed hsm pool.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task MhsmPrivateEndpointConnectionsDelete(string subscriptionId, string resourceGroupName, string name, string privateEndpointConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "/privateEndpointConnections/"
+ + global::System.Uri.EscapeDataString(privateEndpointConnectionName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Delete, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.MhsmPrivateEndpointConnectionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// Deletes the specified private endpoint connection associated with the managed hsm pool.
+ ///
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task MhsmPrivateEndpointConnectionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.KeyVault/managedHSMs/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/privateEndpointConnections/{privateEndpointConnectionName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var name = _match.Groups["name"].Value;
+ var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + name
+ + "/privateEndpointConnections/"
+ + privateEndpointConnectionName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Delete, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.MhsmPrivateEndpointConnectionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// Deletes the specified private endpoint connection associated with the managed hsm pool.
+ ///
+ ///
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task MhsmPrivateEndpointConnectionsDeleteViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.KeyVault/managedHSMs/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/privateEndpointConnections/{privateEndpointConnectionName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var name = _match.Groups["name"].Value;
+ var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + name
+ + "/privateEndpointConnections/"
+ + privateEndpointConnectionName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Delete, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.MhsmPrivateEndpointConnectionsDeleteWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ ///
+ /// Deletes the specified private endpoint connection associated with the managed hsm pool.
+ ///
+ /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription
+ /// ID forms part of the URI for every service call.
+ /// Name of the resource group that contains the managed HSM pool.
+ /// Name of the managed HSM Pool
+ /// Name of the private endpoint connection associated with the managed hsm pool.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task MhsmPrivateEndpointConnectionsDeleteWithResult(string subscriptionId, string resourceGroupName, string name, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2023-02-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.KeyVault/managedHSMs/"
+ + global::System.Uri.EscapeDataString(name)
+ + "/privateEndpointConnections/"
+ + global::System.Uri.EscapeDataString(privateEndpointConnectionName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Delete, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.MhsmPrivateEndpointConnectionsDeleteWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ ///
+ /// Actual wire call for method.
+ ///
+ /// the prepared HttpRequestMessage to send.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task MhsmPrivateEndpointConnectionsDeleteWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // this operation supports x-ms-long-running-operation
+ var _originalUri = request.RequestUri.AbsoluteUri;
+ // declared final-state-via: default
+ var _finalUri = _response.GetFirstHeader(@"Location");
+ var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ var location = _response.GetFirstHeader(@"Location");
+ while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ // delay before making the next polling request
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // while we wait, let's grab the headers and get ready to poll.
+ if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) {
+ asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation");
+ }
+ if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) {
+ location = _response.GetFirstHeader(@"Location");
+ }
+ var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation;
+ request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get);
+
+ // and let's look at the current response body and see if we have some information we can give back to the listener
+ var content = await _response.Content.ReadAsStringAsync();
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the polling call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ // if we got back an OK, take a peek inside and see if it's done
+ if( _response.StatusCode == global::System.Net.HttpStatusCode.OK)
+ {
+ var error = false;
+ try {
+ if( Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonObject json)
+ {
+ var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status");
+ if( state is null )
+ {
+ // the body doesn't contain any information that has the state of the LRO
+ // we're going to just get out, and let the consumer have the result
+ break;
+ }
+
+ switch( state?.ToString()?.ToLower() )
+ {
+ case "failed":
+ error = true;
+ break;
+ case "succeeded":
+ case "canceled":
+ // we're done polling.
+ break;
+
+ default:
+ // need to keep polling!
+ _response.StatusCode = global::System.Net.HttpStatusCode.Created;
+ continue;
+ }
+ }
+ } catch {
+ // if we run into a problem peeking into the result,
+ // we really don't want to do anything special.
+ }
+ if (error) {
+ throw new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.UndeclaredResponseException(_response);
+ }
+ }
+
+ // check for terminal status code
+ if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted )
+ {
+ continue;
+ }
+ // we are done polling, do a request on final target?
+ if (!string.IsNullOrWhiteSpace(_finalUri))
+ {
+ // create a new request with the final uri
+ request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Method.Get);
+
+ // drop the old response
+ _response?.Dispose();
+
+ // make the final call
+ _response = await sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ break;
+ }
+ }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmPrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers));
+ return await _result;
+ }
+ case global::System.Net.HttpStatusCode.NoContent:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ throw new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.UndeclaredResponseException(_response);
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Json.JsonNode.Parse(body.Result)) );
+ // Error Response : default
+ var code = (await _result)?.Code;
+ var message = (await _result)?.Message;
+ if ((null == code || null == message))
+ {
+ // Unrecognized Response. Create an error record based on what we have.
+ var ex = new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.RestException(_response, await _result);
+ throw ex;
+ }
+ else
+ {
+ throw new global::System.Exception($"[{code}] : {message}");
+ }
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Actual wire call for