From ff2c00327b52a15f895519a9d4ebddd093305d12 Mon Sep 17 00:00:00 2001
From: azure-powershell-bot
<65331932+azure-powershell-bot@users.noreply.github.com>
Date: Mon, 10 Nov 2025 05:31:08 +0000
Subject: [PATCH] [skip ci] Archive c2921c6b648bbe32d5ac4ec1851dd3bf629df130
---
.../Advisor.Autorest/Az.Advisor.format.ps1xml | 114 +-
.../Advisor/Advisor.Autorest/Az.Advisor.psd1 | 3 +-
.../Properties/AssemblyInfo.cs | 5 +-
.../Advisor.Autorest/check-dependencies.ps1 | 6 +-
.../Disable-AzAdvisorRecommendation.ps1 | 23 +-
.../Enable-AzAdvisorRecommendation.ps1 | 23 +-
.../exports/Get-AzAdvisorConfiguration.ps1 | 20 +-
.../exports/Get-AzAdvisorRecommendation.ps1 | 26 +-
.../exports/ProxyCmdletDefinitions.ps1 | 120 +-
.../exports/Set-AzAdvisorConfiguration.ps1 | 28 +-
.../Advisor.Autorest/generate-info.json | 2 +-
.../Advisor.Autorest/generated/Module.cs | 27 +-
.../Advisor.Autorest/generated/api/Advisor.cs | 2953 ++++++++++++++---
.../api/Models/AdvisorIdentity.PowerShell.cs | 24 +-
.../generated/api/Models/AdvisorIdentity.cs | 36 +-
.../api/Models/AdvisorIdentity.json.cs | 16 +-
.../generated/api/Models/Any.PowerShell.cs | 24 +-
.../generated/api/Models/Any.cs | 6 +-
.../generated/api/Models/Any.json.cs | 2 +-
.../RecommendationProperties.PowerShell.cs | 344 --
.../ResourceRecommendationBase.PowerShell.cs | 376 ---
.../ArmErrorResponse.PowerShell.cs | 52 +-
.../ArmErrorResponse.TypeConverter.cs | 6 +-
.../{Api202001 => }/ArmErrorResponse.cs | 24 +-
.../{Api202001 => }/ArmErrorResponse.json.cs | 10 +-
.../ArmErrorResponseBody.PowerShell.cs | 48 +-
.../ArmErrorResponseBody.TypeConverter.cs | 6 +-
.../{Api202001 => }/ArmErrorResponseBody.cs | 12 +-
.../ArmErrorResponseBody.json.cs | 12 +-
.../{Api202001 => }/ConfigData.PowerShell.cs | 68 +-
.../ConfigData.TypeConverter.cs | 6 +-
.../api/Models/{Api202001 => }/ConfigData.cs | 63 +-
.../Models/{Api202001 => }/ConfigData.json.cs | 14 +-
.../ConfigDataProperties.PowerShell.cs | 52 +-
.../ConfigDataProperties.TypeConverter.cs | 6 +-
.../{Api202001 => }/ConfigDataProperties.cs | 37 +-
.../ConfigDataProperties.json.cs | 14 +-
.../ConfigurationListResult.PowerShell.cs | 48 +-
.../ConfigurationListResult.TypeConverter.cs | 6 +-
.../ConfigurationListResult.cs | 22 +-
.../ConfigurationListResult.json.cs | 12 +-
.../DigestConfig.PowerShell.cs | 64 +-
.../DigestConfig.TypeConverter.cs | 6 +-
.../Models/{Api202001 => }/DigestConfig.cs | 48 +-
.../{Api202001 => }/DigestConfig.json.cs | 22 +-
.../MetadataEntity.PowerShell.cs | 72 +-
.../MetadataEntity.TypeConverter.cs | 6 +-
.../Models/{Api202001 => }/MetadataEntity.cs | 61 +-
.../{Api202001 => }/MetadataEntity.json.cs | 16 +-
.../MetadataEntityListResult.PowerShell.cs | 48 +-
.../MetadataEntityListResult.TypeConverter.cs | 6 +-
.../MetadataEntityListResult.cs | 22 +-
.../MetadataEntityListResult.json.cs | 12 +-
.../MetadataEntityProperties.PowerShell.cs | 56 +-
.../MetadataEntityProperties.TypeConverter.cs | 6 +-
.../MetadataEntityProperties.cs | 48 +-
.../MetadataEntityProperties.json.cs | 16 +-
...MetadataSupportedValueDetail.PowerShell.cs | 48 +-
...adataSupportedValueDetail.TypeConverter.cs | 6 +-
.../MetadataSupportedValueDetail.cs | 12 +-
.../MetadataSupportedValueDetail.json.cs | 12 +-
.../OperationDisplayInfo.PowerShell.cs | 56 +-
.../OperationDisplayInfo.TypeConverter.cs | 6 +-
.../{Api202001 => }/OperationDisplayInfo.cs | 18 +-
.../OperationDisplayInfo.json.cs | 16 +-
.../OperationEntity.PowerShell.cs | 64 +-
.../OperationEntity.TypeConverter.cs | 6 +-
.../Models/{Api202001 => }/OperationEntity.cs | 37 +-
.../{Api202001 => }/OperationEntity.json.cs | 12 +-
.../OperationEntityListResult.PowerShell.cs | 48 +-
...OperationEntityListResult.TypeConverter.cs | 6 +-
.../OperationEntityListResult.cs | 22 +-
.../OperationEntityListResult.json.cs | 12 +-
.../RecommendationProperties.PowerShell.cs | 364 ++
.../RecommendationProperties.TypeConverter.cs | 6 +-
.../RecommendationProperties.cs | 206 +-
.../RecommendationProperties.json.cs | 46 +-
...ndationPropertiesActionsItem.PowerShell.cs | 20 +
...iesExposedMetadataProperties.PowerShell.cs | 40 +-
...ExposedMetadataProperties.TypeConverter.cs | 6 +-
...tionPropertiesExposedMetadataProperties.cs | 6 +-
...iesExposedMetadataProperties.dictionary.cs | 4 +-
...ropertiesExposedMetadataProperties.json.cs | 8 +-
...PropertiesExtendedProperties.PowerShell.cs | 40 +-
...pertiesExtendedProperties.TypeConverter.cs | 6 +-
...ommendationPropertiesExtendedProperties.cs | 6 +-
...PropertiesExtendedProperties.dictionary.cs | 4 +-
...dationPropertiesExtendedProperties.json.cs | 8 +-
...mmendationPropertiesMetadata.PowerShell.cs | 42 +-
...ndationPropertiesMetadata.TypeConverter.cs | 6 +-
.../RecommendationPropertiesMetadata.cs | 6 +-
...mmendationPropertiesMetadata.dictionary.cs | 4 +-
.../RecommendationPropertiesMetadata.json.cs | 8 +-
...ndationPropertiesRemediation.PowerShell.cs | 42 +-
...tionPropertiesRemediation.TypeConverter.cs | 6 +-
.../RecommendationPropertiesRemediation.cs | 6 +-
...ndationPropertiesRemediation.dictionary.cs | 4 +-
...ecommendationPropertiesRemediation.json.cs | 8 +-
.../{Api202001 => }/Resource.PowerShell.cs | 52 +-
.../{Api202001 => }/Resource.TypeConverter.cs | 6 +-
.../api/Models/{Api202001 => }/Resource.cs | 21 +-
.../Models/{Api202001 => }/Resource.json.cs | 22 +-
.../ResourceMetadata.PowerShell.cs | 60 +-
.../ResourceMetadata.TypeConverter.cs | 6 +-
.../{Api202001 => }/ResourceMetadata.cs | 31 +-
.../{Api202001 => }/ResourceMetadata.json.cs | 18 +-
.../ResourceMetadataAction.PowerShell.cs | 40 +-
.../ResourceMetadataAction.TypeConverter.cs | 6 +-
.../{Api202001 => }/ResourceMetadataAction.cs | 6 +-
.../ResourceMetadataAction.dictionary.cs | 4 +-
.../ResourceMetadataAction.json.cs | 8 +-
.../ResourceRecommendationBase.PowerShell.cs | 396 +++
...esourceRecommendationBase.TypeConverter.cs | 6 +-
.../ResourceRecommendationBase.cs | 224 +-
.../ResourceRecommendationBase.json.cs | 12 +-
...RecommendationBaseListResult.PowerShell.cs | 50 +-
...ommendationBaseListResult.TypeConverter.cs | 6 +-
.../ResourceRecommendationBaseListResult.cs | 22 +-
...sourceRecommendationBaseListResult.json.cs | 12 +-
.../ShortDescription.PowerShell.cs | 48 +-
.../ShortDescription.TypeConverter.cs | 6 +-
.../{Api202001 => }/ShortDescription.cs | 12 +-
.../{Api202001 => }/ShortDescription.json.cs | 12 +-
.../SuppressionContract.PowerShell.cs | 68 +-
.../SuppressionContract.TypeConverter.cs | 6 +-
.../{Api202001 => }/SuppressionContract.cs | 51 +-
.../SuppressionContract.json.cs | 12 +-
...uppressionContractListResult.PowerShell.cs | 50 +-
...ressionContractListResult.TypeConverter.cs | 6 +-
.../SuppressionContractListResult.cs | 22 +-
.../SuppressionContractListResult.json.cs | 12 +-
.../SuppressionProperties.PowerShell.cs | 52 +-
.../SuppressionProperties.TypeConverter.cs | 6 +-
.../{Api202001 => }/SuppressionProperties.cs | 17 +-
.../SuppressionProperties.json.cs | 16 +-
.../api/Support/Category.Completer.cs | 51 -
.../api/Support/Category.TypeConverter.cs | 59 -
.../generated/api/Support/Category.cs | 103 -
.../Support/ConfigurationName.Completer.cs | 35 -
.../ConfigurationName.TypeConverter.cs | 59 -
.../api/Support/ConfigurationName.cs | 95 -
.../api/Support/CpuThreshold.Completer.cs | 50 -
.../api/Support/CpuThreshold.TypeConverter.cs | 62 -
.../generated/api/Support/CpuThreshold.cs | 105 -
.../Support/DigestConfigState.Completer.cs | 39 -
.../DigestConfigState.TypeConverter.cs | 59 -
.../api/Support/DigestConfigState.cs | 98 -
.../generated/api/Support/Impact.Completer.cs | 43 -
.../api/Support/Impact.TypeConverter.cs | 59 -
.../generated/api/Support/Impact.cs | 100 -
.../generated/api/Support/Risk.Completer.cs | 43 -
.../api/Support/Risk.TypeConverter.cs | 59 -
.../generated/api/Support/Risk.cs | 100 -
.../api/Support/Scenario.Completer.cs | 35 -
.../api/Support/Scenario.TypeConverter.cs | 59 -
.../generated/api/Support/Scenario.cs | 95 -
.../cmdlets/GetAzAdvisorConfiguration_List.cs | 120 +-
.../GetAzAdvisorConfiguration_List1.cs | 117 +-
.../cmdlets/GetAzAdvisorOperation_List.cs | 112 +-
...AdvisorRecommendationGenerateStatus_Get.cs | 84 +-
...mmendationGenerateStatus_GetViaIdentity.cs | 77 +-
.../GetAzAdvisorRecommendationMetadata_Get.cs | 147 +-
...orRecommendationMetadata_GetViaIdentity.cs | 145 +-
...GetAzAdvisorRecommendationMetadata_List.cs | 112 +-
.../cmdlets/GetAzAdvisorRecommendation_Get.cs | 109 +-
...tAzAdvisorRecommendation_GetViaIdentity.cs | 105 +-
.../GetAzAdvisorRecommendation_List.cs | 119 +-
.../cmdlets/GetAzAdvisorSuppression_Get.cs | 147 +-
.../GetAzAdvisorSuppression_GetViaIdentity.cs | 145 +-
...ppression_GetViaIdentityRecommendation.cs} | 226 +-
.../cmdlets/GetAzAdvisorSuppression_List.cs | 119 +-
...ewAzAdvisorConfiguration_CreateExpanded.cs | 130 +-
...wAzAdvisorConfiguration_CreateExpanded1.cs | 130 +-
.../NewAzAdvisorRecommendation_Generate.cs | 82 +-
.../NewAzAdvisorSuppression_CreateExpanded.cs | 153 +-
...reateViaIdentityRecommendationExpanded.cs} | 214 +-
.../RemoveAzAdvisorSuppression_Delete.cs | 79 +-
...eAzAdvisorSuppression_DeleteViaIdentity.cs | 75 +-
...ession_DeleteViaIdentityRecommendation.cs} | 210 +-
...ateAzAdvisorSuppression_UpdateExpanded.cs} | 244 +-
...orSuppression_UpdateViaIdentityExpanded.cs | 535 +++
...UpdateViaIdentityRecommendationExpanded.cs | 547 +++
.../Attributes/ExternalDocsAttribute.cs | 30 +
.../PSArgumentCompleterAttribute.cs | 52 +
.../BuildTime/Cmdlets/ExportFormatPs1xml.cs | 6 +-
.../BuildTime/Cmdlets/ExportModelSurface.cs | 2 +-
.../BuildTime/Cmdlets/ExportProxyCmdlet.cs | 4 +-
.../runtime/BuildTime/Cmdlets/ExportPsd1.cs | 8 +-
.../BuildTime/Cmdlets/ExportTestStub.cs | 211 +-
.../runtime/BuildTime/MarkdownRenderer.cs | 2 +-
.../runtime/BuildTime/Models/PsHelpTypes.cs | 11 +-
.../BuildTime/Models/PsMarkdownTypes.cs | 43 +-
.../BuildTime/Models/PsProxyOutputs.cs | 60 +-
.../runtime/BuildTime/Models/PsProxyTypes.cs | 57 +-
.../runtime/BuildTime/PsAttributes.cs | 15 +
.../runtime/BuildTime/PsExtensions.cs | 7 +
.../generated/runtime/BuildTime/PsHelpers.cs | 4 +-
.../generated/runtime/Context.cs | 33 +
.../generated/runtime/Events.cs | 4 +-
.../generated/runtime/ISendAsync.cs | 113 +
.../generated/runtime/InfoAttribute.cs | 4 +
.../generated/runtime/InputHandler.cs | 22 +
.../generated/runtime/MessageAttribute.cs | 11 +-
.../runtime/Nodes/Collections/XNodeArray.cs | 5 +
.../runtime/Properties/Resources.resx | 2 +-
.../generated/runtime/SerializationMode.cs | 8 +-
.../runtime/TypeConverterExtensions.cs | 50 +
.../internal/Get-AzAdvisorOperation.ps1 | 10 +-
.../internal/Get-AzAdvisorRecommendation.ps1 | 19 +-
...-AzAdvisorRecommendationGenerateStatus.ps1 | 13 +-
.../Get-AzAdvisorRecommendationMetadata.ps1 | 13 +-
.../internal/Get-AzAdvisorSuppression.ps1 | 35 +-
.../internal/New-AzAdvisorConfiguration.ps1 | 98 +-
.../internal/New-AzAdvisorRecommendation.ps1 | 36 +-
.../internal/New-AzAdvisorSuppression.ps1 | 41 +-
.../internal/ProxyCmdletDefinitions.ps1 | 483 ++-
.../internal/Remove-AzAdvisorSuppression.ps1 | 27 +-
.../internal/Update-AzAdvisorSuppression.ps1 | 206 ++
.../Advisor/Advisor.Autorest/test-module.ps1 | 10 +-
219 files changed, 10307 insertions(+), 5031 deletions(-)
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Models/Api202001/RecommendationProperties.PowerShell.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Models/Api202001/ResourceRecommendationBase.PowerShell.cs
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ArmErrorResponse.PowerShell.cs (70%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ArmErrorResponse.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ArmErrorResponse.cs (71%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ArmErrorResponse.json.cs (94%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ArmErrorResponseBody.PowerShell.cs (74%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ArmErrorResponseBody.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ArmErrorResponseBody.cs (89%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ArmErrorResponseBody.json.cs (94%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ConfigData.PowerShell.cs (62%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ConfigData.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ConfigData.cs (66%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ConfigData.json.cs (92%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ConfigDataProperties.PowerShell.cs (67%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ConfigDataProperties.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ConfigDataProperties.cs (72%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ConfigDataProperties.json.cs (90%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ConfigurationListResult.PowerShell.cs (70%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ConfigurationListResult.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ConfigurationListResult.cs (73%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ConfigurationListResult.json.cs (90%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/DigestConfig.PowerShell.cs (65%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/DigestConfig.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/DigestConfig.cs (80%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/DigestConfig.json.cs (87%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataEntity.PowerShell.cs (58%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataEntity.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataEntity.cs (66%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataEntity.json.cs (93%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataEntityListResult.PowerShell.cs (70%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataEntityListResult.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataEntityListResult.cs (72%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataEntityListResult.json.cs (90%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataEntityProperties.PowerShell.cs (63%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataEntityProperties.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataEntityProperties.cs (64%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataEntityProperties.json.cs (85%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataSupportedValueDetail.PowerShell.cs (73%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataSupportedValueDetail.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataSupportedValueDetail.cs (87%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/MetadataSupportedValueDetail.json.cs (94%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/OperationDisplayInfo.PowerShell.cs (69%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/OperationDisplayInfo.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/OperationDisplayInfo.cs (90%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/OperationDisplayInfo.json.cs (93%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/OperationEntity.PowerShell.cs (64%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/OperationEntity.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/OperationEntity.cs (73%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/OperationEntity.json.cs (94%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/OperationEntityListResult.PowerShell.cs (70%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/OperationEntityListResult.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/OperationEntityListResult.cs (72%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/OperationEntityListResult.json.cs (90%)
create mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Models/RecommendationProperties.PowerShell.cs
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationProperties.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationProperties.cs (69%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationProperties.json.cs (86%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesExposedMetadataProperties.PowerShell.cs (80%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesExposedMetadataProperties.TypeConverter.cs (96%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesExposedMetadataProperties.cs (81%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesExposedMetadataProperties.dictionary.cs (95%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesExposedMetadataProperties.json.cs (94%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesExtendedProperties.PowerShell.cs (80%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesExtendedProperties.TypeConverter.cs (96%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesExtendedProperties.cs (79%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesExtendedProperties.dictionary.cs (95%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesExtendedProperties.json.cs (94%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesMetadata.PowerShell.cs (80%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesMetadata.TypeConverter.cs (96%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesMetadata.cs (79%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesMetadata.dictionary.cs (95%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesMetadata.json.cs (95%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesRemediation.PowerShell.cs (80%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesRemediation.TypeConverter.cs (96%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesRemediation.cs (80%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesRemediation.dictionary.cs (95%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/RecommendationPropertiesRemediation.json.cs (95%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/Resource.PowerShell.cs (73%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/Resource.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/Resource.cs (84%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/Resource.json.cs (91%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceMetadata.PowerShell.cs (66%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceMetadata.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceMetadata.cs (84%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceMetadata.json.cs (93%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceMetadataAction.PowerShell.cs (81%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceMetadataAction.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceMetadataAction.cs (80%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceMetadataAction.dictionary.cs (95%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceMetadataAction.json.cs (95%)
create mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Models/ResourceRecommendationBase.PowerShell.cs
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceRecommendationBase.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceRecommendationBase.cs (63%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceRecommendationBase.json.cs (93%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceRecommendationBaseListResult.PowerShell.cs (69%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceRecommendationBaseListResult.TypeConverter.cs (96%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceRecommendationBaseListResult.cs (71%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ResourceRecommendationBaseListResult.json.cs (89%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ShortDescription.PowerShell.cs (74%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ShortDescription.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ShortDescription.cs (90%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/ShortDescription.json.cs (94%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/SuppressionContract.PowerShell.cs (62%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/SuppressionContract.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/SuppressionContract.cs (70%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/SuppressionContract.json.cs (93%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/SuppressionContractListResult.PowerShell.cs (69%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/SuppressionContractListResult.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/SuppressionContractListResult.cs (72%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/SuppressionContractListResult.json.cs (89%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/SuppressionProperties.PowerShell.cs (69%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/SuppressionProperties.TypeConverter.cs (97%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/SuppressionProperties.cs (87%)
rename generated/Advisor/Advisor.Autorest/generated/api/Models/{Api202001 => }/SuppressionProperties.json.cs (94%)
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/Category.Completer.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/Category.TypeConverter.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/Category.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/ConfigurationName.Completer.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/ConfigurationName.TypeConverter.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/ConfigurationName.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/CpuThreshold.Completer.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/CpuThreshold.TypeConverter.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/CpuThreshold.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/DigestConfigState.Completer.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/DigestConfigState.TypeConverter.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/DigestConfigState.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/Impact.Completer.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/Impact.TypeConverter.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/Impact.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/Risk.Completer.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/Risk.TypeConverter.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/Risk.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/Scenario.Completer.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/Scenario.TypeConverter.cs
delete mode 100644 generated/Advisor/Advisor.Autorest/generated/api/Support/Scenario.cs
rename generated/Advisor/Advisor.Autorest/generated/cmdlets/{NewAzAdvisorConfiguration_CreateViaIdentityExpanded1.cs => GetAzAdvisorSuppression_GetViaIdentityRecommendation.cs} (75%)
rename generated/Advisor/Advisor.Autorest/generated/cmdlets/{NewAzAdvisorConfiguration_CreateViaIdentity1.cs => NewAzAdvisorSuppression_CreateViaIdentityRecommendationExpanded.cs} (70%)
rename generated/Advisor/Advisor.Autorest/generated/cmdlets/{NewAzAdvisorRecommendation_GenerateViaIdentity.cs => RemoveAzAdvisorSuppression_DeleteViaIdentityRecommendation.cs} (74%)
rename generated/Advisor/Advisor.Autorest/generated/cmdlets/{NewAzAdvisorConfiguration_Create1.cs => UpdateAzAdvisorSuppression_UpdateExpanded.cs} (69%)
create mode 100644 generated/Advisor/Advisor.Autorest/generated/cmdlets/UpdateAzAdvisorSuppression_UpdateViaIdentityExpanded.cs
create mode 100644 generated/Advisor/Advisor.Autorest/generated/cmdlets/UpdateAzAdvisorSuppression_UpdateViaIdentityRecommendationExpanded.cs
create mode 100644 generated/Advisor/Advisor.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs
create mode 100644 generated/Advisor/Advisor.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs
create mode 100644 generated/Advisor/Advisor.Autorest/generated/runtime/Context.cs
create mode 100644 generated/Advisor/Advisor.Autorest/generated/runtime/InputHandler.cs
create mode 100644 generated/Advisor/Advisor.Autorest/internal/Update-AzAdvisorSuppression.ps1
diff --git a/generated/Advisor/Advisor.Autorest/Az.Advisor.format.ps1xml b/generated/Advisor/Advisor.Autorest/Az.Advisor.format.ps1xml
index d7514bd71a79..49457d580126 100644
--- a/generated/Advisor/Advisor.Autorest/Az.Advisor.format.ps1xml
+++ b/generated/Advisor/Advisor.Autorest/Az.Advisor.format.ps1xml
@@ -4,7 +4,7 @@
Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.AdvisorIdentity
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.AdvisorIdentity
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.AdvisorIdentity#Multiple
@@ -60,9 +60,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ArmErrorResponseBody
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponseBody
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ArmErrorResponseBody
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponseBody#Multiple
@@ -88,9 +88,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ConfigData
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ConfigData
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ConfigData
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ConfigData#Multiple
@@ -122,9 +122,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ConfigDataProperties
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ConfigDataProperties
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ConfigDataProperties
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ConfigDataProperties#Multiple
@@ -150,9 +150,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ConfigurationListResult
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ConfigurationListResult
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ConfigurationListResult
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ConfigurationListResult#Multiple
@@ -172,18 +172,15 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.DigestConfig
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.DigestConfig
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.DigestConfig
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.DigestConfig#Multiple
-
-
-
@@ -203,9 +200,6 @@
ActionGroupResourceId
-
- Category
-
Frequency
@@ -224,9 +218,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.MetadataEntity
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.MetadataEntity
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.MetadataEntity
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.MetadataEntity#Multiple
@@ -252,9 +246,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.MetadataEntityListResult
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.MetadataEntityListResult
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.MetadataEntityListResult
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.MetadataEntityListResult#Multiple
@@ -274,18 +268,12 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.MetadataEntityProperties
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.MetadataEntityProperties
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.MetadataEntityProperties
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.MetadataEntityProperties#Multiple
-
-
-
-
-
-
@@ -293,12 +281,6 @@
-
- ApplicableScenario
-
-
- DependsOn
-
DisplayName
@@ -308,9 +290,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.MetadataSupportedValueDetail
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.MetadataSupportedValueDetail
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.MetadataSupportedValueDetail
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.MetadataSupportedValueDetail#Multiple
@@ -330,9 +312,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.OperationDisplayInfo
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.OperationDisplayInfo
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.OperationDisplayInfo
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.OperationDisplayInfo#Multiple
@@ -370,9 +352,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.OperationEntity
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.OperationEntity
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.OperationEntity
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.OperationEntity#Multiple
@@ -392,9 +374,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.OperationEntityListResult
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.OperationEntityListResult
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.OperationEntityListResult
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.OperationEntityListResult#Multiple
@@ -414,9 +396,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.RecommendationProperties
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.RecommendationProperties
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.RecommendationProperties
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.RecommendationProperties#Multiple
@@ -453,9 +435,6 @@
-
-
-
@@ -493,18 +472,15 @@
Risk
-
- SuppressionId
-
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.RecommendationPropertiesExtendedProperties
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.RecommendationPropertiesExtendedProperties
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.RecommendationPropertiesExtendedProperties
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.RecommendationPropertiesExtendedProperties#Multiple
@@ -524,9 +500,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.Resource
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Resource
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.Resource
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Resource#Multiple
@@ -546,9 +522,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ResourceMetadata
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ResourceMetadata
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ResourceMetadata
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ResourceMetadata#Multiple
@@ -586,9 +562,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ResourceRecommendationBase
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ResourceRecommendationBase
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ResourceRecommendationBase
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ResourceRecommendationBase#Multiple
@@ -638,9 +614,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ResourceRecommendationBaseListResult
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ResourceRecommendationBaseListResult
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ResourceRecommendationBaseListResult
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ResourceRecommendationBaseListResult#Multiple
@@ -660,9 +636,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ShortDescription
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ShortDescription
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ShortDescription
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ShortDescription#Multiple
@@ -688,9 +664,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.SuppressionContract
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.SuppressionContract
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.SuppressionContract
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.SuppressionContract#Multiple
@@ -728,9 +704,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.SuppressionContractListResult
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.SuppressionContractListResult
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.SuppressionContractListResult
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.SuppressionContractListResult#Multiple
@@ -750,9 +726,9 @@
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.SuppressionProperties
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.SuppressionProperties
- Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.SuppressionProperties
+ Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.SuppressionProperties#Multiple
diff --git a/generated/Advisor/Advisor.Autorest/Az.Advisor.psd1 b/generated/Advisor/Advisor.Autorest/Az.Advisor.psd1
index 7f495534b739..b07d8c750773 100644
--- a/generated/Advisor/Advisor.Autorest/Az.Advisor.psd1
+++ b/generated/Advisor/Advisor.Autorest/Az.Advisor.psd1
@@ -11,8 +11,7 @@
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.Advisor.private.dll'
FormatsToProcess = './Az.Advisor.format.ps1xml'
- FunctionsToExport = 'Disable-AzAdvisorRecommendation', 'Enable-AzAdvisorRecommendation', 'Get-AzAdvisorConfiguration', 'Get-AzAdvisorRecommendation', 'Set-AzAdvisorConfiguration', '*'
- AliasesToExport = '*'
+ FunctionsToExport = 'Disable-AzAdvisorRecommendation', 'Enable-AzAdvisorRecommendation', 'Get-AzAdvisorConfiguration', 'Get-AzAdvisorRecommendation', 'Set-AzAdvisorConfiguration'
PrivateData = @{
PSData = @{
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Advisor'
diff --git a/generated/Advisor/Advisor.Autorest/Properties/AssemblyInfo.cs b/generated/Advisor/Advisor.Autorest/Properties/AssemblyInfo.cs
index 396b327e6691..7664e280b354 100644
--- a/generated/Advisor/Advisor.Autorest/Properties/AssemblyInfo.cs
+++ b/generated/Advisor/Advisor.Autorest/Properties/AssemblyInfo.cs
@@ -20,8 +20,7 @@
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Advisor")]
-[assembly: System.Reflection.AssemblyFileVersionAttribute("2.1.0")]
-[assembly: System.Reflection.AssemblyVersionAttribute("2.1.0")]
+[assembly: System.Reflection.AssemblyFileVersionAttribute("2.1.1")]
+[assembly: System.Reflection.AssemblyVersionAttribute("2.1.1")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
-
diff --git a/generated/Advisor/Advisor.Autorest/check-dependencies.ps1 b/generated/Advisor/Advisor.Autorest/check-dependencies.ps1
index c29591c7bfe1..90ca9867ae40 100644
--- a/generated/Advisor/Advisor.Autorest/check-dependencies.ps1
+++ b/generated/Advisor/Advisor.Autorest/check-dependencies.ps1
@@ -12,13 +12,13 @@
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
# ----------------------------------------------------------------------------------
-param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
+param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
$ErrorActionPreference = 'Stop'
-if(-not $Isolated) {
+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 -Isolated
+ & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
return
}
diff --git a/generated/Advisor/Advisor.Autorest/exports/Disable-AzAdvisorRecommendation.ps1 b/generated/Advisor/Advisor.Autorest/exports/Disable-AzAdvisorRecommendation.ps1
index c31d5d244b1e..a913114972fc 100644
--- a/generated/Advisor/Advisor.Autorest/exports/Disable-AzAdvisorRecommendation.ps1
+++ b/generated/Advisor/Advisor.Autorest/exports/Disable-AzAdvisorRecommendation.ps1
@@ -27,14 +27,14 @@ Disable-AzAdvisorRecommendation -ResourceId /subscriptions/9e223dbe-3399-4e19-88
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IAdvisorIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase
+Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase
.Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : The powershell object type PsAzureAdvisorResourceRecommendationBase returned by Get-AzAdvisorRecommendation call.
- [ConfigurationName ]: Advisor configuration name. Value must be 'default'
+ [ConfigurationName ]: Advisor configuration name. Value must be 'default'
[Id ]: Resource identity path
[Name ]: Name of metadata entity.
[OperationId ]: The operation ID, which can be found from the Location field in the generate recommendation response header.
@@ -46,7 +46,7 @@ INPUTOBJECT : The powershell object type PsAzureAdvisorResourc
https://learn.microsoft.com/powershell/module/az.advisor/Disable-AzAdvisorRecommendation
#>
function Disable-AzAdvisorRecommendation {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase])]
[CmdletBinding(DefaultParameterSetName='IdParameterSet', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='IdParameterSet', Mandatory)]
@@ -72,7 +72,6 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IAdvisorIdentity]
# The powershell object type PsAzureAdvisorResourceRecommendationBase returned by Get-AzAdvisorRecommendation call.
- # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},
[Parameter()]
@@ -136,6 +135,15 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -159,9 +167,7 @@ begin {
NameParameterSet = 'Az.Advisor.custom\Disable-AzAdvisorRecommendation';
InputObjectParameterSet = 'Az.Advisor.custom\Disable-AzAdvisorRecommendation';
}
- if (('IdParameterSet', 'NameParameterSet', 'InputObjectParameterSet') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
- $testPlayback = $false
- $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if (('IdParameterSet', 'NameParameterSet', 'InputObjectParameterSet') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
@@ -175,6 +181,9 @@ begin {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
diff --git a/generated/Advisor/Advisor.Autorest/exports/Enable-AzAdvisorRecommendation.ps1 b/generated/Advisor/Advisor.Autorest/exports/Enable-AzAdvisorRecommendation.ps1
index cf803447117b..8dea08113364 100644
--- a/generated/Advisor/Advisor.Autorest/exports/Enable-AzAdvisorRecommendation.ps1
+++ b/generated/Advisor/Advisor.Autorest/exports/Enable-AzAdvisorRecommendation.ps1
@@ -27,14 +27,14 @@ Enable-AzAdvisorRecommendation -RecommendationName 42963553-61de-5334-2d2e-47f3a
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IAdvisorIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase
+Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase
.Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : The powershell object type PsAzureAdvisorResourceRecommendationBase returned by Get-AzAdvisorRecommendation call.
- [ConfigurationName ]: Advisor configuration name. Value must be 'default'
+ [ConfigurationName ]: Advisor configuration name. Value must be 'default'
[Id ]: Resource identity path
[Name ]: Name of metadata entity.
[OperationId ]: The operation ID, which can be found from the Location field in the generate recommendation response header.
@@ -46,7 +46,7 @@ INPUTOBJECT : The powershell object type PsAzureAdvisorResourc
https://learn.microsoft.com/powershell/module/az.advisor/Enable-AzAdvisorRecommendation
#>
function Enable-AzAdvisorRecommendation {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase])]
[CmdletBinding(DefaultParameterSetName='IdParameterSet', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='IdParameterSet', Mandatory)]
@@ -72,7 +72,6 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IAdvisorIdentity]
# The powershell object type PsAzureAdvisorResourceRecommendationBase returned by Get-AzAdvisorRecommendation call.
- # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},
[Parameter()]
@@ -130,6 +129,15 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -153,9 +161,7 @@ begin {
NameParameterSet = 'Az.Advisor.custom\Enable-AzAdvisorRecommendation';
InputObjectParameterSet = 'Az.Advisor.custom\Enable-AzAdvisorRecommendation';
}
- if (('IdParameterSet', 'NameParameterSet', 'InputObjectParameterSet') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
- $testPlayback = $false
- $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if (('IdParameterSet', 'NameParameterSet', 'InputObjectParameterSet') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
@@ -169,6 +175,9 @@ begin {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
diff --git a/generated/Advisor/Advisor.Autorest/exports/Get-AzAdvisorConfiguration.ps1 b/generated/Advisor/Advisor.Autorest/exports/Get-AzAdvisorConfiguration.ps1
index 1aaafb279d5d..6d64fe105617 100644
--- a/generated/Advisor/Advisor.Autorest/exports/Get-AzAdvisorConfiguration.ps1
+++ b/generated/Advisor/Advisor.Autorest/exports/Get-AzAdvisorConfiguration.ps1
@@ -25,12 +25,12 @@ Get-AzAdvisorConfiguration
Get-AzAdvisorConfiguration -ResourceGroupName lnxtest
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData
+Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData
.Link
https://learn.microsoft.com/powershell/module/az.advisor/get-azadvisorconfiguration
#>
function Get-AzAdvisorConfiguration {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter()]
@@ -102,6 +102,15 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -124,9 +133,7 @@ begin {
List = 'Az.Advisor.private\Get-AzAdvisorConfiguration_List';
List1 = 'Az.Advisor.private\Get-AzAdvisorConfiguration_List1';
}
- if (('List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
- $testPlayback = $false
- $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if (('List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
@@ -140,6 +147,9 @@ begin {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
diff --git a/generated/Advisor/Advisor.Autorest/exports/Get-AzAdvisorRecommendation.ps1 b/generated/Advisor/Advisor.Autorest/exports/Get-AzAdvisorRecommendation.ps1
index f5884385fb6f..f08dd15eae5a 100644
--- a/generated/Advisor/Advisor.Autorest/exports/Get-AzAdvisorRecommendation.ps1
+++ b/generated/Advisor/Advisor.Autorest/exports/Get-AzAdvisorRecommendation.ps1
@@ -20,7 +20,7 @@ Obtains details of a cached recommendation.
.Description
Obtains details of a cached recommendation.
.Example
- Get-AzAdvisorRecommendation -ResourceGroupName lnxtest -Category HighAvailability
+Get-AzAdvisorRecommendation -ResourceGroupName lnxtest -Category HighAvailability
.Example
Get-AzAdvisorRecommendation -filter "Category eq 'HighAvailability' and ResourceGroup eq 'lnxtest'"
.Example
@@ -29,14 +29,14 @@ Get-AzAdvisorRecommendation -Id 42963553-61de-5334-2d2e-47f3a0099d41 -ResourceUr
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IAdvisorIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase
+Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase
.Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
-INPUTOBJECT : Identity Parameter
- [ConfigurationName ]: Advisor configuration name. Value must be 'default'
+INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ [ConfigurationName ]: Advisor configuration name. Value must be 'default'
[Id ]: Resource identity path
[Name ]: Name of metadata entity.
[OperationId ]: The operation ID, which can be found from the Location field in the generate recommendation response header.
@@ -48,7 +48,7 @@ INPUTOBJECT : Identity Parameter
https://learn.microsoft.com/powershell/module/az.advisor/Get-AzAdvisorRecommendation
#>
function Get-AzAdvisorRecommendation {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase])]
[CmdletBinding(DefaultParameterSetName='ListByFilter', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='ListByFilter')]
@@ -162,6 +162,15 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -187,9 +196,7 @@ begin {
GetById = 'Az.Advisor.custom\Get-AzAdvisorRecommendation';
GetViaIdentity1 = 'Az.Advisor.custom\Get-AzAdvisorRecommendation';
}
- if (('ListByFilter', 'ListByName', 'ListById') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
- $testPlayback = $false
- $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if (('ListByFilter', 'ListByName', 'ListById') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
@@ -203,6 +210,9 @@ begin {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
diff --git a/generated/Advisor/Advisor.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Advisor/Advisor.Autorest/exports/ProxyCmdletDefinitions.ps1
index ce54f6ee86f7..895a3cb232e1 100644
--- a/generated/Advisor/Advisor.Autorest/exports/ProxyCmdletDefinitions.ps1
+++ b/generated/Advisor/Advisor.Autorest/exports/ProxyCmdletDefinitions.ps1
@@ -25,12 +25,12 @@ Get-AzAdvisorConfiguration
Get-AzAdvisorConfiguration -ResourceGroupName lnxtest
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData
+Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData
.Link
https://learn.microsoft.com/powershell/module/az.advisor/get-azadvisorconfiguration
#>
function Get-AzAdvisorConfiguration {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter()]
@@ -102,6 +102,15 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -124,9 +133,7 @@ begin {
List = 'Az.Advisor.private\Get-AzAdvisorConfiguration_List';
List1 = 'Az.Advisor.private\Get-AzAdvisorConfiguration_List1';
}
- if (('List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
- $testPlayback = $false
- $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if (('List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
@@ -140,6 +147,9 @@ begin {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
@@ -196,14 +206,14 @@ Disable-AzAdvisorRecommendation -ResourceId /subscriptions/9e223dbe-3399-4e19-88
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IAdvisorIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase
+Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase
.Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : The powershell object type PsAzureAdvisorResourceRecommendationBase returned by Get-AzAdvisorRecommendation call.
- [ConfigurationName ]: Advisor configuration name. Value must be 'default'
+ [ConfigurationName ]: Advisor configuration name. Value must be 'default'
[Id ]: Resource identity path
[Name ]: Name of metadata entity.
[OperationId ]: The operation ID, which can be found from the Location field in the generate recommendation response header.
@@ -215,7 +225,7 @@ INPUTOBJECT : The powershell object type PsAzureAdvisorResourc
https://learn.microsoft.com/powershell/module/az.advisor/Disable-AzAdvisorRecommendation
#>
function Disable-AzAdvisorRecommendation {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase])]
[CmdletBinding(DefaultParameterSetName='IdParameterSet', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='IdParameterSet', Mandatory)]
@@ -241,7 +251,6 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IAdvisorIdentity]
# The powershell object type PsAzureAdvisorResourceRecommendationBase returned by Get-AzAdvisorRecommendation call.
- # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},
[Parameter()]
@@ -305,6 +314,15 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -328,9 +346,7 @@ begin {
NameParameterSet = 'Az.Advisor.custom\Disable-AzAdvisorRecommendation';
InputObjectParameterSet = 'Az.Advisor.custom\Disable-AzAdvisorRecommendation';
}
- if (('IdParameterSet', 'NameParameterSet', 'InputObjectParameterSet') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
- $testPlayback = $false
- $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if (('IdParameterSet', 'NameParameterSet', 'InputObjectParameterSet') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
@@ -344,6 +360,9 @@ begin {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
@@ -400,14 +419,14 @@ Enable-AzAdvisorRecommendation -RecommendationName 42963553-61de-5334-2d2e-47f3a
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IAdvisorIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase
+Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase
.Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT : The powershell object type PsAzureAdvisorResourceRecommendationBase returned by Get-AzAdvisorRecommendation call.
- [ConfigurationName ]: Advisor configuration name. Value must be 'default'
+ [ConfigurationName ]: Advisor configuration name. Value must be 'default'
[Id ]: Resource identity path
[Name ]: Name of metadata entity.
[OperationId ]: The operation ID, which can be found from the Location field in the generate recommendation response header.
@@ -419,7 +438,7 @@ INPUTOBJECT : The powershell object type PsAzureAdvisorResourc
https://learn.microsoft.com/powershell/module/az.advisor/Enable-AzAdvisorRecommendation
#>
function Enable-AzAdvisorRecommendation {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase])]
[CmdletBinding(DefaultParameterSetName='IdParameterSet', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='IdParameterSet', Mandatory)]
@@ -445,7 +464,6 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IAdvisorIdentity]
# The powershell object type PsAzureAdvisorResourceRecommendationBase returned by Get-AzAdvisorRecommendation call.
- # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},
[Parameter()]
@@ -503,6 +521,15 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -526,9 +553,7 @@ begin {
NameParameterSet = 'Az.Advisor.custom\Enable-AzAdvisorRecommendation';
InputObjectParameterSet = 'Az.Advisor.custom\Enable-AzAdvisorRecommendation';
}
- if (('IdParameterSet', 'NameParameterSet', 'InputObjectParameterSet') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
- $testPlayback = $false
- $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if (('IdParameterSet', 'NameParameterSet', 'InputObjectParameterSet') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
@@ -542,6 +567,9 @@ begin {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
@@ -591,7 +619,7 @@ Obtains details of a cached recommendation.
.Description
Obtains details of a cached recommendation.
.Example
- Get-AzAdvisorRecommendation -ResourceGroupName lnxtest -Category HighAvailability
+Get-AzAdvisorRecommendation -ResourceGroupName lnxtest -Category HighAvailability
.Example
Get-AzAdvisorRecommendation -filter "Category eq 'HighAvailability' and ResourceGroup eq 'lnxtest'"
.Example
@@ -600,14 +628,14 @@ Get-AzAdvisorRecommendation -Id 42963553-61de-5334-2d2e-47f3a0099d41 -ResourceUr
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IAdvisorIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase
+Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase
.Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
-INPUTOBJECT : Identity Parameter
- [ConfigurationName ]: Advisor configuration name. Value must be 'default'
+INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ [ConfigurationName ]: Advisor configuration name. Value must be 'default'
[Id ]: Resource identity path
[Name ]: Name of metadata entity.
[OperationId ]: The operation ID, which can be found from the Location field in the generate recommendation response header.
@@ -619,7 +647,7 @@ INPUTOBJECT : Identity Parameter
https://learn.microsoft.com/powershell/module/az.advisor/Get-AzAdvisorRecommendation
#>
function Get-AzAdvisorRecommendation {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IResourceRecommendationBase])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IResourceRecommendationBase])]
[CmdletBinding(DefaultParameterSetName='ListByFilter', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='ListByFilter')]
@@ -733,6 +761,15 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -758,9 +795,7 @@ begin {
GetById = 'Az.Advisor.custom\Get-AzAdvisorRecommendation';
GetViaIdentity1 = 'Az.Advisor.custom\Get-AzAdvisorRecommendation';
}
- if (('ListByFilter', 'ListByName', 'ListById') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
- $testPlayback = $false
- $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if (('ListByFilter', 'ListByName', 'ListById') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
@@ -774,6 +809,9 @@ begin {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
@@ -830,14 +868,14 @@ Set-AzAdvisorConfiguration -Exclude
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IAdvisorIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData
+Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData
.Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
-INPUTOBJECT : Identity Parameter
- [ConfigurationName ]: Advisor configuration name. Value must be 'default'
+INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ [ConfigurationName ]: Advisor configuration name. Value must be 'default'
[Id ]: Resource identity path
[Name ]: Name of metadata entity.
[OperationId ]: The operation ID, which can be found from the Location field in the generate recommendation response header.
@@ -849,7 +887,7 @@ INPUTOBJECT : Identity Parameter
https://learn.microsoft.com/powershell/module/az.advisor/Set-AzAdvisorConfiguration
#>
function Set-AzAdvisorConfiguration {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData])]
[CmdletBinding(DefaultParameterSetName='CreateByLCT', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='CreateByLCT')]
@@ -882,9 +920,9 @@ param(
[Parameter(ParameterSetName='CreateByLCT')]
[Parameter(ParameterSetName='CreateByInputObject')]
- [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Support.CpuThreshold])]
+ [Microsoft.Azure.PowerShell.Cmdlets.Advisor.PSArgumentCompleterAttribute("5", "10", "15", "20")]
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.Advisor.Support.CpuThreshold]
+ [System.String]
# Minimum percentage threshold for Advisor low CPU utilization evaluation.
# Valid only for subscriptions.
# Valid values: 5 (default), 10, 15 or 20.
@@ -945,6 +983,15 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -968,9 +1015,7 @@ begin {
CreateByRG = 'Az.Advisor.custom\Set-AzAdvisorConfiguration';
CreateByInputObject = 'Az.Advisor.custom\Set-AzAdvisorConfiguration';
}
- if (('CreateByLCT', 'CreateByRG') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
- $testPlayback = $false
- $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if (('CreateByLCT', 'CreateByRG') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
@@ -984,6 +1029,9 @@ begin {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
diff --git a/generated/Advisor/Advisor.Autorest/exports/Set-AzAdvisorConfiguration.ps1 b/generated/Advisor/Advisor.Autorest/exports/Set-AzAdvisorConfiguration.ps1
index d21513b0ec95..e25e916604f2 100644
--- a/generated/Advisor/Advisor.Autorest/exports/Set-AzAdvisorConfiguration.ps1
+++ b/generated/Advisor/Advisor.Autorest/exports/Set-AzAdvisorConfiguration.ps1
@@ -27,14 +27,14 @@ Set-AzAdvisorConfiguration -Exclude
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IAdvisorIdentity
.Outputs
-Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData
+Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData
.Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
-INPUTOBJECT : Identity Parameter
- [ConfigurationName ]: Advisor configuration name. Value must be 'default'
+INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ [ConfigurationName ]: Advisor configuration name. Value must be 'default'
[Id ]: Resource identity path
[Name ]: Name of metadata entity.
[OperationId ]: The operation ID, which can be found from the Location field in the generate recommendation response header.
@@ -46,7 +46,7 @@ INPUTOBJECT : Identity Parameter
https://learn.microsoft.com/powershell/module/az.advisor/Set-AzAdvisorConfiguration
#>
function Set-AzAdvisorConfiguration {
-[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData])]
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData])]
[CmdletBinding(DefaultParameterSetName='CreateByLCT', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='CreateByLCT')]
@@ -79,9 +79,9 @@ param(
[Parameter(ParameterSetName='CreateByLCT')]
[Parameter(ParameterSetName='CreateByInputObject')]
- [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Advisor.Support.CpuThreshold])]
+ [Microsoft.Azure.PowerShell.Cmdlets.Advisor.PSArgumentCompleterAttribute("5", "10", "15", "20")]
[Microsoft.Azure.PowerShell.Cmdlets.Advisor.Category('Body')]
- [Microsoft.Azure.PowerShell.Cmdlets.Advisor.Support.CpuThreshold]
+ [System.String]
# Minimum percentage threshold for Advisor low CPU utilization evaluation.
# Valid only for subscriptions.
# Valid values: 5 (default), 10, 15 or 20.
@@ -142,6 +142,15 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
+
+ $testPlayback = $false
+ $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+
+ $context = Get-AzContext
+ if (-not $context -and -not $testPlayback) {
+ Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
+ exit
+ }
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -165,9 +174,7 @@ begin {
CreateByRG = 'Az.Advisor.custom\Set-AzAdvisorConfiguration';
CreateByInputObject = 'Az.Advisor.custom\Set-AzAdvisorConfiguration';
}
- if (('CreateByLCT', 'CreateByRG') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
- $testPlayback = $false
- $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
+ if (('CreateByLCT', 'CreateByRG') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
if ($testPlayback) {
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
} else {
@@ -181,6 +188,9 @@ begin {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ if ($wrappedCmd -eq $null) {
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
+ }
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
diff --git a/generated/Advisor/Advisor.Autorest/generate-info.json b/generated/Advisor/Advisor.Autorest/generate-info.json
index 1a51f8833396..4283d9c9af94 100644
--- a/generated/Advisor/Advisor.Autorest/generate-info.json
+++ b/generated/Advisor/Advisor.Autorest/generate-info.json
@@ -1,3 +1,3 @@
{
- "generate_Id": "faee0227-0eba-4ed3-a077-ed0edaf2610f"
+ "generate_Id": "1ccf0044-c18b-4489-b1da-75cfd3396fcb"
}
diff --git a/generated/Advisor/Advisor.Autorest/generated/Module.cs b/generated/Advisor/Advisor.Autorest/generated/Module.cs
index 86550e8d1d51..bc104810e7cc 100644
--- a/generated/Advisor/Advisor.Autorest/generated/Module.cs
+++ b/generated/Advisor/Advisor.Autorest/generated/Module.cs
@@ -28,12 +28,20 @@ public partial class Module
public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler();
+ private static bool _init = false;
+
+ private static readonly global::System.Object _initLock = new global::System.Object();
+
+ private static Microsoft.Azure.PowerShell.Cmdlets.Advisor.Module _instance;
+
/// the ISendAsync pipeline instance
private Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.HttpPipeline _pipeline;
/// the ISendAsync pipeline instance (when proxy is enabled)
private Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.HttpPipeline _pipelineWithProxy;
+ private static readonly global::System.Object _singletonLock = new global::System.Object();
+
public bool _useProxy = false;
public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy();
@@ -56,11 +64,8 @@ public partial class Module
/// The delegate to get the telemetry info.
public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; }
- /// Backing field for property.
- private static Microsoft.Azure.PowerShell.Cmdlets.Advisor.Module _instance;
-
/// the singleton of this module class
- public static Microsoft.Azure.PowerShell.Cmdlets.Advisor.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Advisor.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Advisor.Module());
+ public static Microsoft.Azure.PowerShell.Cmdlets.Advisor.Module Instance { get { if (_instance == null) { lock (_singletonLock) { if (_instance == null) { _instance = new Module(); }}} return _instance; } }
/// The Name of this module
public string Name => @"Az.Advisor";
@@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.HttpPipeline CreatePip
/// 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();
+ if (_init == false)
+ {
+ lock (_initLock) {
+ if (_init == false) {
+ 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();
+ _init = true;
+ }
+ }
+ }
}
/// Creates the module instance.
diff --git a/generated/Advisor/Advisor.Autorest/generated/api/Advisor.cs b/generated/Advisor/Advisor.Autorest/generated/api/Advisor.cs
index dad2d847bbc0..f8bff53b8082 100644
--- a/generated/Advisor/Advisor.Autorest/generated/api/Advisor.cs
+++ b/generated/Advisor/Advisor.Autorest/generated/api/Advisor.cs
@@ -14,7 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Advisor
public partial class Advisor
{
- /// Create/Overwrite Azure Advisor configuration.
+ /// create Overwrite Azure Advisor configuration.
/// The Azure subscription ID.
/// The name of the Azure resource group.
/// The Azure Advisor configuration data structure.
@@ -23,13 +23,14 @@ public partial class Advisor
/// elsewhere).
/// an instance that will receive events.
/// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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 ConfigurationsCreateInResourceGroup(string subscriptionId, string resourceGroup, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task ConfigurationsCreateInResourceGroup(string subscriptionId, string resourceGroup, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeUpdate)
{
- var apiVersion = @"2020-01-01";
var configurationName = @"default";
+ var apiVersion = @"2020-01-01";
// Constant Parameters
using( NoSynchronizationContext )
{
@@ -54,15 +55,15 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
// set body content
- request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ 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.Advisor.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.ConfigurationsCreateInResourceGroup_Call(request,onOk,onDefault,eventListener,sender);
+ await this.ConfigurationsCreateInResourceGroup_Call (request, onOk,onDefault,eventListener,sender);
}
}
- /// Create/Overwrite Azure Advisor configuration.
+ /// create Overwrite Azure Advisor configuration.
///
/// The Azure Advisor configuration data structure.
/// a delegate that is called when the remote service returns 200 (OK).
@@ -70,10 +71,11 @@ public partial class Advisor
/// elsewhere).
/// an instance that will receive events.
/// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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 ConfigurationsCreateInResourceGroupViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task ConfigurationsCreateInResourceGroupViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeUpdate)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -89,8 +91,8 @@ public partial class Advisor
// replace URI parameters with values from identity
var subscriptionId = _match.Groups["subscriptionId"].Value;
- var configurationName = _match.Groups["configurationName"].Value;
var resourceGroup = _match.Groups["resourceGroup"].Value;
+ var configurationName = _match.Groups["configurationName"].Value;
// construct URL
var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
"/subscriptions/"
@@ -112,102 +114,133 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
// set body content
- request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ 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.Advisor.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.ConfigurationsCreateInResourceGroup_Call(request,onOk,onDefault,eventListener,sender);
+ await this.ConfigurationsCreateInResourceGroup_Call (request, onOk,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 default (any response code not handled
- /// elsewhere).
+ /// create Overwrite Azure Advisor configuration.
+ ///
+ /// The Azure Advisor configuration data structure.
/// an instance that will receive events.
/// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.
+ /// A that
+ /// will be complete when handling of the response is completed.
///
- internal async global::System.Threading.Tasks.Task ConfigurationsCreateInResourceGroup_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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task ConfigurationsCreateInResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData body, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeUpdate)
{
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
using( NoSynchronizationContext )
{
- global::System.Net.Http.HttpResponseMessage _response = null;
- try
- {
- var sendTask = sender.SendAsync(request, eventListener);
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
- _response = await sendTask;
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- var _contentType = _response.Content.Headers.ContentType?.MediaType;
+ // verify that Identity format is an exact match for uri
- switch ( _response.StatusCode )
- {
- case global::System.Net.HttpStatusCode.OK:
- {
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ConfigData.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
- break;
- }
- default:
- {
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
- break;
- }
- }
- }
- finally
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Advisor/configurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
{
- // finally statements
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.Finally, request, _response);
- _response?.Dispose();
- request?.Dispose();
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations/{configurationName}'");
}
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroup = _match.Groups["resourceGroup"].Value;
+ var configurationName = _match.Groups["configurationName"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroup
+ + "/providers/Microsoft.Advisor/configurations/"
+ + configurationName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ConfigurationsCreateInResourceGroupWithResult_Call (request, eventListener,sender);
}
}
- ///
- /// Validation method for method. Call this like the actual call, but you
- /// will get validation events back.
- ///
+ /// create Overwrite Azure Advisor configuration.
/// The Azure subscription ID.
/// The name of the Azure resource group.
- /// The Azure Advisor configuration data structure.
+ /// Json string supplied to the ConfigurationsCreateInResourceGroup 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.Advisor.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 ConfigurationsCreateInResourceGroup_Validate(string subscriptionId, string resourceGroup, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData body, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener)
+ public async global::System.Threading.Tasks.Task ConfigurationsCreateInResourceGroupViaJsonString(string subscriptionId, string resourceGroup, 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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
+ var configurationName = @"default";
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
using( NoSynchronizationContext )
{
- await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
- await eventListener.AssertNotNull(nameof(resourceGroup),resourceGroup);
- await eventListener.AssertNotNull(nameof(body), body);
- await eventListener.AssertObjectIsValid(nameof(body), body);
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroup)
+ + "/providers/Microsoft.Advisor/configurations/"
+ + global::System.Uri.EscapeDataString(configurationName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ConfigurationsCreateInResourceGroup_Call (request, onOk,onDefault,eventListener,sender);
}
}
- ///
- /// Create/Overwrite Azure Advisor configuration and also delete all configurations of contained resource groups.
- ///
+ /// create Overwrite Azure Advisor configuration.
/// The Azure subscription ID.
- /// The Azure Advisor configuration data structure.
- /// 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).
+ /// The name of the Azure resource group.
+ /// Json string supplied to the ConfigurationsCreateInResourceGroup operation
/// an instance that will receive events.
/// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync pipeline to use to make the request.
///
- /// A that will be complete when handling of the response is completed.
+ /// A that
+ /// will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task ConfigurationsCreateInSubscription(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task ConfigurationsCreateInResourceGroupViaJsonStringWithResult(string subscriptionId, string resourceGroup, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
- var apiVersion = @"2020-01-01";
var configurationName = @"default";
+ var apiVersion = @"2020-01-01";
// Constant Parameters
using( NoSynchronizationContext )
{
@@ -215,87 +248,143 @@ public partial class Advisor
var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
"/subscriptions/"
+ global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroup)
+ "/providers/Microsoft.Advisor/configurations/"
+ global::System.Uri.EscapeDataString(configurationName)
+ "?"
+ "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Put, _url);
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ 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.Advisor.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
// make the call
- await this.ConfigurationsCreateInSubscription_Call(request,onOk,onDefault,eventListener,sender);
+ return await this.ConfigurationsCreateInResourceGroupWithResult_Call (request, eventListener,sender);
}
}
- ///
- /// Create/Overwrite Azure Advisor configuration and also delete all configurations of contained resource groups.
- ///
- ///
+ /// create Overwrite Azure Advisor configuration.
+ /// The Azure subscription ID.
+ /// The name of the Azure resource group.
/// The Azure Advisor configuration data structure.
- /// 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.Advisor.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.
+ /// A that
+ /// will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task ConfigurationsCreateInSubscriptionViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task ConfigurationsCreateInResourceGroupWithResult(string subscriptionId, string resourceGroup, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData body, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeUpdate)
{
+ var configurationName = @"default";
var apiVersion = @"2020-01-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.Advisor/configurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
- if (!_match.Success)
- {
- throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations/{configurationName}'");
- }
-
- // replace URI parameters with values from identity
- var subscriptionId = _match.Groups["subscriptionId"].Value;
- var configurationName = _match.Groups["configurationName"].Value;
// construct URL
var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
"/subscriptions/"
- + subscriptionId
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroup)
+ "/providers/Microsoft.Advisor/configurations/"
- + configurationName
+ + global::System.Uri.EscapeDataString(configurationName)
+ "?"
+ "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Put, _url);
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ 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.Advisor.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
// make the call
- await this.ConfigurationsCreateInSubscription_Call(request,onOk,onDefault,eventListener,sender);
+ return await this.ConfigurationsCreateInResourceGroupWithResult_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.Advisor.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 ConfigurationsCreateInResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ConfigData.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.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.Advisor.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
}
}
- /// Actual wire call for method.
+ ///
+ /// 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
@@ -305,7 +394,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- internal async global::System.Threading.Tasks.Task ConfigurationsCreateInSubscription_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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ internal async global::System.Threading.Tasks.Task ConfigurationsCreateInResourceGroup_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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
using( NoSynchronizationContext )
{
@@ -316,6 +405,7 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
_response = await sendTask;
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
var _contentType = _response.Content.Headers.ContentType?.MediaType;
switch ( _response.StatusCode )
@@ -323,13 +413,13 @@ public partial class Advisor
case global::System.Net.HttpStatusCode.OK:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ConfigData.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ConfigData.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
default:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
}
@@ -345,38 +435,44 @@ public partial class Advisor
}
///
- /// Validation method for method. Call this like the actual call, but you
+ /// Validation method for method. Call this like the actual call, but you
/// will get validation events back.
///
/// The Azure subscription ID.
+ /// The name of the Azure resource group.
/// The Azure Advisor configuration data structure.
/// 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 ConfigurationsCreateInSubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.IConfigData body, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener)
+ internal async global::System.Threading.Tasks.Task ConfigurationsCreateInResourceGroup_Validate(string subscriptionId, string resourceGroup, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData body, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener)
{
using( NoSynchronizationContext )
{
await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(resourceGroup),resourceGroup);
await eventListener.AssertNotNull(nameof(body), body);
await eventListener.AssertObjectIsValid(nameof(body), body);
}
}
- /// Retrieve Azure Advisor configurations.
+ ///
+ /// create Overwrite Azure Advisor configuration and also delete all configurations of contained resource groups.
+ ///
/// The Azure subscription ID.
- /// The name of the Azure resource group.
+ /// The Azure Advisor configuration data structure.
/// 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.Advisor.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 ConfigurationsListByResourceGroup(string subscriptionId, string resourceGroup, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task ConfigurationsCreateInSubscription(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeUpdate)
{
+ var configurationName = @"default";
var apiVersion = @"2020-01-01";
// Constant Parameters
using( NoSynchronizationContext )
@@ -385,9 +481,8 @@ public partial class Advisor
var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
"/subscriptions/"
+ global::System.Uri.EscapeDataString(subscriptionId)
- + "/resourceGroups/"
- + global::System.Uri.EscapeDataString(resourceGroup)
- + "/providers/Microsoft.Advisor/configurations"
+ + "/providers/Microsoft.Advisor/configurations/"
+ + global::System.Uri.EscapeDataString(configurationName)
+ "?"
+ "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
@@ -396,26 +491,34 @@ public partial class Advisor
// 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.Advisor.Runtime.Method.Get, _url);
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Method.Put, _url);
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.ConfigurationsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender);
+ await this.ConfigurationsCreateInSubscription_Call (request, onOk,onDefault,eventListener,sender);
}
}
- /// Retrieve Azure Advisor configurations.
+ ///
+ /// create Overwrite Azure Advisor configuration and also delete all configurations of contained resource groups.
+ ///
///
+ /// The Azure Advisor configuration data structure.
/// 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.Advisor.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 ConfigurationsListByResourceGroupViaIdentity(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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task ConfigurationsCreateInSubscriptionViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeUpdate)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -423,22 +526,21 @@ public partial class Advisor
{
// verify that Identity format is an exact match for uri
- var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Advisor/configurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Advisor/configurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
if (!_match.Success)
{
- throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations'");
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations/{configurationName}'");
}
// replace URI parameters with values from identity
var subscriptionId = _match.Groups["subscriptionId"].Value;
- var resourceGroup = _match.Groups["resourceGroup"].Value;
+ var configurationName = _match.Groups["configurationName"].Value;
// construct URL
var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
"/subscriptions/"
+ subscriptionId
- + "/resourceGroups/"
- + resourceGroup
- + "/providers/Microsoft.Advisor/configurations"
+ + "/providers/Microsoft.Advisor/configurations/"
+ + configurationName
+ "?"
+ "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
@@ -447,50 +549,311 @@ public partial class Advisor
// 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.Advisor.Runtime.Method.Get, _url);
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Method.Put, _url);
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.ConfigurationsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender);
+ await this.ConfigurationsCreateInSubscription_Call (request, onOk,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 default (any response code not handled
- /// elsewhere).
+ ///
+ /// create Overwrite Azure Advisor configuration and also delete all configurations of contained resource groups.
+ ///
+ ///
+ /// The Azure Advisor configuration data structure.
/// an instance that will receive events.
/// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.
+ /// A that
+ /// will be complete when handling of the response is completed.
///
- internal async global::System.Threading.Tasks.Task ConfigurationsListByResourceGroup_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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task ConfigurationsCreateInSubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData body, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeUpdate)
{
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
using( NoSynchronizationContext )
{
- global::System.Net.Http.HttpResponseMessage _response = null;
- try
- {
- var sendTask = sender.SendAsync(request, eventListener);
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
- _response = await sendTask;
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- var _contentType = _response.Content.Headers.ContentType?.MediaType;
+ // verify that Identity format is an exact match for uri
- switch ( _response.StatusCode )
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Advisor/configurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations/{configurationName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var configurationName = _match.Groups["configurationName"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/providers/Microsoft.Advisor/configurations/"
+ + configurationName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ConfigurationsCreateInSubscriptionWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ ///
+ /// create Overwrite Azure Advisor configuration and also delete all configurations of contained resource groups.
+ ///
+ /// The Azure subscription ID.
+ /// Json string supplied to the ConfigurationsCreateInSubscription 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.Advisor.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 ConfigurationsCreateInSubscriptionViaJsonString(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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var configurationName = @"default";
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.Advisor/configurations/"
+ + global::System.Uri.EscapeDataString(configurationName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ConfigurationsCreateInSubscription_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// create Overwrite Azure Advisor configuration and also delete all configurations of contained resource groups.
+ ///
+ /// The Azure subscription ID.
+ /// Json string supplied to the ConfigurationsCreateInSubscription operation
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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 ConfigurationsCreateInSubscriptionViaJsonStringWithResult(string subscriptionId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var configurationName = @"default";
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.Advisor/configurations/"
+ + global::System.Uri.EscapeDataString(configurationName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ConfigurationsCreateInSubscriptionWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ ///
+ /// create Overwrite Azure Advisor configuration and also delete all configurations of contained resource groups.
+ ///
+ /// The Azure subscription ID.
+ /// The Azure Advisor configuration data structure.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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 ConfigurationsCreateInSubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData body, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.SerializationMode.IncludeUpdate)
+ {
+ var configurationName = @"default";
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.Advisor/configurations/"
+ + global::System.Uri.EscapeDataString(configurationName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ConfigurationsCreateInSubscriptionWithResult_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.Advisor.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 ConfigurationsCreateInSubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ConfigData.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.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.Advisor.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.Advisor.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 ConfigurationsCreateInSubscription_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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ConfigurationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ConfigData.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
default:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
}
@@ -506,28 +869,28 @@ public partial class Advisor
}
///
- /// Validation method for method. Call this like the actual call, but you
+ /// Validation method for method. Call this like the actual call, but you
/// will get validation events back.
///
/// The Azure subscription ID.
- /// The name of the Azure resource group.
+ /// The Azure Advisor configuration data structure.
/// 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 ConfigurationsListByResourceGroup_Validate(string subscriptionId, string resourceGroup, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener)
+ internal async global::System.Threading.Tasks.Task ConfigurationsCreateInSubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.IConfigData body, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener)
{
using( NoSynchronizationContext )
{
await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
- await eventListener.AssertNotNull(nameof(resourceGroup),resourceGroup);
+ await eventListener.AssertNotNull(nameof(body), body);
+ await eventListener.AssertObjectIsValid(nameof(body), body);
}
}
- ///
- /// Retrieve Azure Advisor configurations and also retrieve configurations of contained resource groups.
- ///
+ /// Retrieve Azure Advisor configurations.
/// The Azure subscription ID.
+ /// The name of the Azure resource group.
/// 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).
@@ -536,7 +899,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task ConfigurationsListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task ConfigurationsListByResourceGroup(string subscriptionId, string resourceGroup, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -546,6 +909,8 @@ public partial class Advisor
var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
"/subscriptions/"
+ global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroup)
+ "/providers/Microsoft.Advisor/configurations"
+ "?"
+ "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
@@ -560,13 +925,11 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.ConfigurationsListBySubscription_Call(request,onOk,onDefault,eventListener,sender);
+ await this.ConfigurationsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender);
}
}
- ///
- /// Retrieve Azure Advisor configurations and also retrieve configurations of contained resource groups.
- ///
+ /// Retrieve Azure Advisor configurations.
///
/// 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
@@ -576,7 +939,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task ConfigurationsListBySubscriptionViaIdentity(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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task ConfigurationsListByResourceGroupViaIdentity(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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -584,18 +947,21 @@ public partial class Advisor
{
// verify that Identity format is an exact match for uri
- var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Advisor/configurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Advisor/configurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
if (!_match.Success)
{
- throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations'");
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations'");
}
// replace URI parameters with values from identity
var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroup = _match.Groups["resourceGroup"].Value;
// construct URL
var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
"/subscriptions/"
+ subscriptionId
+ + "/resourceGroups/"
+ + resourceGroup
+ "/providers/Microsoft.Advisor/configurations"
+ "?"
+ "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
@@ -610,11 +976,751 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.ConfigurationsListBySubscription_Call(request,onOk,onDefault,eventListener,sender);
+ await this.ConfigurationsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Retrieve Azure Advisor configurations.
+ ///
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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 ConfigurationsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2020-01-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.Advisor/configurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroup = _match.Groups["resourceGroup"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroup
+ + "/providers/Microsoft.Advisor/configurations"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ConfigurationsListByResourceGroupWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Retrieve Azure Advisor configurations.
+ /// The Azure subscription ID.
+ /// The name of the Azure resource group.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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 ConfigurationsListByResourceGroupWithResult(string subscriptionId, string resourceGroup, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2020-01-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(resourceGroup)
+ + "/providers/Microsoft.Advisor/configurations"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ConfigurationsListByResourceGroupWithResult_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.Advisor.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 ConfigurationsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ConfigurationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.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.Advisor.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.Advisor.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 ConfigurationsListByResourceGroup_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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ConfigurationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.
+ ///
+ /// The Azure subscription ID.
+ /// The name of the Azure resource group.
+ /// 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 ConfigurationsListByResourceGroup_Validate(string subscriptionId, string resourceGroup, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(resourceGroup),resourceGroup);
+ }
+ }
+
+ ///
+ /// Retrieve Azure Advisor configurations and also retrieve configurations of contained resource groups.
+ ///
+ /// The Azure subscription ID.
+ /// 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.Advisor.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 ConfigurationsListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.Advisor/configurations"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ConfigurationsListBySubscription_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// Retrieve Azure Advisor configurations and also retrieve configurations of contained resource groups.
+ ///
+ ///
+ /// 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.Advisor.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 ConfigurationsListBySubscriptionViaIdentity(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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2020-01-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.Advisor/configurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations'");
+ }
+
+ // 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.Advisor/configurations"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ConfigurationsListBySubscription_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// Retrieve Azure Advisor configurations and also retrieve configurations of contained resource groups.
+ ///
+ ///
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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 ConfigurationsListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2020-01-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.Advisor/configurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations'");
+ }
+
+ // 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.Advisor/configurations"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ConfigurationsListBySubscriptionWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ ///
+ /// Retrieve Azure Advisor configurations and also retrieve configurations of contained resource groups.
+ ///
+ /// The Azure subscription ID.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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 ConfigurationsListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.Advisor/configurations"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.ConfigurationsListBySubscriptionWithResult_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.Advisor.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 ConfigurationsListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ConfigurationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.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.Advisor.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.Advisor.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 ConfigurationsListBySubscription_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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ConfigurationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.
+ ///
+ /// The Azure subscription ID.
+ /// 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 ConfigurationsListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ }
+ }
+
+ /// Lists all the available Advisor REST API operations.
+ /// 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.Advisor.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 OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/providers/Microsoft.Advisor/operations"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Lists all the available Advisor REST API operations.
+ ///
+ /// 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.Advisor.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 OperationsListViaIdentity(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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Advisor/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Advisor/operations'");
+ }
+
+ // replace URI parameters with values from identity
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/providers/Microsoft.Advisor/operations"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Lists all the available Advisor REST API operations.
+ ///
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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 OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Advisor/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Advisor/operations'");
+ }
+
+ // replace URI parameters with values from identity
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/providers/Microsoft.Advisor/operations"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.OperationsListWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Lists all the available Advisor REST API operations.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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 OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/providers/Microsoft.Advisor/operations"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.OperationsListWithResult_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.Advisor.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 OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.OperationEntityListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.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.Advisor.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
}
}
- /// Actual wire call for method.
+ /// 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
@@ -624,7 +1730,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- internal async global::System.Threading.Tasks.Task ConfigurationsListBySubscription_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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ internal async global::System.Threading.Tasks.Task OperationsList_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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
using( NoSynchronizationContext )
{
@@ -635,6 +1741,7 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
_response = await sendTask;
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
var _contentType = _response.Content.Headers.ContentType?.MediaType;
switch ( _response.StatusCode )
@@ -642,13 +1749,13 @@ public partial class Advisor
case global::System.Net.HttpStatusCode.OK:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ConfigurationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.OperationEntityListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
default:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
}
@@ -664,23 +1771,23 @@ public partial class Advisor
}
///
- /// Validation method for method. Call this like the actual call, but you
- /// will get validation events back.
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
///
- /// The Azure subscription ID.
/// 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 ConfigurationsListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener)
+ internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener)
{
using( NoSynchronizationContext )
{
- await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+
}
}
- /// Lists all the available Advisor REST API operations.
+ /// Gets the metadata entity.
+ /// Name of metadata entity.
/// 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).
@@ -689,7 +1796,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task RecommendationMetadataGet(string name, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -697,7 +1804,8 @@ public partial class Advisor
{
// construct URL
var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
- "/providers/Microsoft.Advisor/operations"
+ "/providers/Microsoft.Advisor/metadata/"
+ + global::System.Uri.EscapeDataString(name)
+ "?"
+ "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
@@ -711,11 +1819,11 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender);
+ await this.RecommendationMetadataGet_Call (request, onOk,onDefault,eventListener,sender);
}
}
- /// Lists all the available Advisor REST API operations.
+ /// Gets the metadata entity.
///
/// 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
@@ -725,7 +1833,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task OperationsListViaIdentity(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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task RecommendationMetadataGetViaIdentity(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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -733,16 +1841,18 @@ public partial class Advisor
{
// verify that Identity format is an exact match for uri
- var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Advisor/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Advisor/metadata/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
if (!_match.Success)
{
- throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Advisor/operations'");
+ throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Advisor/metadata/{name}'");
}
// replace URI parameters with values from identity
+ var name = _match.Groups["name"].Value;
// construct URL
var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
- "/providers/Microsoft.Advisor/operations"
+ "/providers/Microsoft.Advisor/metadata/"
+ + name
+ "?"
+ "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
@@ -756,11 +1866,153 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender);
+ await this.RecommendationMetadataGet_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Gets the metadata entity.
+ ///
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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 RecommendationMetadataGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Advisor/metadata/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Advisor/metadata/{name}'");
+ }
+
+ // replace URI parameters with values from identity
+ var name = _match.Groups["name"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/providers/Microsoft.Advisor/metadata/"
+ + name
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.RecommendationMetadataGetWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Gets the metadata entity.
+ /// Name of metadata entity.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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 RecommendationMetadataGetWithResult(string name, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/providers/Microsoft.Advisor/metadata/"
+ + global::System.Uri.EscapeDataString(name)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.RecommendationMetadataGetWithResult_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.Advisor.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 RecommendationMetadataGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.MetadataEntity.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.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.Advisor.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
}
}
- /// Actual wire call for method.
+ /// 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
@@ -770,7 +2022,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- internal async global::System.Threading.Tasks.Task OperationsList_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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ internal async global::System.Threading.Tasks.Task RecommendationMetadataGet_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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
using( NoSynchronizationContext )
{
@@ -781,6 +2033,7 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
_response = await sendTask;
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
var _contentType = _response.Content.Headers.ContentType?.MediaType;
switch ( _response.StatusCode )
@@ -788,13 +2041,13 @@ public partial class Advisor
case global::System.Net.HttpStatusCode.OK:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.OperationEntityListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.MetadataEntity.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
default:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
}
@@ -810,25 +2063,24 @@ public partial class Advisor
}
///
- /// Validation method for method. Call this like the actual call, but you will get validation
- /// events back.
+ /// Validation method for method. Call this like the actual call, but you will get
+ /// validation events back.
///
+ /// Name of metadata entity.
/// 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 OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener)
+ internal async global::System.Threading.Tasks.Task RecommendationMetadataGet_Validate(string name, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener)
{
using( NoSynchronizationContext )
{
-
+ await eventListener.AssertNotNull(nameof(name),name);
}
}
- /// Gets the metadata entity.
- /// Name of metadata entity.
+ /// Gets the list of metadata entities.
/// a delegate that is called when the remote service returns 200 (OK).
- /// a delegate that is called when the remote service returns 404 (NotFound).
/// a delegate that is called when the remote service returns default (any response code not handled
/// elsewhere).
/// an instance that will receive events.
@@ -836,7 +2088,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task RecommendationMetadataGet(string name, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task RecommendationMetadataList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -844,8 +2096,7 @@ public partial class Advisor
{
// construct URL
var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
- "/providers/Microsoft.Advisor/metadata/"
- + global::System.Uri.EscapeDataString(name)
+ "/providers/Microsoft.Advisor/metadata"
+ "?"
+ "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
@@ -859,14 +2110,13 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.RecommendationMetadataGet_Call(request,onOk,onNotFound,onDefault,eventListener,sender);
+ await this.RecommendationMetadataList_Call (request, onOk,onDefault,eventListener,sender);
}
}
- /// Gets the metadata entity.
+ /// Gets the list of metadata entities.
///
/// a delegate that is called when the remote service returns 200 (OK).
- /// a delegate that is called when the remote service returns 404 (NotFound).
/// a delegate that is called when the remote service returns default (any response code not handled
/// elsewhere).
/// an instance that will receive events.
@@ -874,7 +2124,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task RecommendationMetadataGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task RecommendationMetadataListViaIdentity(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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -882,18 +2132,16 @@ public partial class Advisor
{
// verify that Identity format is an exact match for uri
- var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Advisor/metadata/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Advisor/metadata$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
if (!_match.Success)
{
- throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Advisor/metadata/{name}'");
+ throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Advisor/metadata'");
}
// replace URI parameters with values from identity
- var name = _match.Groups["name"].Value;
// construct URL
var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
- "/providers/Microsoft.Advisor/metadata/"
- + name
+ "/providers/Microsoft.Advisor/metadata"
+ "?"
+ "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
@@ -907,93 +2155,61 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.RecommendationMetadataGet_Call(request,onOk,onNotFound,onDefault,eventListener,sender);
+ await this.RecommendationMetadataList_Call (request, onOk,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 404 (NotFound).
- /// a delegate that is called when the remote service returns default (any response code not handled
- /// elsewhere).
+ /// Gets the list of metadata entities.
+ ///
/// an instance that will receive events.
/// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync pipeline to use to make the request.
///
- /// A that will be complete when handling of the response is completed.
+ /// A that will be complete when handling of the response is completed.
///
- internal async global::System.Threading.Tasks.Task RecommendationMetadataGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onNotFound, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task RecommendationMetadataListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
using( NoSynchronizationContext )
{
- global::System.Net.Http.HttpResponseMessage _response = null;
- try
- {
- var sendTask = sender.SendAsync(request, eventListener);
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
- _response = await sendTask;
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- var _contentType = _response.Content.Headers.ContentType?.MediaType;
+ // verify that Identity format is an exact match for uri
- switch ( _response.StatusCode )
- {
- case global::System.Net.HttpStatusCode.OK:
- {
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.MetadataEntity.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
- break;
- }
- case global::System.Net.HttpStatusCode.NotFound:
- {
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onNotFound(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ArmErrorResponseBody.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
- break;
- }
- default:
- {
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
- break;
- }
- }
- }
- finally
+ var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Advisor/metadata$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
{
- // finally statements
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.Finally, request, _response);
- _response?.Dispose();
- request?.Dispose();
+ throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Advisor/metadata'");
}
- }
- }
- ///
- /// Validation method for method. Call this like the actual call, but you will get
- /// validation events back.
- ///
- /// Name of metadata entity.
- /// 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 RecommendationMetadataGet_Validate(string name, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener)
- {
- using( NoSynchronizationContext )
- {
- await eventListener.AssertNotNull(nameof(name),name);
+ // replace URI parameters with values from identity
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/providers/Microsoft.Advisor/metadata"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.RecommendationMetadataListWithResult_Call (request, eventListener,sender);
}
}
/// Gets the list of metadata entities.
- /// 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.Advisor.Runtime.ISendAsync pipeline to use to make the request.
///
- /// A that will be complete when handling of the response is completed.
+ /// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task RecommendationMetadataList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task RecommendationMetadataListWithResult(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -1006,65 +2222,82 @@ public partial class Advisor
+ "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
// make the call
- await this.RecommendationMetadataList_Call(request,onOk,onDefault,eventListener,sender);
+ return await this.RecommendationMetadataListWithResult_Call (request, eventListener,sender);
}
}
- /// Gets the list of metadata entities.
- ///
- /// 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).
+ ///
+ /// Actual wire call for method.
+ ///
+ /// the prepared HttpRequestMessage to send.
/// an instance that will receive events.
/// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync pipeline to use to make the request.
///
- /// A that will be complete when handling of the response is completed.
+ /// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task RecommendationMetadataListViaIdentity(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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ internal async global::System.Threading.Tasks.Task RecommendationMetadataListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
- var apiVersion = @"2020-01-01";
- // Constant Parameters
using( NoSynchronizationContext )
{
- // verify that Identity format is an exact match for uri
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
- var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Advisor/metadata$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
- if (!_match.Success)
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.MetadataEntityListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.RestException(_response, await _result);
+ throw ex;
+ }
+ else
+ {
+ throw new global::System.Exception($"[{code}] : {message}");
+ }
+ }
+ }
+ }
+ finally
{
- throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Advisor/metadata'");
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
}
-
- // replace URI parameters with values from identity
- // construct URL
- var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
- "/providers/Microsoft.Advisor/metadata"
- + "?"
- + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
- ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
-
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
-
- await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
- // make the call
- await this.RecommendationMetadataList_Call(request,onOk,onDefault,eventListener,sender);
}
}
- /// Actual wire call for method.
+ /// 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
@@ -1074,7 +2307,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- internal async global::System.Threading.Tasks.Task RecommendationMetadataList_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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ internal async global::System.Threading.Tasks.Task RecommendationMetadataList_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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
using( NoSynchronizationContext )
{
@@ -1085,6 +2318,7 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
_response = await sendTask;
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
var _contentType = _response.Content.Headers.ContentType?.MediaType;
switch ( _response.StatusCode )
@@ -1092,13 +2326,13 @@ public partial class Advisor
case global::System.Net.HttpStatusCode.OK:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.MetadataEntityListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.MetadataEntityListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
default:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
}
@@ -1142,7 +2376,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task RecommendationsGenerate(string subscriptionId, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task RecommendationsGenerate(string subscriptionId, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -1166,7 +2400,7 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.RecommendationsGenerate_Call(request,onAccepted,onDefault,eventListener,sender);
+ await this.RecommendationsGenerate_Call (request, onAccepted,onDefault,eventListener,sender);
}
}
@@ -1183,7 +2417,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task RecommendationsGenerateViaIdentity(global::System.String viaIdentity, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task RecommendationsGenerateViaIdentity(global::System.String viaIdentity, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -1191,10 +2425,10 @@ public partial class Advisor
{
// verify that Identity format is an exact match for uri
- var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Advisor/generateRecommendations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Advisor$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
if (!_match.Success)
{
- throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations'");
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor'");
}
// replace URI parameters with values from identity
@@ -1217,11 +2451,11 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.RecommendationsGenerate_Call(request,onAccepted,onDefault,eventListener,sender);
+ await this.RecommendationsGenerate_Call (request, onAccepted,onDefault,eventListener,sender);
}
}
- /// Actual wire call for method.
+ /// Actual wire call for method.
/// the prepared HttpRequestMessage to send.
/// a delegate that is called when the remote service returns 202 (Accepted).
/// a delegate that is called when the remote service returns default (any response code not handled
@@ -1231,7 +2465,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- internal async global::System.Threading.Tasks.Task RecommendationsGenerate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ internal async global::System.Threading.Tasks.Task RecommendationsGenerate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
using( NoSynchronizationContext )
{
@@ -1242,6 +2476,7 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
_response = await sendTask;
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
var _contentType = _response.Content.Headers.ContentType?.MediaType;
switch ( _response.StatusCode )
@@ -1255,7 +2490,7 @@ public partial class Advisor
default:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
}
@@ -1299,7 +2534,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task RecommendationsGet(string resourceUri, string recommendationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task RecommendationsGet(string resourceUri, string recommendationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -1324,7 +2559,7 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.RecommendationsGet_Call(request,onOk,onDefault,eventListener,sender);
+ await this.RecommendationsGet_Call (request, onOk,onDefault,eventListener,sender);
}
}
@@ -1344,7 +2579,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task RecommendationsGetGenerateStatus(string subscriptionId, string operationId, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task RecommendationsGetGenerateStatus(string subscriptionId, string operationId, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -1369,7 +2604,7 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.RecommendationsGetGenerateStatus_Call(request,onAccepted,onNoContent,onDefault,eventListener,sender);
+ await this.RecommendationsGetGenerateStatus_Call (request, onAccepted,onNoContent,onDefault,eventListener,sender);
}
}
@@ -1387,7 +2622,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task RecommendationsGetGenerateStatusViaIdentity(global::System.String viaIdentity, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task RecommendationsGetGenerateStatusViaIdentity(global::System.String viaIdentity, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -1423,11 +2658,11 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.RecommendationsGetGenerateStatus_Call(request,onAccepted,onNoContent,onDefault,eventListener,sender);
+ await this.RecommendationsGetGenerateStatus_Call (request, onAccepted,onNoContent,onDefault,eventListener,sender);
}
}
- /// Actual wire call for method.
+ /// Actual wire call for method.
/// the prepared HttpRequestMessage to send.
/// a delegate that is called when the remote service returns 202 (Accepted).
/// a delegate that is called when the remote service returns 204 (NoContent).
@@ -1438,7 +2673,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- internal async global::System.Threading.Tasks.Task RecommendationsGetGenerateStatus_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ internal async global::System.Threading.Tasks.Task RecommendationsGetGenerateStatus_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onAccepted, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
using( NoSynchronizationContext )
{
@@ -1449,6 +2684,7 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
_response = await sendTask;
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; }
var _contentType = _response.Content.Headers.ContentType?.MediaType;
switch ( _response.StatusCode )
@@ -1468,7 +2704,7 @@ public partial class Advisor
default:
{
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
- await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.Api202001.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) ));
break;
}
}
@@ -1514,7 +2750,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- public async global::System.Threading.Tasks.Task RecommendationsGetViaIdentity(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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ public async global::System.Threading.Tasks.Task RecommendationsGetViaIdentity(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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
{
var apiVersion = @"2020-01-01";
// Constant Parameters
@@ -1550,11 +2786,158 @@ public partial class Advisor
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
// make the call
- await this.RecommendationsGet_Call(request,onOk,onDefault,eventListener,sender);
+ await this.RecommendationsGet_Call (request, onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Obtains details of a cached recommendation.
+ ///
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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 RecommendationsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Advisor/recommendations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}'");
+ }
+
+ // replace URI parameters with values from identity
+ var resourceUri = _match.Groups["resourceUri"].Value;
+ var recommendationId = _match.Groups["recommendationId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/"
+ + resourceUri
+ + "/providers/Microsoft.Advisor/recommendations/"
+ + recommendationId
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.RecommendationsGetWithResult_Call (request, eventListener,sender);
+ }
+ }
+
+ /// Obtains details of a cached recommendation.
+ /// The fully qualified Azure Resource Manager identifier of the resource to which the recommendation
+ /// applies.
+ /// The recommendation ID.
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Advisor.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 RecommendationsGetWithResult(string resourceUri, string recommendationId, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2020-01-01";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/"
+ + global::System.Uri.EscapeDataString(resourceUri)
+ + "/providers/Microsoft.Advisor/recommendations/"
+ + global::System.Uri.EscapeDataString(recommendationId)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ // make the call
+ return await this.RecommendationsGetWithResult_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.Advisor.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 RecommendationsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ResourceRecommendationBase.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Json.JsonNode.Parse(body.Result)) );
+ return await _result;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; }
+ var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Advisor.Models.ArmErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Advisor.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.Advisor.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.Advisor.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
}
}
- /// Actual wire call for method.
+ /// 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
@@ -1564,7 +2947,7 @@ public partial class Advisor
///
/// A that will be complete when handling of the response is completed.
///
- internal async global::System.Threading.Tasks.Task RecommendationsGet_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.Advisor.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Advisor.Runtime.ISendAsync sender)
+ internal async global::System.Threading.Tasks.Task RecommendationsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func