From bacaa7e702852e4c72554fa93f5dd97e3f749064 Mon Sep 17 00:00:00 2001 From: azure-powershell-bot <65331932+azure-powershell-bot@users.noreply.github.com> Date: Fri, 18 Apr 2025 03:39:26 +0000 Subject: [PATCH] [skip ci] Archive 67d1fa22b35a9bd9a4a405649b4d787a909e2ef9 --- .../Datadog.Autorest/Az.Datadog.csproj | 2 +- .../Datadog.Autorest/Az.Datadog.format.ps1xml | 440 +- .../Datadog/Datadog.Autorest/Az.Datadog.psd1 | 3 +- .../Properties/AssemblyInfo.cs | 29 +- .../Datadog.Autorest/check-dependencies.ps1 | 6 +- .../Get-AzDatadogMarketplaceAgreement.ps1 | 20 +- .../exports/Get-AzDatadogMonitor.ps1 | 21 +- .../exports/Get-AzDatadogMonitorApiKey.ps1 | 20 +- .../Get-AzDatadogMonitorDefaultKey.ps1 | 21 +- .../exports/Get-AzDatadogMonitorHost.ps1 | 20 +- .../Get-AzDatadogMonitorLinkedResource.ps1 | 20 +- .../Get-AzDatadogMonitorMonitoredResource.ps1 | 20 +- ...Get-AzDatadogSingleSignOnConfiguration.ps1 | 37 +- .../exports/Get-AzDatadogTagRule.ps1 | 37 +- .../New-AzDatadogFilteringTagObject.ps1 | 16 +- .../New-AzDatadogMarketplaceAgreement.ps1 | 54 +- .../exports/New-AzDatadogMonitor.ps1 | 132 +- ...New-AzDatadogSingleSignOnConfiguration.ps1 | 71 +- .../exports/New-AzDatadogTagRule.ps1 | 93 +- .../exports/ProxyCmdletDefinitions.ps1 | 1274 ++- .../exports/Remove-AzDatadogMonitor.ps1 | 17 +- .../Set-AzDatadogMonitorDefaultKey.ps1 | 48 +- .../exports/Update-AzDatadogMonitor.ps1 | 60 +- ...Update-AzDatadogMonitorSetPasswordLink.ps1 | 21 +- ...ate-AzDatadogSingleSignOnConfiguration.ps1 | 268 + .../exports/Update-AzDatadogTagRule.ps1 | 298 + .../Datadog.Autorest/generate-info.json | 2 +- .../Datadog.Autorest/generated/Module.cs | 27 +- .../Datadog.Autorest/generated/api/Datadog.cs | 7286 +++++++++++++---- .../generated/api/Models/Any.PowerShell.cs | 4 +- .../generated/api/Models/Any.cs | 6 +- .../generated/api/Models/Any.json.cs | 2 +- .../DatadogMonitorResource.PowerShell.cs | 450 - .../MonitorProperties.PowerShell.cs | 300 - .../MonitoringTagRules.PowerShell.cs | 308 - .../DatadogAgreementProperties.PowerShell.cs | 52 +- ...atadogAgreementProperties.TypeConverter.cs | 6 +- .../DatadogAgreementProperties.cs | 30 +- .../DatadogAgreementProperties.json.cs | 24 +- .../DatadogAgreementResource.PowerShell.cs | 96 +- .../DatadogAgreementResource.TypeConverter.cs | 6 +- .../DatadogAgreementResource.cs | 165 +- .../DatadogAgreementResource.json.cs | 26 +- ...greementResourceListResponse.PowerShell.cs | 30 +- ...ementResourceListResponse.TypeConverter.cs | 6 +- .../DatadogAgreementResourceListResponse.cs | 22 +- ...tadogAgreementResourceListResponse.json.cs | 12 +- .../DatadogApiKey.PowerShell.cs | 36 +- .../DatadogApiKey.TypeConverter.cs | 6 +- .../Models/{Api20210301 => }/DatadogApiKey.cs | 18 +- .../{Api20210301 => }/DatadogApiKey.json.cs | 16 +- .../DatadogApiKeyListResponse.PowerShell.cs | 28 +- ...DatadogApiKeyListResponse.TypeConverter.cs | 6 +- .../DatadogApiKeyListResponse.cs | 22 +- .../DatadogApiKeyListResponse.json.cs | 12 +- .../DatadogHost.PowerShell.cs | 64 +- .../DatadogHost.TypeConverter.cs | 6 +- .../Models/{Api20210301 => }/DatadogHost.cs | 72 +- .../{Api20210301 => }/DatadogHost.json.cs | 18 +- .../DatadogHostListResponse.PowerShell.cs | 28 +- .../DatadogHostListResponse.TypeConverter.cs | 6 +- .../DatadogHostListResponse.cs | 22 +- .../DatadogHostListResponse.json.cs | 12 +- .../DatadogHostMetadata.PowerShell.cs | 48 +- .../DatadogHostMetadata.TypeConverter.cs | 6 +- .../{Api20210301 => }/DatadogHostMetadata.cs | 45 +- .../DatadogHostMetadata.json.cs | 14 +- .../generated/api/Models/DatadogIdentity.cs | 18 + .../api/Models/DatadogIdentity.json.cs | 12 +- .../DatadogInstallMethod.PowerShell.cs | 32 +- .../DatadogInstallMethod.TypeConverter.cs | 6 +- .../{Api20210301 => }/DatadogInstallMethod.cs | 15 +- .../DatadogInstallMethod.json.cs | 14 +- .../DatadogLogsAgent.PowerShell.cs | 24 +- .../DatadogLogsAgent.TypeConverter.cs | 6 +- .../{Api20210301 => }/DatadogLogsAgent.cs | 9 +- .../DatadogLogsAgent.json.cs | 10 +- .../DatadogMonitorResource.PowerShell.cs | 450 + .../DatadogMonitorResource.TypeConverter.cs | 6 +- .../DatadogMonitorResource.cs | 321 +- .../DatadogMonitorResource.json.cs | 34 +- ...gMonitorResourceListResponse.PowerShell.cs | 30 +- ...nitorResourceListResponse.TypeConverter.cs | 6 +- .../DatadogMonitorResourceListResponse.cs | 22 +- ...DatadogMonitorResourceListResponse.json.cs | 12 +- .../DatadogMonitorResourceTags.PowerShell.cs | 20 +- ...atadogMonitorResourceTags.TypeConverter.cs | 6 +- .../DatadogMonitorResourceTags.cs | 6 +- .../DatadogMonitorResourceTags.dictionary.cs | 4 +- .../DatadogMonitorResourceTags.json.cs | 8 +- ...itorResourceUpdateParameters.PowerShell.cs | 42 +- ...rResourceUpdateParameters.TypeConverter.cs | 6 +- .../DatadogMonitorResourceUpdateParameters.cs | 53 +- ...dogMonitorResourceUpdateParameters.json.cs | 14 +- ...ResourceUpdateParametersTags.PowerShell.cs | 20 +- ...ourceUpdateParametersTags.TypeConverter.cs | 6 +- ...adogMonitorResourceUpdateParametersTags.cs | 6 +- ...ResourceUpdateParametersTags.dictionary.cs | 4 +- ...onitorResourceUpdateParametersTags.json.cs | 8 +- ...atadogOrganizationProperties.PowerShell.cs | 54 +- ...dogOrganizationProperties.TypeConverter.cs | 6 +- .../DatadogOrganizationProperties.cs | 34 +- .../DatadogOrganizationProperties.json.cs | 52 +- .../DatadogSetPasswordLink.PowerShell.cs | 24 +- .../DatadogSetPasswordLink.TypeConverter.cs | 6 +- .../DatadogSetPasswordLink.cs | 9 +- .../DatadogSetPasswordLink.json.cs | 10 +- ...atadogSingleSignOnProperties.PowerShell.cs | 38 +- ...dogSingleSignOnProperties.TypeConverter.cs | 6 +- .../DatadogSingleSignOnProperties.cs | 46 +- .../DatadogSingleSignOnProperties.json.cs | 20 +- .../DatadogSingleSignOnResource.PowerShell.cs | 82 +- ...tadogSingleSignOnResource.TypeConverter.cs | 6 +- .../DatadogSingleSignOnResource.cs | 165 +- .../DatadogSingleSignOnResource.json.cs | 26 +- ...leSignOnResourceListResponse.PowerShell.cs | 28 +- ...ignOnResourceListResponse.TypeConverter.cs | 6 +- ...DatadogSingleSignOnResourceListResponse.cs | 22 +- ...ogSingleSignOnResourceListResponse.json.cs | 12 +- .../ErrorAdditionalInfo.PowerShell.cs | 28 +- .../ErrorAdditionalInfo.TypeConverter.cs | 6 +- .../Models/{Api20 => }/ErrorAdditionalInfo.cs | 16 +- .../{Api20 => }/ErrorAdditionalInfo.json.cs | 16 +- .../{Api20 => }/ErrorDetail.PowerShell.cs | 40 +- .../{Api20 => }/ErrorDetail.TypeConverter.cs | 6 +- .../api/Models/{Api20 => }/ErrorDetail.cs | 51 +- .../Models/{Api20 => }/ErrorDetail.json.cs | 30 +- .../{Api20 => }/ErrorResponse.PowerShell.cs | 44 +- .../ErrorResponse.TypeConverter.cs | 6 +- .../api/Models/{Api20 => }/ErrorResponse.cs | 61 +- .../Models/{Api20 => }/ErrorResponse.json.cs | 10 +- .../FilteringTag.PowerShell.cs | 32 +- .../FilteringTag.TypeConverter.cs | 6 +- .../Models/{Api20210301 => }/FilteringTag.cs | 27 +- .../{Api20210301 => }/FilteringTag.json.cs | 16 +- .../IdentityProperties.PowerShell.cs | 32 +- .../IdentityProperties.TypeConverter.cs | 6 +- .../{Api20210301 => }/IdentityProperties.cs | 31 +- .../IdentityProperties.json.cs | 18 +- .../LinkedResource.PowerShell.cs | 24 +- .../LinkedResource.TypeConverter.cs | 6 +- .../{Api20210301 => }/LinkedResource.cs | 9 +- .../{Api20210301 => }/LinkedResource.json.cs | 10 +- .../LinkedResourceListResponse.PowerShell.cs | 28 +- ...inkedResourceListResponse.TypeConverter.cs | 6 +- .../LinkedResourceListResponse.cs | 22 +- .../LinkedResourceListResponse.json.cs | 12 +- .../{Api20210301 => }/LogRules.PowerShell.cs | 36 +- .../LogRules.TypeConverter.cs | 6 +- .../api/Models/{Api20210301 => }/LogRules.cs | 28 +- .../Models/{Api20210301 => }/LogRules.json.cs | 18 +- .../MetricRules.PowerShell.cs | 24 +- .../MetricRules.TypeConverter.cs | 6 +- .../Models/{Api20210301 => }/MetricRules.cs | 19 +- .../{Api20210301 => }/MetricRules.json.cs | 12 +- .../Models/MonitorProperties.PowerShell.cs | 300 + .../MonitorProperties.TypeConverter.cs | 6 +- .../{Api20210301 => }/MonitorProperties.cs | 152 +- .../MonitorProperties.json.cs | 30 +- .../MonitorUpdateProperties.PowerShell.cs | 24 +- .../MonitorUpdateProperties.TypeConverter.cs | 6 +- .../MonitorUpdateProperties.cs | 21 +- .../MonitorUpdateProperties.json.cs | 10 +- .../MonitoredResource.PowerShell.cs | 40 +- .../MonitoredResource.TypeConverter.cs | 6 +- .../{Api20210301 => }/MonitoredResource.cs | 21 +- .../MonitoredResource.json.cs | 18 +- ...onitoredResourceListResponse.PowerShell.cs | 30 +- ...toredResourceListResponse.TypeConverter.cs | 6 +- .../MonitoredResourceListResponse.cs | 22 +- .../MonitoredResourceListResponse.json.cs | 12 +- .../Models/MonitoringTagRules.PowerShell.cs | 308 + .../MonitoringTagRules.TypeConverter.cs | 6 +- .../{Api20210301 => }/MonitoringTagRules.cs | 185 +- .../MonitoringTagRules.json.cs | 26 +- ...nitoringTagRulesListResponse.PowerShell.cs | 30 +- ...oringTagRulesListResponse.TypeConverter.cs | 6 +- .../MonitoringTagRulesListResponse.cs | 22 +- .../MonitoringTagRulesListResponse.json.cs | 12 +- ...MonitoringTagRulesProperties.PowerShell.cs | 54 +- ...itoringTagRulesProperties.TypeConverter.cs | 6 +- .../MonitoringTagRulesProperties.cs | 76 +- .../MonitoringTagRulesProperties.json.cs | 16 +- .../OperationDisplay.PowerShell.cs | 36 +- .../OperationDisplay.TypeConverter.cs | 6 +- .../{Api20210301 => }/OperationDisplay.cs | 18 +- .../OperationDisplay.json.cs | 16 +- .../OperationListResult.PowerShell.cs | 28 +- .../OperationListResult.TypeConverter.cs | 6 +- .../{Api20210301 => }/OperationListResult.cs | 22 +- .../OperationListResult.json.cs | 12 +- .../OperationResult.PowerShell.cs | 48 +- .../OperationResult.TypeConverter.cs | 6 +- .../{Api20210301 => }/OperationResult.cs | 40 +- .../{Api20210301 => }/OperationResult.json.cs | 14 +- .../ResourceSku.PowerShell.cs | 24 +- .../ResourceSku.TypeConverter.cs | 6 +- .../Models/{Api20210301 => }/ResourceSku.cs | 9 +- .../{Api20210301 => }/ResourceSku.json.cs | 12 +- .../{Api20 => }/SystemData.PowerShell.cs | 44 +- .../{Api20 => }/SystemData.TypeConverter.cs | 6 +- .../api/Models/{Api20 => }/SystemData.cs | 48 +- .../api/Models/{Api20 => }/SystemData.json.cs | 22 +- .../{Api20210301 => }/UserInfo.PowerShell.cs | 32 +- .../UserInfo.TypeConverter.cs | 6 +- .../api/Models/{Api20210301 => }/UserInfo.cs | 15 +- .../Models/{Api20210301 => }/UserInfo.json.cs | 16 +- .../api/Support/CreatedByType.Completer.cs | 47 - .../Support/CreatedByType.TypeConverter.cs | 59 - .../generated/api/Support/CreatedByType.cs | 102 - .../LiftrResourceCategories.Completer.cs | 39 - .../LiftrResourceCategories.TypeConverter.cs | 59 - .../api/Support/LiftrResourceCategories.cs | 97 - .../Support/ManagedIdentityTypes.Completer.cs | 39 - .../ManagedIdentityTypes.TypeConverter.cs | 59 - .../api/Support/ManagedIdentityTypes.cs | 98 - ...MarketplaceSubscriptionStatus.Completer.cs | 50 - ...etplaceSubscriptionStatus.TypeConverter.cs | 62 - .../Support/MarketplaceSubscriptionStatus.cs | 111 - .../api/Support/MonitoringStatus.Completer.cs | 39 - .../Support/MonitoringStatus.TypeConverter.cs | 59 - .../generated/api/Support/MonitoringStatus.cs | 98 - .../Support/ProvisioningState.Completer.cs | 67 - .../ProvisioningState.TypeConverter.cs | 59 - .../api/Support/ProvisioningState.cs | 111 - .../Support/SingleSignOnStates.Completer.cs | 47 - .../SingleSignOnStates.TypeConverter.cs | 59 - .../api/Support/SingleSignOnStates.cs | 102 - .../api/Support/TagAction.Completer.cs | 39 - .../api/Support/TagAction.TypeConverter.cs | 59 - .../generated/api/Support/TagAction.cs | 98 - .../GetAzDatadogMarketplaceAgreement_List.cs | 119 +- .../cmdlets/GetAzDatadogMonitorApiKey_List.cs | 119 +- .../GetAzDatadogMonitorDefaultKey_Get.cs | 112 +- ...DatadogMonitorDefaultKey_GetViaIdentity.cs | 105 +- .../cmdlets/GetAzDatadogMonitorHost_List.cs | 119 +- .../GetAzDatadogMonitorLinkedResource_List.cs | 119 +- ...tAzDatadogMonitorMonitoredResource_List.cs | 119 +- .../cmdlets/GetAzDatadogMonitor_Get.cs | 112 +- .../GetAzDatadogMonitor_GetViaIdentity.cs | 105 +- .../cmdlets/GetAzDatadogMonitor_List.cs | 119 +- .../cmdlets/GetAzDatadogMonitor_List1.cs | 119 +- .../cmdlets/GetAzDatadogOperation_List.cs | 112 +- ...tAzDatadogSingleSignOnConfiguration_Get.cs | 112 +- ...ingleSignOnConfiguration_GetViaIdentity.cs | 105 +- ...gnOnConfiguration_GetViaIdentityMonitor.cs | 500 ++ ...AzDatadogSingleSignOnConfiguration_List.cs | 119 +- .../cmdlets/GetAzDatadogTagRule_Get.cs | 112 +- .../GetAzDatadogTagRule_GetViaIdentity.cs | 105 +- ...tAzDatadogTagRule_GetViaIdentityMonitor.cs | 500 ++ .../cmdlets/GetAzDatadogTagRule_List.cs | 119 +- ...adogMarketplaceAgreement_CreateExpanded.cs | 120 +- ...ketplaceAgreement_CreateViaJsonFilePath.cs | 495 ++ ...arketplaceAgreement_CreateViaJsonString.cs | 493 ++ .../NewAzDatadogMonitor_CreateExpanded.cs | 168 +- ...atadogMonitor_CreateViaIdentityExpanded.cs | 721 ++ ...wAzDatadogMonitor_CreateViaJsonFilePath.cs | 607 ++ ...NewAzDatadogMonitor_CreateViaJsonString.cs | 605 ++ ...ingleSignOnConfiguration_CreateExpanded.cs | 140 +- ...Configuration_CreateViaIdentityExpanded.cs | 139 +- ...ration_CreateViaIdentityMonitorExpanded.cs | 612 ++ ...gnOnConfiguration_CreateViaJsonFilePath.cs | 623 ++ ...SignOnConfiguration_CreateViaJsonString.cs | 621 ++ .../NewAzDatadogTagRule_CreateExpanded.cs | 128 +- ...atadogTagRule_CreateViaIdentityExpanded.cs | 127 +- ...agRule_CreateViaIdentityMonitorExpanded.cs | 573 ++ ...wAzDatadogTagRule_CreateViaJsonFilePath.cs | 537 ++ ...NewAzDatadogTagRule_CreateViaJsonString.cs | 535 ++ .../cmdlets/RemoveAzDatadogMonitor_Delete.cs | 98 +- ...emoveAzDatadogMonitor_DeleteViaIdentity.cs | 91 +- ...tAzDatadogMonitorDefaultKey_SetExpanded.cs | 86 +- ...dogMonitorDefaultKey_SetViaJsonFilePath.cs | 510 ++ ...tadogMonitorDefaultKey_SetViaJsonString.cs | 508 ++ ...AzDatadogMonitorSetPasswordLink_Refresh.cs | 112 +- ...nitorSetPasswordLink_RefreshViaIdentity.cs | 105 +- .../UpdateAzDatadogMonitor_UpdateExpanded.cs | 148 +- ...atadogMonitor_UpdateViaIdentityExpanded.cs | 147 +- ...eAzDatadogMonitor_UpdateViaJsonFilePath.cs | 607 ++ ...ateAzDatadogMonitor_UpdateViaJsonString.cs | 605 ++ ...ingleSignOnConfiguration_UpdateExpanded.cs | 644 ++ ...Configuration_UpdateViaIdentityExpanded.cs | 616 ++ ...ration_UpdateViaIdentityMonitorExpanded.cs | 628 ++ .../UpdateAzDatadogTagRule_UpdateExpanded.cs | 617 ++ ...atadogTagRule_UpdateViaIdentityExpanded.cs | 590 ++ ...agRule_UpdateViaIdentityMonitorExpanded.cs | 601 ++ .../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 +- .../BuildTime/Models/PsMarkdownTypes.cs | 43 +- .../BuildTime/Models/PsProxyOutputs.cs | 60 +- .../runtime/BuildTime/Models/PsProxyTypes.cs | 56 +- .../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 + .../runtime/Nodes/Collections/XNodeArray.cs | 5 + .../generated/runtime/SerializationMode.cs | 8 +- .../runtime/TypeConverterExtensions.cs | 50 + .../internal/Get-AzDatadogOperation.ps1 | 10 +- .../internal/ProxyCmdletDefinitions.ps1 | 10 +- .../Datadog.Autorest/resources/README.md | 11 + .../Datadog/Datadog.Autorest/test-module.ps1 | 10 +- 311 files changed, 28753 insertions(+), 7660 deletions(-) create mode 100644 generated/Datadog/Datadog.Autorest/exports/Update-AzDatadogSingleSignOnConfiguration.ps1 create mode 100644 generated/Datadog/Datadog.Autorest/exports/Update-AzDatadogTagRule.ps1 delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResource.PowerShell.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorProperties.PowerShell.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRules.PowerShell.cs rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogAgreementProperties.PowerShell.cs (63%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogAgreementProperties.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogAgreementProperties.cs (91%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogAgreementProperties.json.cs (92%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogAgreementResource.PowerShell.cs (50%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogAgreementResource.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogAgreementResource.cs (60%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogAgreementResource.json.cs (90%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogAgreementResourceListResponse.PowerShell.cs (74%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogAgreementResourceListResponse.TypeConverter.cs (96%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogAgreementResourceListResponse.cs (71%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogAgreementResourceListResponse.json.cs (89%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogApiKey.PowerShell.cs (75%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogApiKey.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogApiKey.cs (89%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogApiKey.json.cs (93%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogApiKeyListResponse.PowerShell.cs (76%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogApiKeyListResponse.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogApiKeyListResponse.cs (72%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogApiKeyListResponse.json.cs (90%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogHost.PowerShell.cs (58%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogHost.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogHost.cs (62%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogHost.json.cs (88%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogHostListResponse.PowerShell.cs (76%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogHostListResponse.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogHostListResponse.cs (72%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogHostListResponse.json.cs (90%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogHostMetadata.PowerShell.cs (63%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogHostMetadata.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogHostMetadata.cs (65%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogHostMetadata.json.cs (93%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogInstallMethod.PowerShell.cs (77%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogInstallMethod.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogInstallMethod.cs (88%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogInstallMethod.json.cs (94%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogLogsAgent.PowerShell.cs (85%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogLogsAgent.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogLogsAgent.cs (84%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogLogsAgent.json.cs (94%) create mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResource.PowerShell.cs rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResource.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResource.cs (57%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResource.json.cs (88%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceListResponse.PowerShell.cs (75%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceListResponse.TypeConverter.cs (96%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceListResponse.cs (71%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceListResponse.json.cs (89%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceTags.PowerShell.cs (89%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceTags.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceTags.cs (79%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceTags.dictionary.cs (95%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceTags.json.cs (95%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceUpdateParameters.PowerShell.cs (64%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceUpdateParameters.TypeConverter.cs (96%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceUpdateParameters.cs (56%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceUpdateParameters.json.cs (90%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceUpdateParametersTags.PowerShell.cs (88%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceUpdateParametersTags.TypeConverter.cs (96%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceUpdateParametersTags.cs (79%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceUpdateParametersTags.dictionary.cs (95%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogMonitorResourceUpdateParametersTags.json.cs (94%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogOrganizationProperties.PowerShell.cs (64%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogOrganizationProperties.TypeConverter.cs (96%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogOrganizationProperties.cs (90%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogOrganizationProperties.json.cs (67%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSetPasswordLink.PowerShell.cs (84%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSetPasswordLink.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSetPasswordLink.cs (83%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSetPasswordLink.json.cs (94%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSingleSignOnProperties.PowerShell.cs (69%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSingleSignOnProperties.TypeConverter.cs (96%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSingleSignOnProperties.cs (67%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSingleSignOnProperties.json.cs (92%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSingleSignOnResource.PowerShell.cs (50%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSingleSignOnResource.TypeConverter.cs (96%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSingleSignOnResource.cs (52%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSingleSignOnResource.json.cs (90%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSingleSignOnResourceListResponse.PowerShell.cs (74%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSingleSignOnResourceListResponse.TypeConverter.cs (96%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSingleSignOnResourceListResponse.cs (71%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/DatadogSingleSignOnResourceListResponse.json.cs (89%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/ErrorAdditionalInfo.PowerShell.cs (80%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/ErrorAdditionalInfo.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/ErrorAdditionalInfo.cs (82%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/ErrorAdditionalInfo.json.cs (93%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/ErrorDetail.PowerShell.cs (69%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/ErrorDetail.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/ErrorDetail.cs (66%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/ErrorDetail.json.cs (84%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/ErrorResponse.PowerShell.cs (66%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/ErrorResponse.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/ErrorResponse.cs (58%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/ErrorResponse.json.cs (95%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/FilteringTag.PowerShell.cs (78%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/FilteringTag.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/FilteringTag.cs (80%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/FilteringTag.json.cs (92%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/IdentityProperties.PowerShell.cs (76%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/IdentityProperties.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/IdentityProperties.cs (74%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/IdentityProperties.json.cs (92%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/LinkedResource.PowerShell.cs (85%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/LinkedResource.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/LinkedResource.cs (86%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/LinkedResource.json.cs (94%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/LinkedResourceListResponse.PowerShell.cs (76%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/LinkedResourceListResponse.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/LinkedResourceListResponse.cs (72%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/LinkedResourceListResponse.json.cs (90%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/LogRules.PowerShell.cs (71%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/LogRules.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/LogRules.cs (85%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/LogRules.json.cs (89%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MetricRules.PowerShell.cs (80%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MetricRules.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MetricRules.cs (76%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MetricRules.json.cs (88%) create mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorProperties.PowerShell.cs rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitorProperties.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitorProperties.cs (63%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitorProperties.json.cs (90%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitorUpdateProperties.PowerShell.cs (82%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitorUpdateProperties.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitorUpdateProperties.cs (68%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitorUpdateProperties.json.cs (94%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoredResource.PowerShell.cs (71%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoredResource.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoredResource.cs (91%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoredResource.json.cs (93%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoredResourceListResponse.PowerShell.cs (75%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoredResourceListResponse.TypeConverter.cs (96%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoredResourceListResponse.cs (72%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoredResourceListResponse.json.cs (89%) create mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRules.PowerShell.cs rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoringTagRules.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoringTagRules.cs (57%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoringTagRules.json.cs (90%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoringTagRulesListResponse.PowerShell.cs (75%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoringTagRulesListResponse.TypeConverter.cs (96%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoringTagRulesListResponse.cs (71%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoringTagRulesListResponse.json.cs (89%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoringTagRulesProperties.PowerShell.cs (56%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoringTagRulesProperties.TypeConverter.cs (96%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoringTagRulesProperties.cs (66%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/MonitoringTagRulesProperties.json.cs (92%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/OperationDisplay.PowerShell.cs (75%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/OperationDisplay.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/OperationDisplay.cs (90%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/OperationDisplay.json.cs (93%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/OperationListResult.PowerShell.cs (77%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/OperationListResult.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/OperationListResult.cs (74%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/OperationListResult.json.cs (90%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/OperationResult.PowerShell.cs (66%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/OperationResult.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/OperationResult.cs (76%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/OperationResult.json.cs (94%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/ResourceSku.PowerShell.cs (85%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/ResourceSku.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/ResourceSku.cs (84%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/ResourceSku.json.cs (93%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/SystemData.PowerShell.cs (67%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/SystemData.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/SystemData.cs (78%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20 => }/SystemData.json.cs (93%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/UserInfo.PowerShell.cs (79%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/UserInfo.TypeConverter.cs (97%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/UserInfo.cs (90%) rename generated/Datadog/Datadog.Autorest/generated/api/Models/{Api20210301 => }/UserInfo.json.cs (93%) delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/CreatedByType.Completer.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/CreatedByType.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/LiftrResourceCategories.Completer.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/LiftrResourceCategories.TypeConverter.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/LiftrResourceCategories.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/ManagedIdentityTypes.Completer.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/ManagedIdentityTypes.TypeConverter.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/ManagedIdentityTypes.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/MarketplaceSubscriptionStatus.Completer.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/MarketplaceSubscriptionStatus.TypeConverter.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/MarketplaceSubscriptionStatus.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/MonitoringStatus.Completer.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/MonitoringStatus.TypeConverter.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/MonitoringStatus.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/ProvisioningState.Completer.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/ProvisioningState.TypeConverter.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/ProvisioningState.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/SingleSignOnStates.Completer.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/SingleSignOnStates.TypeConverter.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/SingleSignOnStates.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/TagAction.Completer.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/TagAction.TypeConverter.cs delete mode 100644 generated/Datadog/Datadog.Autorest/generated/api/Support/TagAction.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_GetViaIdentityMonitor.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_GetViaIdentityMonitor.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMarketplaceAgreement_CreateViaJsonFilePath.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMarketplaceAgreement_CreateViaJsonString.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateViaIdentityExpanded.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateViaJsonFilePath.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateViaJsonString.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityMonitorExpanded.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaJsonFilePath.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaJsonString.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaIdentityMonitorExpanded.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaJsonFilePath.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaJsonString.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/SetAzDatadogMonitorDefaultKey_SetViaJsonFilePath.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/SetAzDatadogMonitorDefaultKey_SetViaJsonString.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateViaJsonFilePath.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateViaJsonString.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogSingleSignOnConfiguration_UpdateExpanded.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityExpanded.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityMonitorExpanded.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogTagRule_UpdateExpanded.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogTagRule_UpdateViaIdentityExpanded.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogTagRule_UpdateViaIdentityMonitorExpanded.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/runtime/Context.cs create mode 100644 generated/Datadog/Datadog.Autorest/generated/runtime/InputHandler.cs create mode 100644 generated/Datadog/Datadog.Autorest/resources/README.md diff --git a/generated/Datadog/Datadog.Autorest/Az.Datadog.csproj b/generated/Datadog/Datadog.Autorest/Az.Datadog.csproj index cce7e27ee4ef..bf651c21f615 100644 --- a/generated/Datadog/Datadog.Autorest/Az.Datadog.csproj +++ b/generated/Datadog/Datadog.Autorest/Az.Datadog.csproj @@ -2,9 +2,9 @@ Datadog Datadog + Datadog.Autorest - diff --git a/generated/Datadog/Datadog.Autorest/Az.Datadog.format.ps1xml b/generated/Datadog/Datadog.Autorest/Az.Datadog.format.ps1xml index 2b3e5b8e03f6..b2a7f2bdf55a 100644 --- a/generated/Datadog/Datadog.Autorest/Az.Datadog.format.ps1xml +++ b/generated/Datadog/Datadog.Autorest/Az.Datadog.format.ps1xml @@ -2,141 +2,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogIdentity - - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogIdentity - - - - - - - - - - - - - - - - - - - - - - - - ConfigurationName - - - MonitorName - - - ResourceGroupName - - - RuleSetName - - - SubscriptionId - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementProperties - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorDetail - - - - - - - - - - - - - - - - - - Code - - - Message - - - Target - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemData - - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemData - - - - - - - - - - - - - - - - - - - - - - - - - - - CreatedAt - - - CreatedBy - - - CreatedByType - - - LastModifiedAt - - - LastModifiedBy - - - LastModifiedByType - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementProperties - - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementProperties + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementProperties#Multiple @@ -198,15 +66,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementResource + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementResource - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementResource + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementResource#Multiple + + + @@ -214,15 +85,18 @@ Name + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementResourceListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementResourceListResponse - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementResourceListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementResourceListResponse#Multiple @@ -242,9 +116,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogApiKey + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogApiKey - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogApiKey + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogApiKey#Multiple @@ -282,9 +156,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogApiKeyListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogApiKeyListResponse - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogApiKeyListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogApiKeyListResponse#Multiple @@ -304,18 +178,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHost + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHost - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHost + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHost#Multiple - - - - - - @@ -323,12 +191,6 @@ - - Alias - - - App - Name @@ -338,9 +200,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHostListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHostListResponse - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHostListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHostListResponse#Multiple @@ -360,9 +222,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHostMetadata + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHostMetadata - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHostMetadata + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHostMetadata#Multiple @@ -382,9 +244,55 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogInstallMethod + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogIdentity + + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogIdentity#Multiple + + + + + + + + + + + + + + + + + + + + + + + + ConfigurationName + + + MonitorName + + + ResourceGroupName + + + RuleSetName + + + SubscriptionId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogInstallMethod - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogInstallMethod + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogInstallMethod#Multiple @@ -416,9 +324,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogLogsAgent + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogLogsAgent - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogLogsAgent + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogLogsAgent#Multiple @@ -438,9 +346,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResource + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResource - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResource + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResource#Multiple @@ -450,6 +358,9 @@ + + + @@ -460,15 +371,18 @@ Name + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceListResponse - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceListResponse#Multiple @@ -488,9 +402,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceTags + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceTags - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceTags + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceTags#Multiple @@ -510,9 +424,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceUpdateParametersTags + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceUpdateParametersTags - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceUpdateParametersTags + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceUpdateParametersTags#Multiple @@ -532,9 +446,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogOrganizationProperties + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogOrganizationProperties - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogOrganizationProperties + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogOrganizationProperties#Multiple @@ -590,9 +504,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSetPasswordLink + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSetPasswordLink - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSetPasswordLink + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSetPasswordLink#Multiple @@ -612,9 +526,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnProperties + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnProperties - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnProperties + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnProperties#Multiple @@ -652,15 +566,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnResource + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResource - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnResource + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResource#Multiple + + + @@ -668,15 +585,18 @@ Name + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnResourceListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResourceListResponse - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnResourceListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResourceListResponse#Multiple @@ -696,9 +616,43 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTag + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorDetail - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTag + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorDetail#Multiple + + + + + + + + + + + + + + + + + + Code + + + Message + + + Target + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTag + + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTag#Multiple @@ -730,9 +684,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IdentityProperties + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IdentityProperties - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IdentityProperties + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IdentityProperties#Multiple @@ -758,9 +712,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LinkedResourceListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LinkedResourceListResponse - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LinkedResourceListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LinkedResourceListResponse#Multiple @@ -780,9 +734,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LogRules + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LogRules - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LogRules + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LogRules#Multiple @@ -814,9 +768,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoredResource + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoredResource - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoredResource + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoredResource#Multiple @@ -854,9 +808,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoredResourceListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoredResourceListResponse - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoredResourceListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoredResourceListResponse#Multiple @@ -876,15 +830,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRules + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRules - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRules + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRules#Multiple + + + @@ -892,15 +849,18 @@ Name + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRulesListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRulesListResponse - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRulesListResponse + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRulesListResponse#Multiple @@ -920,9 +880,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRulesProperties + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRulesProperties - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRulesProperties + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRulesProperties#Multiple @@ -942,9 +902,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitorProperties + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitorProperties - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitorProperties + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitorProperties#Multiple @@ -988,9 +948,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitorUpdateProperties + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitorUpdateProperties - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitorUpdateProperties + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitorUpdateProperties#Multiple @@ -1010,9 +970,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationDisplay#Multiple @@ -1050,9 +1010,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationListResult + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationListResult - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationListResult + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationListResult#Multiple @@ -1072,9 +1032,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationResult + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationResult - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationResult + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationResult#Multiple @@ -1100,9 +1060,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ResourceSku + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ResourceSku - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ResourceSku + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ResourceSku#Multiple @@ -1122,9 +1082,61 @@ - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.UserInfo + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemData + + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemData#Multiple + + + + + + + + + + + + + + + + + + + + + + + + + + + CreatedAt + + + CreatedBy + + + CreatedByType + + + LastModifiedAt + + + LastModifiedBy + + + LastModifiedByType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.UserInfo - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.UserInfo + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.UserInfo#Multiple diff --git a/generated/Datadog/Datadog.Autorest/Az.Datadog.psd1 b/generated/Datadog/Datadog.Autorest/Az.Datadog.psd1 index 9d32c045ef96..fc597608c408 100644 --- a/generated/Datadog/Datadog.Autorest/Az.Datadog.psd1 +++ b/generated/Datadog/Datadog.Autorest/Az.Datadog.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.Datadog.private.dll' FormatsToProcess = './Az.Datadog.format.ps1xml' - FunctionsToExport = 'Get-AzDatadogMarketplaceAgreement', 'Get-AzDatadogMonitor', 'Get-AzDatadogMonitorApiKey', 'Get-AzDatadogMonitorDefaultKey', 'Get-AzDatadogMonitorHost', 'Get-AzDatadogMonitorLinkedResource', 'Get-AzDatadogMonitorMonitoredResource', 'Get-AzDatadogSingleSignOnConfiguration', 'Get-AzDatadogTagRule', 'New-AzDatadogFilteringTagObject', 'New-AzDatadogMarketplaceAgreement', 'New-AzDatadogMonitor', 'New-AzDatadogSingleSignOnConfiguration', 'New-AzDatadogTagRule', 'Remove-AzDatadogMonitor', 'Set-AzDatadogMonitorDefaultKey', 'Update-AzDatadogMonitor', 'Update-AzDatadogMonitorSetPasswordLink', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzDatadogMarketplaceAgreement', 'Get-AzDatadogMonitor', 'Get-AzDatadogMonitorApiKey', 'Get-AzDatadogMonitorDefaultKey', 'Get-AzDatadogMonitorHost', 'Get-AzDatadogMonitorLinkedResource', 'Get-AzDatadogMonitorMonitoredResource', 'Get-AzDatadogSingleSignOnConfiguration', 'Get-AzDatadogTagRule', 'New-AzDatadogFilteringTagObject', 'New-AzDatadogMarketplaceAgreement', 'New-AzDatadogMonitor', 'New-AzDatadogSingleSignOnConfiguration', 'New-AzDatadogTagRule', 'Remove-AzDatadogMonitor', 'Set-AzDatadogMonitorDefaultKey', 'Update-AzDatadogMonitor', 'Update-AzDatadogMonitorSetPasswordLink', 'Update-AzDatadogSingleSignOnConfiguration', 'Update-AzDatadogTagRule' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Datadog' diff --git a/generated/Datadog/Datadog.Autorest/Properties/AssemblyInfo.cs b/generated/Datadog/Datadog.Autorest/Properties/AssemblyInfo.cs index 8e70270026b4..d97d4bfa5713 100644 --- a/generated/Datadog/Datadog.Autorest/Properties/AssemblyInfo.cs +++ b/generated/Datadog/Datadog.Autorest/Properties/AssemblyInfo.cs @@ -1,28 +1,27 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// Licensed under the Apache License, Version 2.0 (the "License"); +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the ""License""); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, +// distributed under the License is distributed on an ""AS IS"" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// ---------------------------------------------------------------------------------- +// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +// is regenerated. using System; using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("Microsoft Azure Powershell - Datadog")] -[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] -[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] -[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] +[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")] +[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] +[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] +[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Datadog")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.2")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.1.2")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] -[assembly: ComVisible(false)] -[assembly: CLSCompliant(false)] -[assembly: Guid("2803dd32-1677-468c-b63a-dbfbc253d002")] -[assembly: AssemblyVersion("0.1.2")] -[assembly: AssemblyFileVersion("0.1.2")] diff --git a/generated/Datadog/Datadog.Autorest/check-dependencies.ps1 b/generated/Datadog/Datadog.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/Datadog/Datadog.Autorest/check-dependencies.ps1 +++ b/generated/Datadog/Datadog.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/Datadog/Datadog.Autorest/exports/Get-AzDatadogMarketplaceAgreement.ps1 b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMarketplaceAgreement.ps1 index 9e69bc9ed93c..d1f113e8e50d 100644 --- a/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMarketplaceAgreement.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMarketplaceAgreement.ps1 @@ -23,12 +23,12 @@ List Datadog marketplace agreements in the subscription. Get-AzDatadogMarketplaceAgreement .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogmarketplaceagreement #> function Get-AzDatadogMarketplaceAgreement { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -94,6 +94,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -115,9 +124,7 @@ begin { $mapping = @{ List = 'Az.Datadog.private\Get-AzDatadogMarketplaceAgreement_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -131,6 +138,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/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitor.ps1 b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitor.ps1 index 4c562d509b0a..2ceaa788e318 100644 --- a/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitor.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitor.ps1 @@ -31,7 +31,7 @@ Get-AzDatadogMonitor -ResourceGroupName azure-rg-Datadog -Name Datadog | Get-AzD .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource .Notes COMPLEX PARAMETER PROPERTIES @@ -48,7 +48,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogmonitor #> function Get-AzDatadogMonitor { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -79,7 +79,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -138,6 +137,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -162,9 +170,7 @@ begin { List = 'Az.Datadog.private\Get-AzDatadogMonitor_List'; List1 = 'Az.Datadog.private\Get-AzDatadogMonitor_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -178,6 +184,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/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorApiKey.ps1 b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorApiKey.ps1 index b258e67f2ea6..b695b91a7c9a 100644 --- a/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorApiKey.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorApiKey.ps1 @@ -23,12 +23,12 @@ List the api keys for a given monitor resource. Get-AzDatadogMonitorApiKey -ResourceGroupName azure-rg-Datadog -Name Datadog .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogmonitorapikey #> function Get-AzDatadogMonitorApiKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -107,6 +107,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -128,9 +137,7 @@ begin { $mapping = @{ List = 'Az.Datadog.private\Get-AzDatadogMonitorApiKey_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -144,6 +151,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/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorDefaultKey.ps1 b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorDefaultKey.ps1 index 46b80541ade4..72d38659f841 100644 --- a/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorDefaultKey.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorDefaultKey.ps1 @@ -27,7 +27,7 @@ Get-AzDatadogMonitor -ResourceGroupName azure-rg-Datadog -Name Datadog | Get-AzD .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey .Notes COMPLEX PARAMETER PROPERTIES @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogmonitordefaultkey #> function Get-AzDatadogMonitorDefaultKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -71,7 +71,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # 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.Datadog.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() @@ -152,9 +160,7 @@ begin { Get = 'Az.Datadog.private\Get-AzDatadogMonitorDefaultKey_Get'; GetViaIdentity = 'Az.Datadog.private\Get-AzDatadogMonitorDefaultKey_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -168,6 +174,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/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorHost.ps1 b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorHost.ps1 index 53400d5337d2..7246582dc600 100644 --- a/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorHost.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorHost.ps1 @@ -23,12 +23,12 @@ List the hosts for a given monitor resource. Get-AzDatadogMonitorHost -ResourceGroupName azure-rg-Datadog -Name Datadog .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogmonitorhost #> function Get-AzDatadogMonitorHost { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -107,6 +107,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -128,9 +137,7 @@ begin { $mapping = @{ List = 'Az.Datadog.private\Get-AzDatadogMonitorHost_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -144,6 +151,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/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorLinkedResource.ps1 b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorLinkedResource.ps1 index a10e8482897d..31796a365222 100644 --- a/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorLinkedResource.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorLinkedResource.ps1 @@ -23,12 +23,12 @@ List all Azure resources associated to the same Datadog organization as the targ Get-AzDatadogMonitorLinkedResource -ResourceGroupName azure-rg-Datadog -Name lucasDatadog .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogmonitorlinkedresource #> function Get-AzDatadogMonitorLinkedResource { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -107,6 +107,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -128,9 +137,7 @@ begin { $mapping = @{ List = 'Az.Datadog.private\Get-AzDatadogMonitorLinkedResource_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -144,6 +151,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/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorMonitoredResource.ps1 b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorMonitoredResource.ps1 index 41c13e13d7db..3bfc4ce32fb5 100644 --- a/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorMonitoredResource.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogMonitorMonitoredResource.ps1 @@ -23,12 +23,12 @@ List the resources currently being monitored by the Datadog monitor resource. Get-AzDatadogMonitorMonitoredResource -ResourceGroupName azure-rg-Datadog -Name Datadog .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogmonitormonitoredresource #> function Get-AzDatadogMonitorMonitoredResource { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -107,6 +107,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -128,9 +137,7 @@ begin { $mapping = @{ List = 'Az.Datadog.private\Get-AzDatadogMonitorMonitoredResource_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -144,6 +151,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/Datadog/Datadog.Autorest/exports/Get-AzDatadogSingleSignOnConfiguration.ps1 b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogSingleSignOnConfiguration.ps1 index d9d3b0541651..aa3bb1b2bcd9 100644 --- a/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogSingleSignOnConfiguration.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogSingleSignOnConfiguration.ps1 @@ -29,7 +29,7 @@ New-AzDatadogSingleSignOnConfiguration -ResourceGroupName azure-rg-Datadog -Moni .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource .Notes COMPLEX PARAMETER PROPERTIES @@ -42,11 +42,19 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [RuleSetName ]: Rule set name [SubscriptionId ]: The ID of the target subscription. + +MONITORINPUTOBJECT : Identity Parameter + [ConfigurationName ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogsinglesignonconfiguration #> function Get-AzDatadogSingleSignOnConfiguration { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -57,6 +65,7 @@ param( ${MonitorName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityMonitor', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # Configuration name @@ -82,9 +91,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityMonitor', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${MonitorInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -141,6 +155,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -162,11 +185,10 @@ begin { $mapping = @{ Get = 'Az.Datadog.private\Get-AzDatadogSingleSignOnConfiguration_Get'; GetViaIdentity = 'Az.Datadog.private\Get-AzDatadogSingleSignOnConfiguration_GetViaIdentity'; + GetViaIdentityMonitor = 'Az.Datadog.private\Get-AzDatadogSingleSignOnConfiguration_GetViaIdentityMonitor'; List = 'Az.Datadog.private\Get-AzDatadogSingleSignOnConfiguration_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -180,6 +202,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/Datadog/Datadog.Autorest/exports/Get-AzDatadogTagRule.ps1 b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogTagRule.ps1 index 34bfb3dcaf53..0a9d0d809ba7 100644 --- a/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogTagRule.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/Get-AzDatadogTagRule.ps1 @@ -29,7 +29,7 @@ Get-AzDatadogTagRule -ResourceGroupName azure-rg-Datadog -MonitorName Datadog -N .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules .Notes COMPLEX PARAMETER PROPERTIES @@ -42,11 +42,19 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [RuleSetName ]: Rule set name [SubscriptionId ]: The ID of the target subscription. + +MONITORINPUTOBJECT : Identity Parameter + [ConfigurationName ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogtagrule #> function Get-AzDatadogTagRule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -57,6 +65,7 @@ param( ${MonitorName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityMonitor', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # Rule set name @@ -82,9 +91,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityMonitor', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${MonitorInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -141,6 +155,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -162,11 +185,10 @@ begin { $mapping = @{ Get = 'Az.Datadog.private\Get-AzDatadogTagRule_Get'; GetViaIdentity = 'Az.Datadog.private\Get-AzDatadogTagRule_GetViaIdentity'; + GetViaIdentityMonitor = 'Az.Datadog.private\Get-AzDatadogTagRule_GetViaIdentityMonitor'; List = 'Az.Datadog.private\Get-AzDatadogTagRule_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -180,6 +202,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/Datadog/Datadog.Autorest/exports/New-AzDatadogFilteringTagObject.ps1 b/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogFilteringTagObject.ps1 index 3d0c0129316e..598dc4ea8891 100644 --- a/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogFilteringTagObject.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogFilteringTagObject.ps1 @@ -23,18 +23,18 @@ Create an in-memory object for FilteringTag. New-AzDatadogFilteringTagObject -Action "Include" -Value "Prod" -Name "Environment" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTag +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTag .Link -https://learn.microsoft.com/powershell/module/Az.Datadog/new-AzDatadogFilteringTagObject +https://learn.microsoft.com/powershell/module/Az.Datadog/new-azdatadogfilteringtagobject #> function New-AzDatadogFilteringTagObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTag])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTag])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction])] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Include", "Exclude")] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction] + [System.String] # Valid actions for a filtering tag. # Exclusion takes priority over inclusion. ${Action}, @@ -59,6 +59,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -87,6 +90,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/Datadog/Datadog.Autorest/exports/New-AzDatadogMarketplaceAgreement.ps1 b/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogMarketplaceAgreement.ps1 index 61ae9c4d9742..4e3f9727703d 100644 --- a/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogMarketplaceAgreement.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogMarketplaceAgreement.ps1 @@ -16,19 +16,19 @@ <# .Synopsis -Create Datadog marketplace agreement in the subscription. +create Datadog marketplace agreement in the subscription. .Description -Create Datadog marketplace agreement in the subscription. +create Datadog marketplace agreement in the subscription. .Example New-AzDatadogMarketplaceAgreement -Accepted .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource .Link https://learn.microsoft.com/powershell/module/az.datadog/new-azdatadogmarketplaceagreement #> function New-AzDatadogMarketplaceAgreement { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter()] @@ -38,55 +38,67 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.Management.Automation.SwitchParameter] # If any version of the terms have been accepted, otherwise false. ${Accepted}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Link to HTML with Microsoft and Publisher terms. ${LicenseTextLink}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Plan identifier string. ${Plan}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Link to the privacy policy of the publisher. ${PrivacyPolicyLink}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Product identifier string. ${Product}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Publisher identifier string. ${Publisher}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.DateTime] # Date and time in UTC of when the terms were accepted. # This is empty if Accepted is false. ${RetrieveDatetime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Terms signature. ${Signature}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -143,6 +155,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -163,10 +184,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.Datadog.private\New-AzDatadogMarketplaceAgreement_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Datadog.private\New-AzDatadogMarketplaceAgreement_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Datadog.private\New-AzDatadogMarketplaceAgreement_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -180,6 +201,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/Datadog/Datadog.Autorest/exports/New-AzDatadogMonitor.ps1 b/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogMonitor.ps1 index 2265c3b9a052..04e1cbf5fab5 100644 --- a/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogMonitor.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogMonitor.ps1 @@ -16,129 +16,180 @@ <# .Synopsis -Create a monitor resource. +create a monitor resource. .Description -Create a monitor resource. +create a monitor resource. .Example -New-AzDatadogMonitor -ResourceGroupName azure-rg-test -Name Datadog-pwsh01 -SkuName 'drawdown_testing_20200904_Monthly' -Location 'eastus2euap' -UserInfoEmailAddress 'xxxx@microsoft.com' -UserInfoName 'user' -UserInfoPhoneNumber 'xxxxxxxxxxxx' -IdentityType SystemAssigned +New-AzDatadogMonitor -ResourceGroupName azure-rg-test -Name Datadog-pwsh01 -SkuName 'drawdown_testing_20200904_Monthly' -Location 'eastus2euap' -UserInfoEmailAddress 'xxxx@microsoft.com' -UserInfoName 'user' -UserInfoPhoneNumber 'xxxxxxxxxxxx' -EnableSystemAssignedIdentity:$true +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource +.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 ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.datadog/new-azdatadogmonitor #> function New-AzDatadogMonitor { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Alias('MonitorName')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # Monitor resource name ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # . ${Location}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes] - # Identity type - ${IdentityType}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus])] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus] + [System.String] # Flag specifying if the resource monitoring is enabled or disabled. ${MonitoringStatus}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Api key associated to the Datadog organization. ${OrganizationApiKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Application key associated to the Datadog organization. ${OrganizationApplicationKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The Id of the Enterprise App used for Single sign on. ${OrganizationEnterpriseAppId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The auth code used to linking to an existing datadog organization. ${OrganizationLinkingAuthCode}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The client_id from an existing in exchange for an auth token to link organization. ${OrganizationLinkingClientId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The redirect uri for linking. ${OrganizationRedirectUri}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Name of the SKU. ${SkuName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags]))] [System.Collections.Hashtable] # Dictionary of ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Email of the user used by Datadog for contacting them if needed ${UserInfoEmailAddress}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Name of the user ${UserInfoName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Phone number of the user used by Datadog for contacting them if needed ${UserInfoPhoneNumber}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -207,6 +258,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -227,10 +287,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.Datadog.private\New-AzDatadogMonitor_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.Datadog.private\New-AzDatadogMonitor_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.Datadog.private\New-AzDatadogMonitor_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Datadog.private\New-AzDatadogMonitor_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -244,6 +305,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/Datadog/Datadog.Autorest/exports/New-AzDatadogSingleSignOnConfiguration.ps1 b/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogSingleSignOnConfiguration.ps1 index 817131146331..e890db78fe8d 100644 --- a/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogSingleSignOnConfiguration.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogSingleSignOnConfiguration.ps1 @@ -27,7 +27,7 @@ Get-AzDatadogSingleSignOnConfiguration -ResourceGroupName azure-rg-Datadog -Moni .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource .Notes COMPLEX PARAMETER PROPERTIES @@ -40,26 +40,41 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [RuleSetName ]: Rule set name [SubscriptionId ]: The ID of the target subscription. + +MONITORINPUTOBJECT : Identity Parameter + [ConfigurationName ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.datadog/new-azdatadogsinglesignonconfiguration #> function New-AzDatadogSingleSignOnConfiguration { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # Monitor resource name ${MonitorName}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # Configuration name ${Name}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # The name of the resource group. @@ -67,6 +82,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -77,22 +94,43 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${MonitorInputObject}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The Id of the Enterprise App used for Single sign-on. ${EnterpriseAppId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Initial", "Enable", "Disable", "Existing")] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates] + [System.String] # Various states of the SSO resource ${SingleSignOnState}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -161,6 +199,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -182,10 +229,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.Datadog.private\New-AzDatadogSingleSignOnConfiguration_CreateExpanded'; CreateViaIdentityExpanded = 'Az.Datadog.private\New-AzDatadogSingleSignOnConfiguration_CreateViaIdentityExpanded'; + CreateViaIdentityMonitorExpanded = 'Az.Datadog.private\New-AzDatadogSingleSignOnConfiguration_CreateViaIdentityMonitorExpanded'; + CreateViaJsonFilePath = 'Az.Datadog.private\New-AzDatadogSingleSignOnConfiguration_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Datadog.private\New-AzDatadogSingleSignOnConfiguration_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -199,6 +247,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/Datadog/Datadog.Autorest/exports/New-AzDatadogTagRule.ps1 b/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogTagRule.ps1 index 0b4f5992d624..28c27610dd67 100644 --- a/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogTagRule.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/New-AzDatadogTagRule.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create or update a tag rule set for a given monitor resource. +create a tag rule set for a given monitor resource. .Description -Create or update a tag rule set for a given monitor resource. +create a tag rule set for a given monitor resource. .Example $ftobjArray = @() $ftobjArray += New-AzDatadogFilteringTagObject -Action "Include" -Value "Prod" -Name "Environment" @@ -33,7 +33,7 @@ Get-AzDatadogTagRule -ResourceGroupName azure-rg-Datadog -MonitorName Datadog -N .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules .Notes COMPLEX PARAMETER PROPERTIES @@ -48,34 +48,49 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. LOGRULEFILTERINGTAG : List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. - [Action ]: Valid actions for a filtering tag. Exclusion takes priority over inclusion. + [Action ]: Valid actions for a filtering tag. Exclusion takes priority over inclusion. [Name ]: The name (also known as the key) of the tag. [Value ]: The value of the tag. METRICRULEFILTERINGTAG : List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. - [Action ]: Valid actions for a filtering tag. Exclusion takes priority over inclusion. + [Action ]: Valid actions for a filtering tag. Exclusion takes priority over inclusion. [Name ]: The name (also known as the key) of the tag. [Value ]: The value of the tag. + +MONITORINPUTOBJECT : Identity Parameter + [ConfigurationName ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.datadog/new-azdatadogtagrule #> function New-AzDatadogTagRule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # Monitor resource name ${MonitorName}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # Rule set name ${Name}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # The name of the resource group. @@ -83,6 +98,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -93,50 +110,75 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${MonitorInputObject}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[]] # List of filtering tags to be used for capturing logs. # This only takes effect if SendResourceLogs flag is enabled. # If empty, all resources will be captured. # If only Exclude action is specified, the rules will apply to the list of all available resources. # If Include actions are specified, the rules will only include resources with the associated tags. - # To construct, see NOTES section for LOGRULEFILTERINGTAG properties and create a hash table. ${LogRuleFilteringTag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.Management.Automation.SwitchParameter] # Flag specifying if AAD logs should be sent for the Monitor resource. ${LogRuleSendAadLog}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.Management.Automation.SwitchParameter] # Flag specifying if Azure resource logs should be sent for the Monitor resource. ${LogRuleSendResourceLog}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.Management.Automation.SwitchParameter] # Flag specifying if Azure subscription logs should be sent for the Monitor resource. ${LogRuleSendSubscriptionLog}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[]] # List of filtering tags to be used for capturing metrics. # If empty, all resources will be captured. # If only Exclude action is specified, the rules will apply to the list of all available resources. # If Include actions are specified, the rules will only include resources with the associated tags. - # To construct, see NOTES section for METRICRULEFILTERINGTAG properties and create a hash table. ${MetricRuleFilteringTag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -193,6 +235,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -214,10 +265,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.Datadog.private\New-AzDatadogTagRule_CreateExpanded'; CreateViaIdentityExpanded = 'Az.Datadog.private\New-AzDatadogTagRule_CreateViaIdentityExpanded'; + CreateViaIdentityMonitorExpanded = 'Az.Datadog.private\New-AzDatadogTagRule_CreateViaIdentityMonitorExpanded'; + CreateViaJsonFilePath = 'Az.Datadog.private\New-AzDatadogTagRule_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Datadog.private\New-AzDatadogTagRule_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -231,6 +283,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/Datadog/Datadog.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Datadog/Datadog.Autorest/exports/ProxyCmdletDefinitions.ps1 index 4c8d67418509..03104f806c48 100644 --- a/generated/Datadog/Datadog.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -23,12 +23,12 @@ List Datadog marketplace agreements in the subscription. Get-AzDatadogMarketplaceAgreement .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogmarketplaceagreement #> function Get-AzDatadogMarketplaceAgreement { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -94,6 +94,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -115,9 +124,7 @@ begin { $mapping = @{ List = 'Az.Datadog.private\Get-AzDatadogMarketplaceAgreement_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -131,6 +138,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) @@ -183,12 +193,12 @@ List the api keys for a given monitor resource. Get-AzDatadogMonitorApiKey -ResourceGroupName azure-rg-Datadog -Name Datadog .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogmonitorapikey #> function Get-AzDatadogMonitorApiKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -267,6 +277,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -288,9 +307,7 @@ begin { $mapping = @{ List = 'Az.Datadog.private\Get-AzDatadogMonitorApiKey_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -304,6 +321,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) @@ -360,7 +380,7 @@ Get-AzDatadogMonitor -ResourceGroupName azure-rg-Datadog -Name Datadog | Get-AzD .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey .Notes COMPLEX PARAMETER PROPERTIES @@ -377,7 +397,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogmonitordefaultkey #> function Get-AzDatadogMonitorDefaultKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -404,7 +424,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -463,6 +482,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -485,9 +513,7 @@ begin { Get = 'Az.Datadog.private\Get-AzDatadogMonitorDefaultKey_Get'; GetViaIdentity = 'Az.Datadog.private\Get-AzDatadogMonitorDefaultKey_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -501,6 +527,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) @@ -553,12 +582,12 @@ List the hosts for a given monitor resource. Get-AzDatadogMonitorHost -ResourceGroupName azure-rg-Datadog -Name Datadog .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogmonitorhost #> function Get-AzDatadogMonitorHost { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -637,6 +666,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -658,9 +696,7 @@ begin { $mapping = @{ List = 'Az.Datadog.private\Get-AzDatadogMonitorHost_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -674,6 +710,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) @@ -726,12 +765,12 @@ List all Azure resources associated to the same Datadog organization as the targ Get-AzDatadogMonitorLinkedResource -ResourceGroupName azure-rg-Datadog -Name lucasDatadog .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogmonitorlinkedresource #> function Get-AzDatadogMonitorLinkedResource { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -810,6 +849,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -831,9 +879,7 @@ begin { $mapping = @{ List = 'Az.Datadog.private\Get-AzDatadogMonitorLinkedResource_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -847,6 +893,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) @@ -899,12 +948,12 @@ List the resources currently being monitored by the Datadog monitor resource. Get-AzDatadogMonitorMonitoredResource -ResourceGroupName azure-rg-Datadog -Name Datadog .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogmonitormonitoredresource #> function Get-AzDatadogMonitorMonitoredResource { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -983,6 +1032,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -1004,9 +1062,7 @@ begin { $mapping = @{ List = 'Az.Datadog.private\Get-AzDatadogMonitorMonitoredResource_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1020,6 +1076,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) @@ -1080,7 +1139,7 @@ Get-AzDatadogMonitor -ResourceGroupName azure-rg-Datadog -Name Datadog | Get-AzD .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource .Notes COMPLEX PARAMETER PROPERTIES @@ -1097,7 +1156,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogmonitor #> function Get-AzDatadogMonitor { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1128,7 +1187,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1187,6 +1245,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -1211,9 +1278,7 @@ begin { List = 'Az.Datadog.private\Get-AzDatadogMonitor_List'; List1 = 'Az.Datadog.private\Get-AzDatadogMonitor_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1227,6 +1292,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) @@ -1285,7 +1353,7 @@ New-AzDatadogSingleSignOnConfiguration -ResourceGroupName azure-rg-Datadog -Moni .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource .Notes COMPLEX PARAMETER PROPERTIES @@ -1298,11 +1366,19 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [RuleSetName ]: Rule set name [SubscriptionId ]: The ID of the target subscription. + +MONITORINPUTOBJECT : Identity Parameter + [ConfigurationName ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogsinglesignonconfiguration #> function Get-AzDatadogSingleSignOnConfiguration { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1313,6 +1389,7 @@ param( ${MonitorName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityMonitor', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # Configuration name @@ -1338,9 +1415,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityMonitor', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${MonitorInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1397,6 +1479,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -1418,11 +1509,10 @@ begin { $mapping = @{ Get = 'Az.Datadog.private\Get-AzDatadogSingleSignOnConfiguration_Get'; GetViaIdentity = 'Az.Datadog.private\Get-AzDatadogSingleSignOnConfiguration_GetViaIdentity'; + GetViaIdentityMonitor = 'Az.Datadog.private\Get-AzDatadogSingleSignOnConfiguration_GetViaIdentityMonitor'; List = 'Az.Datadog.private\Get-AzDatadogSingleSignOnConfiguration_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1436,6 +1526,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) @@ -1494,7 +1587,7 @@ Get-AzDatadogTagRule -ResourceGroupName azure-rg-Datadog -MonitorName Datadog -N .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules .Notes COMPLEX PARAMETER PROPERTIES @@ -1507,11 +1600,19 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [RuleSetName ]: Rule set name [SubscriptionId ]: The ID of the target subscription. + +MONITORINPUTOBJECT : Identity Parameter + [ConfigurationName ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogtagrule #> function Get-AzDatadogTagRule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1522,6 +1623,7 @@ param( ${MonitorName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityMonitor', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # Rule set name @@ -1547,9 +1649,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityMonitor', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${MonitorInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1606,6 +1713,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -1627,11 +1743,10 @@ begin { $mapping = @{ Get = 'Az.Datadog.private\Get-AzDatadogTagRule_Get'; GetViaIdentity = 'Az.Datadog.private\Get-AzDatadogTagRule_GetViaIdentity'; + GetViaIdentityMonitor = 'Az.Datadog.private\Get-AzDatadogTagRule_GetViaIdentityMonitor'; List = 'Az.Datadog.private\Get-AzDatadogTagRule_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1645,6 +1760,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) @@ -1690,19 +1808,19 @@ end { <# .Synopsis -Create Datadog marketplace agreement in the subscription. +create Datadog marketplace agreement in the subscription. .Description -Create Datadog marketplace agreement in the subscription. +create Datadog marketplace agreement in the subscription. .Example New-AzDatadogMarketplaceAgreement -Accepted .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource .Link https://learn.microsoft.com/powershell/module/az.datadog/new-azdatadogmarketplaceagreement #> function New-AzDatadogMarketplaceAgreement { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter()] @@ -1712,55 +1830,67 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.Management.Automation.SwitchParameter] # If any version of the terms have been accepted, otherwise false. ${Accepted}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Link to HTML with Microsoft and Publisher terms. ${LicenseTextLink}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Plan identifier string. ${Plan}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Link to the privacy policy of the publisher. ${PrivacyPolicyLink}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Product identifier string. ${Product}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Publisher identifier string. ${Publisher}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.DateTime] # Date and time in UTC of when the terms were accepted. # This is empty if Accepted is false. ${RetrieveDatetime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Terms signature. ${Signature}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1817,6 +1947,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -1837,10 +1976,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.Datadog.private\New-AzDatadogMarketplaceAgreement_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Datadog.private\New-AzDatadogMarketplaceAgreement_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Datadog.private\New-AzDatadogMarketplaceAgreement_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1854,6 +1993,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) @@ -1899,129 +2041,180 @@ end { <# .Synopsis -Create a monitor resource. +create a monitor resource. .Description -Create a monitor resource. +create a monitor resource. .Example -New-AzDatadogMonitor -ResourceGroupName azure-rg-test -Name Datadog-pwsh01 -SkuName 'drawdown_testing_20200904_Monthly' -Location 'eastus2euap' -UserInfoEmailAddress 'xxxx@microsoft.com' -UserInfoName 'user' -UserInfoPhoneNumber 'xxxxxxxxxxxx' -IdentityType SystemAssigned +New-AzDatadogMonitor -ResourceGroupName azure-rg-test -Name Datadog-pwsh01 -SkuName 'drawdown_testing_20200904_Monthly' -Location 'eastus2euap' -UserInfoEmailAddress 'xxxx@microsoft.com' -UserInfoName 'user' -UserInfoPhoneNumber 'xxxxxxxxxxxx' -EnableSystemAssignedIdentity:$true +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource +.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 ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.datadog/new-azdatadogmonitor #> function New-AzDatadogMonitor { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Alias('MonitorName')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # Monitor resource name ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # . ${Location}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes])] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes] - # Identity type - ${IdentityType}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus] + [System.String] # Flag specifying if the resource monitoring is enabled or disabled. ${MonitoringStatus}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Api key associated to the Datadog organization. ${OrganizationApiKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Application key associated to the Datadog organization. ${OrganizationApplicationKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The Id of the Enterprise App used for Single sign on. ${OrganizationEnterpriseAppId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The auth code used to linking to an existing datadog organization. ${OrganizationLinkingAuthCode}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The client_id from an existing in exchange for an auth token to link organization. ${OrganizationLinkingClientId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The redirect uri for linking. ${OrganizationRedirectUri}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Name of the SKU. ${SkuName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags]))] [System.Collections.Hashtable] # Dictionary of ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Email of the user used by Datadog for contacting them if needed ${UserInfoEmailAddress}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Name of the user ${UserInfoName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Phone number of the user used by Datadog for contacting them if needed ${UserInfoPhoneNumber}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2090,6 +2283,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -2110,10 +2312,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.Datadog.private\New-AzDatadogMonitor_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.Datadog.private\New-AzDatadogMonitor_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.Datadog.private\New-AzDatadogMonitor_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Datadog.private\New-AzDatadogMonitor_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2127,6 +2330,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) @@ -2183,7 +2389,7 @@ Get-AzDatadogSingleSignOnConfiguration -ResourceGroupName azure-rg-Datadog -Moni .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource .Notes COMPLEX PARAMETER PROPERTIES @@ -2196,26 +2402,41 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [RuleSetName ]: Rule set name [SubscriptionId ]: The ID of the target subscription. + +MONITORINPUTOBJECT : Identity Parameter + [ConfigurationName ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.datadog/new-azdatadogsinglesignonconfiguration #> function New-AzDatadogSingleSignOnConfiguration { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # Monitor resource name ${MonitorName}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # Configuration name ${Name}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # The name of the resource group. @@ -2223,6 +2444,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -2233,22 +2456,43 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${MonitorInputObject}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The Id of the Enterprise App used for Single sign-on. ${EnterpriseAppId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Initial", "Enable", "Disable", "Existing")] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates] + [System.String] # Various states of the SSO resource ${SingleSignOnState}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2317,6 +2561,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -2338,10 +2591,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.Datadog.private\New-AzDatadogSingleSignOnConfiguration_CreateExpanded'; CreateViaIdentityExpanded = 'Az.Datadog.private\New-AzDatadogSingleSignOnConfiguration_CreateViaIdentityExpanded'; + CreateViaIdentityMonitorExpanded = 'Az.Datadog.private\New-AzDatadogSingleSignOnConfiguration_CreateViaIdentityMonitorExpanded'; + CreateViaJsonFilePath = 'Az.Datadog.private\New-AzDatadogSingleSignOnConfiguration_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Datadog.private\New-AzDatadogSingleSignOnConfiguration_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2355,6 +2609,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) @@ -2400,9 +2657,9 @@ end { <# .Synopsis -Create or update a tag rule set for a given monitor resource. +create a tag rule set for a given monitor resource. .Description -Create or update a tag rule set for a given monitor resource. +create a tag rule set for a given monitor resource. .Example $ftobjArray = @() $ftobjArray += New-AzDatadogFilteringTagObject -Action "Include" -Value "Prod" -Name "Environment" @@ -2417,7 +2674,7 @@ Get-AzDatadogTagRule -ResourceGroupName azure-rg-Datadog -MonitorName Datadog -N .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules .Notes COMPLEX PARAMETER PROPERTIES @@ -2432,34 +2689,49 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. LOGRULEFILTERINGTAG : List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. - [Action ]: Valid actions for a filtering tag. Exclusion takes priority over inclusion. + [Action ]: Valid actions for a filtering tag. Exclusion takes priority over inclusion. [Name ]: The name (also known as the key) of the tag. [Value ]: The value of the tag. METRICRULEFILTERINGTAG : List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. - [Action ]: Valid actions for a filtering tag. Exclusion takes priority over inclusion. + [Action ]: Valid actions for a filtering tag. Exclusion takes priority over inclusion. [Name ]: The name (also known as the key) of the tag. [Value ]: The value of the tag. + +MONITORINPUTOBJECT : Identity Parameter + [ConfigurationName ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.datadog/new-azdatadogtagrule #> function New-AzDatadogTagRule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # Monitor resource name ${MonitorName}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # Rule set name ${Name}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # The name of the resource group. @@ -2467,6 +2739,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -2477,50 +2751,75 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${MonitorInputObject}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[]] # List of filtering tags to be used for capturing logs. # This only takes effect if SendResourceLogs flag is enabled. # If empty, all resources will be captured. # If only Exclude action is specified, the rules will apply to the list of all available resources. # If Include actions are specified, the rules will only include resources with the associated tags. - # To construct, see NOTES section for LOGRULEFILTERINGTAG properties and create a hash table. ${LogRuleFilteringTag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.Management.Automation.SwitchParameter] # Flag specifying if AAD logs should be sent for the Monitor resource. ${LogRuleSendAadLog}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.Management.Automation.SwitchParameter] # Flag specifying if Azure resource logs should be sent for the Monitor resource. ${LogRuleSendResourceLog}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.Management.Automation.SwitchParameter] # Flag specifying if Azure subscription logs should be sent for the Monitor resource. ${LogRuleSendSubscriptionLog}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityMonitorExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[]] # List of filtering tags to be used for capturing metrics. # If empty, all resources will be captured. # If only Exclude action is specified, the rules will apply to the list of all available resources. # If Include actions are specified, the rules will only include resources with the associated tags. - # To construct, see NOTES section for METRICRULEFILTERINGTAG properties and create a hash table. ${MetricRuleFilteringTag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2577,6 +2876,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -2598,10 +2906,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.Datadog.private\New-AzDatadogTagRule_CreateExpanded'; CreateViaIdentityExpanded = 'Az.Datadog.private\New-AzDatadogTagRule_CreateViaIdentityExpanded'; + CreateViaIdentityMonitorExpanded = 'Az.Datadog.private\New-AzDatadogTagRule_CreateViaIdentityMonitorExpanded'; + CreateViaJsonFilePath = 'Az.Datadog.private\New-AzDatadogTagRule_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Datadog.private\New-AzDatadogTagRule_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2615,6 +2924,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) @@ -2716,7 +3028,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -2793,6 +3104,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -2815,9 +3135,7 @@ begin { Delete = 'Az.Datadog.private\Remove-AzDatadogMonitor_Delete'; DeleteViaIdentity = 'Az.Datadog.private\Remove-AzDatadogMonitor_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2831,6 +3149,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) @@ -2911,30 +3232,42 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [System.String] - # The value of the API key. - ${Key}, - - [Parameter()] + [Parameter(ParameterSetName='SetExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The time of creation of the API key. ${CreatedAt}, - [Parameter()] + [Parameter(ParameterSetName='SetExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The user that created the API key. ${CreatedBy}, - [Parameter()] + [Parameter(ParameterSetName='SetExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # The value of the API key. + ${Key}, + + [Parameter(ParameterSetName='SetExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The name of the API key. ${Name}, + [Parameter(ParameterSetName='SetViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Path of Json file supplied to the Set operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='SetViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Json string supplied to the Set operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2997,6 +3330,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -3017,10 +3359,10 @@ begin { $mapping = @{ SetExpanded = 'Az.Datadog.private\Set-AzDatadogMonitorDefaultKey_SetExpanded'; + SetViaJsonFilePath = 'Az.Datadog.private\Set-AzDatadogMonitorDefaultKey_SetViaJsonFilePath'; + SetViaJsonString = 'Az.Datadog.private\Set-AzDatadogMonitorDefaultKey_SetViaJsonString'; } - if (('SetExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('SetExpanded', 'SetViaJsonFilePath', 'SetViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3034,6 +3376,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) @@ -3090,7 +3435,7 @@ Get-AzDatadogMonitor -ResourceGroupName azure-rg-Datadog -Name Datadog | Update- .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -System.String +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink .Notes COMPLEX PARAMETER PROPERTIES @@ -3107,7 +3452,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.datadog/update-azdatadogmonitorsetpasswordlink #> function Update-AzDatadogMonitorSetPasswordLink { -[OutputType([System.String])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink])] [CmdletBinding(DefaultParameterSetName='Refresh', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Refresh', Mandatory)] @@ -3134,7 +3479,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -3193,6 +3537,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -3215,9 +3568,7 @@ begin { Refresh = 'Az.Datadog.private\Update-AzDatadogMonitorSetPasswordLink_Refresh'; RefreshViaIdentity = 'Az.Datadog.private\Update-AzDatadogMonitorSetPasswordLink_RefreshViaIdentity'; } - if (('Refresh') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Refresh') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3231,6 +3582,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) @@ -3276,9 +3630,9 @@ end { <# .Synopsis -Update a monitor resource. +update a monitor resource. .Description -Update a monitor resource. +update a monitor resource. .Example Update-AzDatadogMonitor -ResourceGroupName azure-rg-Datadog -Name Datadog -Tag @{'key1'='value1'; 'key2'='value2'} .Example @@ -3287,7 +3641,7 @@ Get-AzDatadogMonitor -ResourceGroupName azure-rg-Datadog -Name Datadog | Update- .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource .Notes COMPLEX PARAMETER PROPERTIES @@ -3304,10 +3658,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.datadog/update-azdatadogmonitor #> function Update-AzDatadogMonitor { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('MonitorName')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] @@ -3315,6 +3671,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # The name of the resource group. @@ -3322,6 +3680,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -3332,29 +3692,43 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus] + [System.String] # Flag specifying if the resource monitoring is enabled or disabled. ${MonitoringStatus}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Name of the SKU. ${SkuName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags]))] [System.Collections.Hashtable] # The new tags of the monitor resource. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3423,6 +3797,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -3444,10 +3827,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.Datadog.private\Update-AzDatadogMonitor_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.Datadog.private\Update-AzDatadogMonitor_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.Datadog.private\Update-AzDatadogMonitor_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.Datadog.private\Update-AzDatadogMonitor_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3461,6 +3844,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) @@ -3506,25 +3892,561 @@ end { <# .Synopsis -Create an in-memory object for FilteringTag. +Configures single-sign-on for this resource. .Description -Create an in-memory object for FilteringTag. +Configures single-sign-on for this resource. .Example -New-AzDatadogFilteringTagObject -Action "Include" -Value "Prod" -Name "Environment" +Update-AzDatadogSingleSignOnConfiguration -ResourceGroupName azure-rg-Datadog -MonitorName Datadog -Name 'default' -SingleSignOnState Enable -EnterpriseAppId 00000000-0000-0000-0000-000000000000 +.Example +Get-AzDatadogSingleSignOnConfiguration -ResourceGroupName azure-rg-Datadog -MonitorName Datadog -Name 'default' | Update-AzDatadogSingleSignOnConfiguration -SingleSignOnState Disable -EnterpriseAppId 00000000-0000-0000-0000-000000000000 +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTag +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource +.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 ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. + +MONITORINPUTOBJECT : Identity Parameter + [ConfigurationName ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. .Link -https://learn.microsoft.com/powershell/module/Az.Datadog/new-AzDatadogFilteringTagObject +https://learn.microsoft.com/powershell/module/az.datadog/update-azdatadogsinglesignonconfiguration #> -function New-AzDatadogFilteringTagObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTag])] -[CmdletBinding(PositionalBinding=$false)] +function Update-AzDatadogSingleSignOnConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [System.String] + # Monitor resource name + ${MonitorName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityMonitorExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [System.String] + # Configuration name + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityMonitorExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${MonitorInputObject}, + [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction])] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction] + [System.String] + # The Id of the Enterprise App used for Single sign-on. + ${EnterpriseAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Initial", "Enable", "Disable", "Existing")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Various states of the SSO resource + ${SingleSignOnState}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Datadog.private\Update-AzDatadogSingleSignOnConfiguration_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Datadog.private\Update-AzDatadogSingleSignOnConfiguration_UpdateViaIdentityExpanded'; + UpdateViaIdentityMonitorExpanded = 'Az.Datadog.private\Update-AzDatadogSingleSignOnConfiguration_UpdateViaIdentityMonitorExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [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) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +update a tag rule set for a given monitor resource. +.Description +update a tag rule set for a given monitor resource. +.Example +$ftobjArray = @() +$ftobjArray += New-AzDatadogFilteringTagObject -Action "Include" -Value "Prod" -Name "Environment" +$ftobjArray += New-AzDatadogFilteringTagObject -Action "Exclude" -Value "Dev" -Name "Environment" +Update-AzDatadogTagRule -ResourceGroupName azure-rg-Datadog -MonitorName Datadog -Name 'test' -LogRuleFilteringTag $ftobjArray +.Example +$ftobjArray = @() +$ftobjArray += New-AzDatadogFilteringTagObject -Action "Include" -Value "Prod" -Name "Environment" +$ftobjArray += New-AzDatadogFilteringTagObject -Action "Exclude" -Value "Dev" -Name "Environment" +Get-AzDatadogTagRule -ResourceGroupName azure-rg-Datadog -MonitorName Datadog -Name 'default' | Update-AzDatadogTagRule -LogRuleFilteringTag $ftobjArray + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules +.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 ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. + +LOGRULEFILTERINGTAG : List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. + [Action ]: Valid actions for a filtering tag. Exclusion takes priority over inclusion. + [Name ]: The name (also known as the key) of the tag. + [Value ]: The value of the tag. + +METRICRULEFILTERINGTAG : List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. + [Action ]: Valid actions for a filtering tag. Exclusion takes priority over inclusion. + [Name ]: The name (also known as the key) of the tag. + [Value ]: The value of the tag. + +MONITORINPUTOBJECT : Identity Parameter + [ConfigurationName ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. +.Link +https://learn.microsoft.com/powershell/module/az.datadog/update-azdatadogtagrule +#> +function Update-AzDatadogTagRule { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [System.String] + # Monitor resource name + ${MonitorName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityMonitorExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [System.String] + # Rule set name + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityMonitorExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${MonitorInputObject}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[]] + # List of filtering tags to be used for capturing logs. + # This only takes effect if SendResourceLogs flag is enabled. + # If empty, all resources will be captured. + # If only Exclude action is specified, the rules will apply to the list of all available resources. + # If Include actions are specified, the rules will only include resources with the associated tags. + ${LogRuleFilteringTag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Flag specifying if AAD logs should be sent for the Monitor resource. + ${LogRuleSendAadLog}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Flag specifying if Azure resource logs should be sent for the Monitor resource. + ${LogRuleSendResourceLog}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Flag specifying if Azure subscription logs should be sent for the Monitor resource. + ${LogRuleSendSubscriptionLog}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[]] + # List of filtering tags to be used for capturing metrics. + # If empty, all resources will be captured. + # If only Exclude action is specified, the rules will apply to the list of all available resources. + # If Include actions are specified, the rules will only include resources with the associated tags. + ${MetricRuleFilteringTag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Datadog.private\Update-AzDatadogTagRule_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Datadog.private\Update-AzDatadogTagRule_UpdateViaIdentityExpanded'; + UpdateViaIdentityMonitorExpanded = 'Az.Datadog.private\Update-AzDatadogTagRule_UpdateViaIdentityMonitorExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [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) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Create an in-memory object for FilteringTag. +.Description +Create an in-memory object for FilteringTag. +.Example +New-AzDatadogFilteringTagObject -Action "Include" -Value "Prod" -Name "Environment" + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTag +.Link +https://learn.microsoft.com/powershell/module/Az.Datadog/new-azdatadogfilteringtagobject +#> +function New-AzDatadogFilteringTagObject { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTag])] +[CmdletBinding(PositionalBinding=$false)] +param( + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Include", "Exclude")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] # Valid actions for a filtering tag. # Exclusion takes priority over inclusion. ${Action}, @@ -3549,6 +4471,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3577,6 +4502,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/Datadog/Datadog.Autorest/exports/Remove-AzDatadogMonitor.ps1 b/generated/Datadog/Datadog.Autorest/exports/Remove-AzDatadogMonitor.ps1 index 1e08adc73903..f385fae85598 100644 --- a/generated/Datadog/Datadog.Autorest/exports/Remove-AzDatadogMonitor.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/Remove-AzDatadogMonitor.ps1 @@ -72,7 +72,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -149,6 +148,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -171,9 +179,7 @@ begin { Delete = 'Az.Datadog.private\Remove-AzDatadogMonitor_Delete'; DeleteViaIdentity = 'Az.Datadog.private\Remove-AzDatadogMonitor_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -187,6 +193,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/Datadog/Datadog.Autorest/exports/Set-AzDatadogMonitorDefaultKey.ps1 b/generated/Datadog/Datadog.Autorest/exports/Set-AzDatadogMonitorDefaultKey.ps1 index ec3295ba6b88..c0ba08961d3e 100644 --- a/generated/Datadog/Datadog.Autorest/exports/Set-AzDatadogMonitorDefaultKey.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/Set-AzDatadogMonitorDefaultKey.ps1 @@ -51,30 +51,42 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [System.String] - # The value of the API key. - ${Key}, - - [Parameter()] + [Parameter(ParameterSetName='SetExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The time of creation of the API key. ${CreatedAt}, - [Parameter()] + [Parameter(ParameterSetName='SetExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The user that created the API key. ${CreatedBy}, - [Parameter()] + [Parameter(ParameterSetName='SetExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # The value of the API key. + ${Key}, + + [Parameter(ParameterSetName='SetExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # The name of the API key. ${Name}, + [Parameter(ParameterSetName='SetViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Path of Json file supplied to the Set operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='SetViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Json string supplied to the Set operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -137,6 +149,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -157,10 +178,10 @@ begin { $mapping = @{ SetExpanded = 'Az.Datadog.private\Set-AzDatadogMonitorDefaultKey_SetExpanded'; + SetViaJsonFilePath = 'Az.Datadog.private\Set-AzDatadogMonitorDefaultKey_SetViaJsonFilePath'; + SetViaJsonString = 'Az.Datadog.private\Set-AzDatadogMonitorDefaultKey_SetViaJsonString'; } - if (('SetExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('SetExpanded', 'SetViaJsonFilePath', 'SetViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -174,6 +195,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/Datadog/Datadog.Autorest/exports/Update-AzDatadogMonitor.ps1 b/generated/Datadog/Datadog.Autorest/exports/Update-AzDatadogMonitor.ps1 index 7562e7f98be6..7b95dcdd19ec 100644 --- a/generated/Datadog/Datadog.Autorest/exports/Update-AzDatadogMonitor.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/Update-AzDatadogMonitor.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Update a monitor resource. +update a monitor resource. .Description -Update a monitor resource. +update a monitor resource. .Example Update-AzDatadogMonitor -ResourceGroupName azure-rg-Datadog -Name Datadog -Tag @{'key1'='value1'; 'key2'='value2'} .Example @@ -27,7 +27,7 @@ Get-AzDatadogMonitor -ResourceGroupName azure-rg-Datadog -Name Datadog | Update- .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource .Notes COMPLEX PARAMETER PROPERTIES @@ -44,10 +44,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.datadog/update-azdatadogmonitor #> function Update-AzDatadogMonitor { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('MonitorName')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] @@ -55,6 +57,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [System.String] # The name of the resource group. @@ -62,6 +66,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -72,29 +78,43 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus] + [System.String] # Flag specifying if the resource monitoring is enabled or disabled. ${MonitoringStatus}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] [System.String] # Name of the SKU. ${SkuName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags]))] [System.Collections.Hashtable] # The new tags of the monitor resource. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -163,6 +183,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() @@ -184,10 +213,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.Datadog.private\Update-AzDatadogMonitor_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.Datadog.private\Update-AzDatadogMonitor_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.Datadog.private\Update-AzDatadogMonitor_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.Datadog.private\Update-AzDatadogMonitor_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -201,6 +230,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/Datadog/Datadog.Autorest/exports/Update-AzDatadogMonitorSetPasswordLink.ps1 b/generated/Datadog/Datadog.Autorest/exports/Update-AzDatadogMonitorSetPasswordLink.ps1 index 3684c2f01daf..3a6edd34ed3c 100644 --- a/generated/Datadog/Datadog.Autorest/exports/Update-AzDatadogMonitorSetPasswordLink.ps1 +++ b/generated/Datadog/Datadog.Autorest/exports/Update-AzDatadogMonitorSetPasswordLink.ps1 @@ -27,7 +27,7 @@ Get-AzDatadogMonitor -ResourceGroupName azure-rg-Datadog -Name Datadog | Update- .Inputs Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity .Outputs -System.String +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink .Notes COMPLEX PARAMETER PROPERTIES @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.datadog/update-azdatadogmonitorsetpasswordlink #> function Update-AzDatadogMonitorSetPasswordLink { -[OutputType([System.String])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink])] [CmdletBinding(DefaultParameterSetName='Refresh', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Refresh', Mandatory)] @@ -71,7 +71,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] # Identity Parameter - # 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.Datadog.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() @@ -152,9 +160,7 @@ begin { Refresh = 'Az.Datadog.private\Update-AzDatadogMonitorSetPasswordLink_Refresh'; RefreshViaIdentity = 'Az.Datadog.private\Update-AzDatadogMonitorSetPasswordLink_RefreshViaIdentity'; } - if (('Refresh') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Refresh') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -168,6 +174,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/Datadog/Datadog.Autorest/exports/Update-AzDatadogSingleSignOnConfiguration.ps1 b/generated/Datadog/Datadog.Autorest/exports/Update-AzDatadogSingleSignOnConfiguration.ps1 new file mode 100644 index 000000000000..3e5f8c45971c --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/exports/Update-AzDatadogSingleSignOnConfiguration.ps1 @@ -0,0 +1,268 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Configures single-sign-on for this resource. +.Description +Configures single-sign-on for this resource. +.Example +Update-AzDatadogSingleSignOnConfiguration -ResourceGroupName azure-rg-Datadog -MonitorName Datadog -Name 'default' -SingleSignOnState Enable -EnterpriseAppId 00000000-0000-0000-0000-000000000000 +.Example +Get-AzDatadogSingleSignOnConfiguration -ResourceGroupName azure-rg-Datadog -MonitorName Datadog -Name 'default' | Update-AzDatadogSingleSignOnConfiguration -SingleSignOnState Disable -EnterpriseAppId 00000000-0000-0000-0000-000000000000 + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource +.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 ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. + +MONITORINPUTOBJECT : Identity Parameter + [ConfigurationName ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. +.Link +https://learn.microsoft.com/powershell/module/az.datadog/update-azdatadogsinglesignonconfiguration +#> +function Update-AzDatadogSingleSignOnConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [System.String] + # Monitor resource name + ${MonitorName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityMonitorExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [System.String] + # Configuration name + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityMonitorExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${MonitorInputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # The Id of the Enterprise App used for Single sign-on. + ${EnterpriseAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Initial", "Enable", "Disable", "Existing")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.String] + # Various states of the SSO resource + ${SingleSignOnState}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Datadog.private\Update-AzDatadogSingleSignOnConfiguration_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Datadog.private\Update-AzDatadogSingleSignOnConfiguration_UpdateViaIdentityExpanded'; + UpdateViaIdentityMonitorExpanded = 'Az.Datadog.private\Update-AzDatadogSingleSignOnConfiguration_UpdateViaIdentityMonitorExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [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) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/generated/Datadog/Datadog.Autorest/exports/Update-AzDatadogTagRule.ps1 b/generated/Datadog/Datadog.Autorest/exports/Update-AzDatadogTagRule.ps1 new file mode 100644 index 000000000000..22d4b46a9789 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/exports/Update-AzDatadogTagRule.ps1 @@ -0,0 +1,298 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +update a tag rule set for a given monitor resource. +.Description +update a tag rule set for a given monitor resource. +.Example +$ftobjArray = @() +$ftobjArray += New-AzDatadogFilteringTagObject -Action "Include" -Value "Prod" -Name "Environment" +$ftobjArray += New-AzDatadogFilteringTagObject -Action "Exclude" -Value "Dev" -Name "Environment" +Update-AzDatadogTagRule -ResourceGroupName azure-rg-Datadog -MonitorName Datadog -Name 'test' -LogRuleFilteringTag $ftobjArray +.Example +$ftobjArray = @() +$ftobjArray += New-AzDatadogFilteringTagObject -Action "Include" -Value "Prod" -Name "Environment" +$ftobjArray += New-AzDatadogFilteringTagObject -Action "Exclude" -Value "Dev" -Name "Environment" +Get-AzDatadogTagRule -ResourceGroupName azure-rg-Datadog -MonitorName Datadog -Name 'default' | Update-AzDatadogTagRule -LogRuleFilteringTag $ftobjArray + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules +.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 ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. + +LOGRULEFILTERINGTAG : List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. + [Action ]: Valid actions for a filtering tag. Exclusion takes priority over inclusion. + [Name ]: The name (also known as the key) of the tag. + [Value ]: The value of the tag. + +METRICRULEFILTERINGTAG : List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. + [Action ]: Valid actions for a filtering tag. Exclusion takes priority over inclusion. + [Name ]: The name (also known as the key) of the tag. + [Value ]: The value of the tag. + +MONITORINPUTOBJECT : Identity Parameter + [ConfigurationName ]: Configuration name + [Id ]: Resource identity path + [MonitorName ]: Monitor resource name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [RuleSetName ]: Rule set name + [SubscriptionId ]: The ID of the target subscription. +.Link +https://learn.microsoft.com/powershell/module/az.datadog/update-azdatadogtagrule +#> +function Update-AzDatadogTagRule { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [System.String] + # Monitor resource name + ${MonitorName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityMonitorExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [System.String] + # Rule set name + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityMonitorExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity] + # Identity Parameter + ${MonitorInputObject}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[]] + # List of filtering tags to be used for capturing logs. + # This only takes effect if SendResourceLogs flag is enabled. + # If empty, all resources will be captured. + # If only Exclude action is specified, the rules will apply to the list of all available resources. + # If Include actions are specified, the rules will only include resources with the associated tags. + ${LogRuleFilteringTag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Flag specifying if AAD logs should be sent for the Monitor resource. + ${LogRuleSendAadLog}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Flag specifying if Azure resource logs should be sent for the Monitor resource. + ${LogRuleSendResourceLog}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Flag specifying if Azure subscription logs should be sent for the Monitor resource. + ${LogRuleSendSubscriptionLog}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[]] + # List of filtering tags to be used for capturing metrics. + # If empty, all resources will be captured. + # If only Exclude action is specified, the rules will apply to the list of all available resources. + # If Include actions are specified, the rules will only include resources with the associated tags. + ${MetricRuleFilteringTag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.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() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Datadog.private\Update-AzDatadogTagRule_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Datadog.private\Update-AzDatadogTagRule_UpdateViaIdentityExpanded'; + UpdateViaIdentityMonitorExpanded = 'Az.Datadog.private\Update-AzDatadogTagRule_UpdateViaIdentityMonitorExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [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) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/generated/Datadog/Datadog.Autorest/generate-info.json b/generated/Datadog/Datadog.Autorest/generate-info.json index 14fbf4dd1fe7..c9b994617281 100644 --- a/generated/Datadog/Datadog.Autorest/generate-info.json +++ b/generated/Datadog/Datadog.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "55f63bdc-cc02-48a0-b52f-7442a8b2a819" + "generate_Id": "971ce380-8928-40a9-b340-5e09ec30dbdf" } diff --git a/generated/Datadog/Datadog.Autorest/generated/Module.cs b/generated/Datadog/Datadog.Autorest/generated/Module.cs index 62fda404f587..d511ca99e8c1 100644 --- a/generated/Datadog/Datadog.Autorest/generated/Module.cs +++ b/generated/Datadog/Datadog.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.Datadog.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog"; @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.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/Datadog/Datadog.Autorest/generated/api/Datadog.cs b/generated/Datadog/Datadog.Autorest/generated/api/Datadog.cs index 6b624e4f3b10..72472e1fa46a 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Datadog.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Datadog.cs @@ -13,7 +13,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog public partial class Datadog { - /// Create Datadog marketplace agreement in the subscription. + /// update Datadog marketplace agreement in the subscription. /// The ID of the target subscription. /// /// a delegate that is called when the remote service returns 200 (OK). @@ -21,10 +21,11 @@ public partial class Datadog /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MarketplaceAgreementsCreateOrUpdate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateOrUpdate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -48,15 +49,15 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MarketplaceAgreementsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create Datadog marketplace agreement in the subscription. + /// update Datadog marketplace agreement in the subscription. /// /// /// a delegate that is called when the remote service returns 200 (OK). @@ -64,10 +65,11 @@ public partial class Datadog /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MarketplaceAgreementsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -101,95 +103,119 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MarketplaceAgreementsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsCreateOrUpdate_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). + /// update Datadog marketplace agreement in the subscription. + /// + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MarketplaceAgreementsCreateOrUpdate_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-03-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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Datadog/agreements/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default'"); } + + // 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.Datadog/agreements/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. - /// + /// update Datadog marketplace agreement in the subscription. /// The ID of the target subscription. - /// + /// Json string supplied to the MarketplaceAgreementsCreateOrUpdate 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.Datadog.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 MarketplaceAgreementsCreateOrUpdate_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateOrUpdateViaJsonString(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { + var apiVersion = @"2021-03-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - 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) + + "/providers/Microsoft.Datadog/agreements/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MarketplaceAgreementsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// List Datadog marketplace agreements in the subscription. + /// update Datadog marketplace agreement in the subscription. /// The ID of the target subscription. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the MarketplaceAgreementsCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MarketplaceAgreementsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -199,73 +225,135 @@ public partial class Datadog var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.Datadog/agreements" + + "/providers/Microsoft.Datadog/agreements/default" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MarketplaceAgreementsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.MarketplaceAgreementsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// List Datadog marketplace agreements in the subscription. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update Datadog marketplace agreement in the subscription. + /// The ID of the target subscription. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MarketplaceAgreementsListViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateOrUpdateWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-03-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.Datadog/agreements$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements'"); - } - - // 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.Datadog/agreements" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Datadog/agreements/default" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MarketplaceAgreementsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.MarketplaceAgreementsCreateOrUpdateWithResult_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.Datadog.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 MarketplaceAgreementsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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 @@ -275,7 +363,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MarketplaceAgreementsList_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateOrUpdate_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -286,6 +374,7 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -293,13 +382,13 @@ public partial class Datadog case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -315,28 +404,28 @@ public partial class Datadog } /// - /// 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 ID of the target subscription. + /// /// 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 MarketplaceAgreementsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateOrUpdate_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Create a monitor resource. + /// List Datadog marketplace agreements in the subscription. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Monitor resource name - /// /// 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). @@ -345,7 +434,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MonitorsCreate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -355,10 +444,7 @@ public partial class Datadog var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.Datadog/monitors/" - + global::System.Uri.EscapeDataString(monitorName) + + "/providers/Microsoft.Datadog/agreements" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -367,22 +453,17 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorsCreate_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create a monitor resource. + /// List Datadog marketplace agreements in the subscription. /// - /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -391,7 +472,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MonitorsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsListViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -399,24 +480,19 @@ public partial class Datadog { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Datadog/agreements$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var monitorName = _match.Groups["monitorName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.Datadog/monitors/" - + monitorName + + "/providers/Microsoft.Datadog/agreements" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -425,136 +501,181 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorsCreate_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsList_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). + /// List Datadog marketplace agreements in the subscription. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsCreate_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { + var apiVersion = @"2021-03-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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Datadog/agreements$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements'"); + } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); + // 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.Datadog/agreements" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // check for cancellation - 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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsListWithResult_Call (request, eventListener,sender); + } + } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + /// List Datadog marketplace agreements in the subscription. + /// The ID of the target subscription. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MarketplaceAgreementsListWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Datadog/agreements" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsListWithResult_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.Datadog.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 MarketplaceAgreementsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException(_response); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + default: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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 MarketplaceAgreementsList_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -562,13 +683,13 @@ public partial class Datadog case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -584,47 +705,38 @@ public partial class Datadog } /// - /// 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 ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Monitor resource name - /// /// 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 MonitorsCreate_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(monitorName),monitorName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete a monitor resource. + /// create a monitor resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name + /// /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsDelete(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorsCreate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -646,27 +758,32 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.MonitorsCreate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a monitor resource. + /// create a monitor resource. /// + /// /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -700,209 +817,136 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.MonitorsCreate_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 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// create a monitor resource. + /// + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-03-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); + // 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.Datadog.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsCreateWithResult_Call (request, eventListener,sender); + } + } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + /// create a monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// Json string supplied to the MonitorsCreate 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.Datadog.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 MonitorsCreateViaJsonString(string subscriptionId, string resourceGroupName, string monitorName, 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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); 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.Datadog.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Monitor resource name - /// 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 MonitorsDelete_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(monitorName),monitorName); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsCreate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get the properties of a specific monitor resource. + /// create a monitor resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name - /// 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). + /// Json string supplied to the MonitorsCreate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsGet(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorsCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string monitorName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -920,32 +964,36 @@ public partial class Datadog + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MonitorsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.MonitorsCreateWithResult_Call (request, eventListener,sender); } } - /// Get the default api key. + /// create a monitor resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name - /// 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.Datadog.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 MonitorsGetDefaultKey(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorsCreateWithResult(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -959,114 +1007,166 @@ public partial class Datadog + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Datadog/monitors/" + global::System.Uri.EscapeDataString(monitorName) - + "/getDefaultKey" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.MonitorsGetDefaultKey_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Get the default api key. - /// - /// 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.Datadog.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 MonitorsGetDefaultKeyViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getDefaultKey'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var monitorName = _match.Groups["monitorName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.Datadog/monitors/" - + monitorName - + "/getDefaultKey" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MonitorsGetDefaultKey_Call(request,onOk,onDefault,eventListener,sender); + return await this.MonitorsCreateWithResult_Call (request, 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 - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsGetDefaultKey_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MonitorsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogApiKey.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -1080,33 +1180,8 @@ public partial class Datadog } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Monitor resource name - /// 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 MonitorsGetDefaultKey_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(monitorName),monitorName); - } - } - - /// Get the properties of a specific monitor resource. - /// + /// 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). @@ -1115,70 +1190,110 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MonitorsGetViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MonitorsCreate_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { - var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var monitorName = _match.Groups["monitorName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.Datadog/monitors/" - + monitorName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.MonitorsGet_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). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsGet_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try + global::System.Net.Http.HttpResponseMessage _response = null; + try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1186,13 +1301,13 @@ public partial class Datadog case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1208,17 +1323,18 @@ public partial class Datadog } /// - /// 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 ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name + /// /// 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 MonitorsGet_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MonitorsCreate_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1227,54 +1343,19 @@ public partial class Datadog await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(monitorName),monitorName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// List all monitors under the specified subscription. - /// The ID of the target subscription. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-03-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.Datadog/monitors" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.MonitorsList_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// List the api keys for a given monitor resource. + /// Delete a monitor resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -1282,7 +1363,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MonitorsListApiKeys(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorsDelete(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -1296,7 +1377,6 @@ public partial class Datadog + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Datadog/monitors/" + global::System.Uri.EscapeDataString(monitorName) - + "/listApiKeys" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1305,18 +1385,19 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorsListApiKeys_Call(request,onOk,onDefault,eventListener,sender); + await this.MonitorsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// List the api keys for a given monitor resource. + /// Delete a monitor resource. /// /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -1324,7 +1405,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MonitorsListApiKeysViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -1335,7 +1416,7 @@ public partial class Datadog var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listApiKeys'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); } // replace URI parameters with values from identity @@ -1350,7 +1431,6 @@ public partial class Datadog + resourceGroupName + "/providers/Microsoft.Datadog/monitors/" + monitorName - + "/listApiKeys" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1359,18 +1439,19 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorsListApiKeys_Call(request,onOk,onDefault,eventListener,sender); + await this.MonitorsDelete_Call (request, onOk,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 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -1378,17 +1459,114 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MonitorsListApiKeys_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MonitorsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1396,13 +1574,19 @@ public partial class Datadog case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogApiKeyListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1418,7 +1602,7 @@ public partial class Datadog } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. @@ -1428,7 +1612,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MonitorsListApiKeys_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MonitorsDelete_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1437,14 +1621,15 @@ public partial class Datadog await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(monitorName),monitorName); } } - /// List all monitors under the specified resource group. + /// Get the properties of a specific monitor resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. + /// Monitor resource name /// 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). @@ -1453,7 +1638,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MonitorsListByResourceGroup(string subscriptionId, string resourceGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorsGet(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -1465,7 +1650,8 @@ public partial class Datadog + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.Datadog/monitors" + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1479,12 +1665,14 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.MonitorsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// List all monitors under the specified resource group. - /// + /// Get the default api key. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name /// 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). @@ -1493,30 +1681,21 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MonitorsListByResourceGroupViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorsGetDefaultKey(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-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.Datadog/monitors$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.Datadog/monitors" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/getDefaultKey" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1525,17 +1704,17 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.MonitorsGetDefaultKey_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. + /// Get the default api key. + /// /// 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). @@ -1544,95 +1723,33 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MonitorsListByResourceGroup_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorsGetDefaultKeyViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { + var apiVersion = @"2021-03-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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// 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 MonitorsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - } - } - /// List the hosts for a given monitor resource. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Monitor resource name - /// 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.Datadog.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 MonitorsListHosts(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-03-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) + + resourceGroupName + "/providers/Microsoft.Datadog/monitors/" - + global::System.Uri.EscapeDataString(monitorName) - + "/listHosts" + + monitorName + + "/getDefaultKey" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1646,21 +1763,19 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorsListHosts_Call(request,onOk,onDefault,eventListener,sender); + await this.MonitorsGetDefaultKey_Call (request, onOk,onDefault,eventListener,sender); } } - /// List the hosts for a given monitor resource. + /// Get the default api key. /// - /// 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.Datadog.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 MonitorsListHostsViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorsGetDefaultKeyViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -1671,7 +1786,7 @@ public partial class Datadog var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listHosts'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); } // replace URI parameters with values from identity @@ -1686,25 +1801,127 @@ public partial class Datadog + resourceGroupName + "/providers/Microsoft.Datadog/monitors/" + monitorName - + "/listHosts" + + "/getDefaultKey" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsGetDefaultKeyWithResult_Call (request, eventListener,sender); + } + } + + /// Get the default api key. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsGetDefaultKeyWithResult(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/getDefaultKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MonitorsListHosts_Call(request,onOk,onDefault,eventListener,sender); + return await this.MonitorsGetDefaultKeyWithResult_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.Datadog.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 MonitorsGetDefaultKeyWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogApiKey.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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 @@ -1714,7 +1931,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MonitorsListHosts_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MonitorsGetDefaultKey_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1725,6 +1942,7 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1732,13 +1950,13 @@ public partial class Datadog case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHostListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogApiKey.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1754,7 +1972,7 @@ public partial class Datadog } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. @@ -1764,7 +1982,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MonitorsListHosts_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MonitorsGetDefaultKey_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1773,17 +1991,13 @@ public partial class Datadog await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(monitorName),monitorName); } } - /// - /// List all Azure resources associated to the same Datadog organization as the target resource. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Monitor resource name + /// Get the properties of a specific monitor resource. + /// /// 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). @@ -1792,21 +2006,32 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MonitorsListLinkedResources(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorsGetViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) + + resourceGroupName + "/providers/Microsoft.Datadog/monitors/" - + global::System.Uri.EscapeDataString(monitorName) - + "/listLinkedResources" + + monitorName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1815,28 +2040,24 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorsListLinkedResources_Call(request,onOk,onDefault,eventListener,sender); + await this.MonitorsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// List all Azure resources associated to the same Datadog organization as the target resource. - /// + /// Get the properties of a specific monitor resource. /// - /// 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.Datadog.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 MonitorsListLinkedResourcesViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -1847,7 +2068,7 @@ public partial class Datadog var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listLinkedResources'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); } // replace URI parameters with values from identity @@ -1862,35 +2083,73 @@ public partial class Datadog + resourceGroupName + "/providers/Microsoft.Datadog/monitors/" + monitorName - + "/listLinkedResources" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the properties of a specific monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsGetWithResult(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MonitorsListLinkedResources_Call(request,onOk,onDefault,eventListener,sender); + return await this.MonitorsGetWithResult_Call (request, 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 - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListLinkedResources_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MonitorsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1898,9 +2157,3200 @@ public partial class Datadog try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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.Datadog.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 MonitorsGet_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// 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 MonitorsGet_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(monitorName),monitorName); + } + } + + /// List all monitors under the specified subscription. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Datadog/monitors" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List the api keys for a given monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// 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.Datadog.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 MonitorsListApiKeys(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/listApiKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsListApiKeys_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List the api keys for a given monitor resource. + /// + /// 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.Datadog.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 MonitorsListApiKeysViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/listApiKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsListApiKeys_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List the api keys for a given monitor resource. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListApiKeysViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/listApiKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsListApiKeysWithResult_Call (request, eventListener,sender); + } + } + + /// List the api keys for a given monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListApiKeysWithResult(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/listApiKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsListApiKeysWithResult_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.Datadog.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 MonitorsListApiKeysWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogApiKeyListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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.Datadog.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 MonitorsListApiKeys_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogApiKeyListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// 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 MonitorsListApiKeys_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(monitorName),monitorName); + } + } + + /// List all monitors under the specified resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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.Datadog.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 MonitorsListByResourceGroup(string subscriptionId, string resourceGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List all monitors under the specified 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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListByResourceGroupViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List all monitors under the specified resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// List all monitors under the specified resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsListByResourceGroupWithResult_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.Datadog.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 MonitorsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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.Datadog.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 MonitorsListByResourceGroup_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 MonitorsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + } + } + + /// List the hosts for a given monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// 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.Datadog.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 MonitorsListHosts(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/listHosts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsListHosts_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List the hosts for a given monitor resource. + /// + /// 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.Datadog.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 MonitorsListHostsViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/listHosts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsListHosts_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List the hosts for a given monitor resource. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListHostsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/listHosts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsListHostsWithResult_Call (request, eventListener,sender); + } + } + + /// List the hosts for a given monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListHostsWithResult(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/listHosts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsListHostsWithResult_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.Datadog.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 MonitorsListHostsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHostListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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.Datadog.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 MonitorsListHosts_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHostListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// 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 MonitorsListHosts_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(monitorName),monitorName); + } + } + + /// + /// List all Azure resources associated to the same Datadog organization as the target resource. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// 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.Datadog.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 MonitorsListLinkedResources(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/listLinkedResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsListLinkedResources_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// List all Azure resources associated to the same Datadog organization as the target resource. + /// + /// + /// 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.Datadog.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 MonitorsListLinkedResourcesViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/listLinkedResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsListLinkedResources_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// List all Azure resources associated to the same Datadog organization as the target resource. + /// + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListLinkedResourcesViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/listLinkedResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsListLinkedResourcesWithResult_Call (request, eventListener,sender); + } + } + + /// + /// List all Azure resources associated to the same Datadog organization as the target resource. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListLinkedResourcesWithResult(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/listLinkedResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsListLinkedResourcesWithResult_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.Datadog.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 MonitorsListLinkedResourcesWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LinkedResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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.Datadog.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 MonitorsListLinkedResources_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LinkedResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// 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 MonitorsListLinkedResources_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(monitorName),monitorName); + } + } + + /// List the resources currently being monitored by the Datadog monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// 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.Datadog.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 MonitorsListMonitoredResources(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/listMonitoredResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsListMonitoredResources_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List the resources currently being monitored by the Datadog monitor resource. + /// + /// 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.Datadog.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 MonitorsListMonitoredResourcesViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/listMonitoredResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsListMonitoredResources_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List the resources currently being monitored by the Datadog monitor resource. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListMonitoredResourcesViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/listMonitoredResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsListMonitoredResourcesWithResult_Call (request, eventListener,sender); + } + } + + /// List the resources currently being monitored by the Datadog monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListMonitoredResourcesWithResult(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/listMonitoredResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsListMonitoredResourcesWithResult_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.Datadog.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 MonitorsListMonitoredResourcesWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoredResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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.Datadog.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 MonitorsListMonitoredResources_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoredResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// 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 MonitorsListMonitoredResources_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(monitorName),monitorName); + } + } + + /// List all monitors under the specified subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors'"); + } + + // 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.Datadog/monitors" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List all monitors under the specified subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors'"); + } + + // 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.Datadog/monitors" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsListWithResult_Call (request, eventListener,sender); + } + } + + /// List all monitors under the specified subscription. + /// The ID of the target subscription. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Datadog/monitors" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsListWithResult_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.Datadog.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 MonitorsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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.Datadog.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 MonitorsList_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 ID of the target subscription. + /// 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 MonitorsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Refresh the set password link and return a latest one. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// 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.Datadog.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 MonitorsRefreshSetPasswordLink(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/refreshSetPasswordLink" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsRefreshSetPasswordLink_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Refresh the set password link and return a latest one. + /// + /// 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.Datadog.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 MonitorsRefreshSetPasswordLinkViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/refreshSetPasswordLink" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsRefreshSetPasswordLink_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Refresh the set password link and return a latest one. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsRefreshSetPasswordLinkViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/refreshSetPasswordLink" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsRefreshSetPasswordLinkWithResult_Call (request, eventListener,sender); + } + } + + /// Refresh the set password link and return a latest one. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsRefreshSetPasswordLinkWithResult(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/refreshSetPasswordLink" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsRefreshSetPasswordLinkWithResult_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.Datadog.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 MonitorsRefreshSetPasswordLinkWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSetPasswordLink.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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.Datadog.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 MonitorsRefreshSetPasswordLink_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSetPasswordLink.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// 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 MonitorsRefreshSetPasswordLink_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(monitorName),monitorName); + } + } + + /// Set the default api key. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// + /// 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.Datadog.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 MonitorsSetDefaultKey(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/setDefaultKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsSetDefaultKey_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Set the default api key. + /// + /// + /// 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.Datadog.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 MonitorsSetDefaultKeyViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/setDefaultKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsSetDefaultKey_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Set the default api key. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// Json string supplied to the MonitorsSetDefaultKey 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.Datadog.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 MonitorsSetDefaultKeyViaJsonString(string subscriptionId, string resourceGroupName, string monitorName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/setDefaultKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsSetDefaultKey_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsSetDefaultKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// + /// 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 MonitorsSetDefaultKey_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(monitorName),monitorName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// update a monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// The parameters for a PATCH request to a monitor resource. + /// 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.Datadog.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 MonitorsUpdate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update a monitor resource. + /// + /// The parameters for a PATCH request to a monitor resource. + /// 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.Datadog.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 MonitorsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update a monitor resource. + /// + /// The parameters for a PATCH request to a monitor resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// Json string supplied to the MonitorsUpdate 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.Datadog.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 MonitorsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string monitorName, 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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitorsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update a monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// Json string supplied to the MonitorsUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string monitorName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// The parameters for a PATCH request to a monitor resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsUpdateWithResult(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorsUpdateWithResult_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.Datadog.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 MonitorsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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.Datadog.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 MonitorsUpdate_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1908,13 +5358,13 @@ public partial class Datadog case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LinkedResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1930,17 +5380,18 @@ public partial class Datadog } /// - /// 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 ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name + /// The parameters for a PATCH request to a monitor resource. /// 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 MonitorsListLinkedResources_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MonitorsUpdate_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1949,15 +5400,16 @@ public partial class Datadog await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(monitorName),monitorName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// List the resources currently being monitored by the Datadog monitor resource. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Monitor resource name + /// + /// List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + /// /// 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). @@ -1966,7 +5418,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MonitorsListMonitoredResources(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + 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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -1974,13 +5426,7 @@ public partial class Datadog { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.Datadog/monitors/" - + global::System.Uri.EscapeDataString(monitorName) - + "/listMonitoredResources" + "/providers/Microsoft.Datadog/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1989,16 +5435,18 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorsListMonitoredResources_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// List the resources currently being monitored by the Datadog monitor resource. + /// + /// List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + /// /// /// 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 @@ -2008,7 +5456,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MonitorsListMonitoredResourcesViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + 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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -2016,25 +5464,16 @@ public partial class Datadog { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Datadog/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listMonitoredResources'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Datadog/operations'"); } // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var monitorName = _match.Groups["monitorName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.Datadog/monitors/" - + monitorName - + "/listMonitoredResources" + "/providers/Microsoft.Datadog/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2043,100 +5482,26 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorsListMonitoredResources_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). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListMonitoredResources_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); 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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoredResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Monitor resource name - /// 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 MonitorsListMonitoredResources_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(monitorName),monitorName); - } - } - - /// List all monitors under the specified subscription. /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsListViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -2144,116 +5509,43 @@ public partial class Datadog { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Datadog/monitors$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Datadog/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Datadog/operations'"); } // 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.Datadog/monitors" + "/providers/Microsoft.Datadog/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MonitorsList_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). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsList_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); 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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + return await this.OperationsListWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. /// - /// The ID of the target subscription. - /// 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 MonitorsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - } - } - - /// Refresh the set password link and return a latest one. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Monitor resource name - /// 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.Datadog.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 MonitorsRefreshSetPasswordLink(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -2261,85 +5553,85 @@ public partial class Datadog { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.Datadog/monitors/" - + global::System.Uri.EscapeDataString(monitorName) - + "/refreshSetPasswordLink" + "/providers/Microsoft.Datadog/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MonitorsRefreshSetPasswordLink_Call(request,onOk,onDefault,eventListener,sender); + return await this.OperationsListWithResult_Call (request, eventListener,sender); } } - /// Refresh the set password link and return a latest one. - /// - /// 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.Datadog.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 MonitorsRefreshSetPasswordLinkViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { - var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/refreshSetPasswordLink'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var monitorName = _match.Groups["monitorName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.Datadog/monitors/" - + monitorName - + "/refreshSetPasswordLink" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.MonitorsRefreshSetPasswordLink_Call(request,onOk,onDefault,eventListener,sender); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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 @@ -2349,7 +5641,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MonitorsRefreshSetPasswordLink_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2360,6 +5652,7 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2367,13 +5660,13 @@ public partial class Datadog case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSetPasswordLink.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2389,44 +5682,37 @@ public partial class Datadog } /// - /// 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 ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Monitor resource name /// 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 MonitorsRefreshSetPasswordLink_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(monitorName),monitorName); + } } - /// Set the default api key. + /// Configures single-sign-on for this resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name + /// Configuration name /// /// 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.Datadog.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 MonitorsSetDefaultKey(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SingleSignOnConfigurationsCreateOrUpdate(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -2440,7 +5726,8 @@ public partial class Datadog + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Datadog/monitors/" + global::System.Uri.EscapeDataString(monitorName) - + "/setDefaultKey" + + "/singleSignOnConfigurations/" + + global::System.Uri.EscapeDataString(configurationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2449,20 +5736,20 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorsSetDefaultKey_Call(request,onOk,onDefault,eventListener,sender); + await this.SingleSignOnConfigurationsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Set the default api key. + /// Configures single-sign-on for this resource. /// /// /// a delegate that is called when the remote service returns 200 (OK). @@ -2470,10 +5757,11 @@ public partial class Datadog /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsSetDefaultKeyViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SingleSignOnConfigurationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -2481,16 +5769,17 @@ public partial class Datadog { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)/singleSignOnConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/setDefaultKey'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var monitorName = _match.Groups["monitorName"].Value; + var configurationName = _match.Groups["configurationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -2499,7 +5788,8 @@ public partial class Datadog + resourceGroupName + "/providers/Microsoft.Datadog/monitors/" + monitorName - + "/setDefaultKey" + + "/singleSignOnConfigurations/" + + configurationName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2508,110 +5798,143 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorsSetDefaultKey_Call(request,onOk,onDefault,eventListener,sender); + await this.SingleSignOnConfigurationsCreateOrUpdate_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). + /// Configures single-sign-on for this resource. + /// + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsSetDefaultKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SingleSignOnConfigurationsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-03-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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)/singleSignOnConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + var configurationName = _match.Groups["configurationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/singleSignOnConfigurations/" + + configurationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SingleSignOnConfigurationsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// + /// Configures single-sign-on for this resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name - /// + /// Configuration name + /// Json string supplied to the SingleSignOnConfigurationsCreateOrUpdate 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.Datadog.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 MonitorsSetDefaultKey_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task SingleSignOnConfigurationsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, 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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { + var apiVersion = @"2021-03-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(monitorName),monitorName); - 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(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/singleSignOnConfigurations/" + + global::System.Uri.EscapeDataString(configurationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SingleSignOnConfigurationsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Update a monitor resource. + /// Configures single-sign-on for this resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name - /// The parameters for a PATCH request to a monitor resource. - /// 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). + /// Configuration name + /// Json string supplied to the SingleSignOnConfigurationsCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsUpdate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SingleSignOnConfigurationsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -2625,86 +5948,236 @@ public partial class Datadog + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Datadog/monitors/" + global::System.Uri.EscapeDataString(monitorName) + + "/singleSignOnConfigurations/" + + global::System.Uri.EscapeDataString(configurationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MonitorsUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.SingleSignOnConfigurationsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Update a monitor resource. - /// - /// The parameters for a PATCH request to a monitor resource. - /// 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). + /// Configures single-sign-on for this resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// Configuration name + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 MonitorsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SingleSignOnConfigurationsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-03-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/singleSignOnConfigurations/" + + global::System.Uri.EscapeDataString(configurationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SingleSignOnConfigurationsCreateOrUpdateWithResult_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.Datadog.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 SingleSignOnConfigurationsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'"); - } + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var monitorName = _match.Groups["monitorName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.Datadog/monitors/" - + monitorName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // drop the old response + _response?.Dispose(); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; - // 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.Datadog.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException(_response); + } + } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.MonitorsUpdate_Call(request,onOk,onDefault,eventListener,sender); + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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 @@ -2714,31 +6187,28 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MonitorsUpdate_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task SingleSignOnConfigurationsCreateOrUpdate_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default + // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -2747,15 +6217,14 @@ public partial class Datadog if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -2764,45 +6233,45 @@ public partial class Datadog _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -2810,20 +6279,18 @@ public partial class Datadog continue; } // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); - // drop the old response - _response?.Dispose(); + // drop the old response + _response?.Dispose(); - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2831,13 +6298,13 @@ public partial class Datadog case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2853,18 +6320,19 @@ public partial class Datadog } /// - /// 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 ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name - /// The parameters for a PATCH request to a monitor resource. + /// Configuration name + /// /// 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 MonitorsUpdate_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task SingleSignOnConfigurationsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -2873,16 +6341,19 @@ public partial class Datadog await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(monitorName),monitorName); + await eventListener.AssertNotNull(nameof(configurationName),configurationName); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. - /// + /// Gets the datadog single sign-on resource for the given Monitor. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// Configuration name /// 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). @@ -2891,7 +6362,7 @@ public partial class Datadog /// /// 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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SingleSignOnConfigurationsGet(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -2899,7 +6370,14 @@ public partial class Datadog { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Datadog/operations" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/singleSignOnConfigurations/" + + global::System.Uri.EscapeDataString(configurationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2913,13 +6391,11 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.SingleSignOnConfigurationsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. - /// + /// Gets the datadog single sign-on resource for the given Monitor. /// /// 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 @@ -2929,7 +6405,7 @@ public partial class Datadog /// /// 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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SingleSignOnConfigurationsGetViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -2937,128 +6413,27 @@ public partial class Datadog { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Datadog/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)/singleSignOnConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Datadog/operations'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}'"); } // replace URI parameters with values from identity - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Datadog/operations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.OperationsList_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). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); 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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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. - /// - /// 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.Datadog.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - - } - } - - /// Configures single-sign-on for this resource. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Monitor resource name - /// Configuration name - /// - /// 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.Datadog.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 SingleSignOnConfigurationsCreateOrUpdate(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-03-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + var configurationName = _match.Groups["configurationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) + + resourceGroupName + "/providers/Microsoft.Datadog/monitors/" - + global::System.Uri.EscapeDataString(monitorName) + + monitorName + "/singleSignOnConfigurations/" - + global::System.Uri.EscapeDataString(configurationName) + + configurationName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3067,31 +6442,24 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SingleSignOnConfigurationsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.SingleSignOnConfigurationsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Configures single-sign-on for this resource. + /// Gets the datadog single sign-on resource for the given Monitor. /// - /// - /// 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.Datadog.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 SingleSignOnConfigurationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SingleSignOnConfigurationsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -3124,36 +6492,74 @@ public partial class Datadog + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SingleSignOnConfigurationsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the datadog single sign-on resource for the given Monitor. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// Configuration name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 SingleSignOnConfigurationsGetWithResult(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/singleSignOnConfigurations/" + + global::System.Uri.EscapeDataString(configurationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.SingleSignOnConfigurationsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.SingleSignOnConfigurationsGetWithResult_Call (request, 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 - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 SingleSignOnConfigurationsCreateOrUpdate_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task SingleSignOnConfigurationsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3161,105 +6567,72 @@ public partial class Datadog try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + default: { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.RestException(_response, await _result); + throw ex; } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException(_response); + else + { + throw new global::System.Exception($"[{code}] : {message}"); } } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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 SingleSignOnConfigurationsGet_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3267,13 +6640,13 @@ public partial class Datadog case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3289,19 +6662,18 @@ public partial class Datadog } /// - /// 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 ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name /// Configuration name - /// /// 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 SingleSignOnConfigurationsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task SingleSignOnConfigurationsGet_Validate(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -3310,19 +6682,16 @@ public partial class Datadog await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(monitorName),monitorName); await eventListener.AssertNotNull(nameof(configurationName),configurationName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Gets the datadog single sign-on resource for the given Monitor. + /// List the single sign-on configurations for a given monitor resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name - /// Configuration name /// 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). @@ -3331,7 +6700,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SingleSignOnConfigurationsGet(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SingleSignOnConfigurationsList(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -3345,8 +6714,7 @@ public partial class Datadog + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Datadog/monitors/" + global::System.Uri.EscapeDataString(monitorName) - + "/singleSignOnConfigurations/" - + global::System.Uri.EscapeDataString(configurationName) + + "/singleSignOnConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3360,11 +6728,11 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SingleSignOnConfigurationsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.SingleSignOnConfigurationsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets the datadog single sign-on resource for the given Monitor. + /// List the single sign-on configurations for a given monitor resource. /// /// 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 @@ -3374,7 +6742,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SingleSignOnConfigurationsGetViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SingleSignOnConfigurationsListViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -3382,45 +6750,199 @@ public partial class Datadog { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)/singleSignOnConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)/singleSignOnConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/singleSignOnConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SingleSignOnConfigurationsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List the single sign-on configurations for a given monitor resource. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 SingleSignOnConfigurationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)/singleSignOnConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var monitorName = _match.Groups["monitorName"].Value; - var configurationName = _match.Groups["configurationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" - + resourceGroupName + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/singleSignOnConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SingleSignOnConfigurationsListWithResult_Call (request, eventListener,sender); + } + } + + /// List the single sign-on configurations for a given monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 SingleSignOnConfigurationsListWithResult(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Datadog/monitors/" - + monitorName - + "/singleSignOnConfigurations/" - + configurationName + + global::System.Uri.EscapeDataString(monitorName) + + "/singleSignOnConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.SingleSignOnConfigurationsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.SingleSignOnConfigurationsListWithResult_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.Datadog.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 SingleSignOnConfigurationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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 @@ -3430,7 +6952,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SingleSignOnConfigurationsGet_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task SingleSignOnConfigurationsList_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3441,6 +6963,7 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3448,13 +6971,13 @@ public partial class Datadog case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3470,18 +6993,17 @@ public partial class Datadog } /// - /// Validation method for method. Call this like the actual call, but you will + /// Validation method for method. Call this like the actual call, but you will /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name - /// Configuration name /// 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 SingleSignOnConfigurationsGet_Validate(string subscriptionId, string resourceGroupName, string monitorName, string configurationName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task SingleSignOnConfigurationsList_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -3490,25 +7012,27 @@ public partial class Datadog await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(monitorName),monitorName); - await eventListener.AssertNotNull(nameof(configurationName),configurationName); } } - /// List the single sign-on configurations for a given monitor resource. + /// update a tag rule set for a given monitor resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name + /// Rule set name + /// Capture logs and metrics of Azure resources based on ARM tags. /// 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.Datadog.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 SingleSignOnConfigurationsList(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TagRulesCreateOrUpdate(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -3522,7 +7046,8 @@ public partial class Datadog + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Datadog/monitors/" + global::System.Uri.EscapeDataString(monitorName) - + "/singleSignOnConfigurations" + + "/tagRules/" + + global::System.Uri.EscapeDataString(ruleSetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3531,26 +7056,32 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SingleSignOnConfigurationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.TagRulesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// List the single sign-on configurations for a given monitor resource. + /// update a tag rule set for a given monitor resource. /// + /// Capture logs and metrics of Azure resources based on ARM tags. /// 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.Datadog.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 SingleSignOnConfigurationsListViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TagRulesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -3558,16 +7089,17 @@ public partial class Datadog { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)/singleSignOnConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)/tagRules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var monitorName = _match.Groups["monitorName"].Value; + var ruleSetName = _match.Groups["ruleSetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -3576,7 +7108,8 @@ public partial class Datadog + resourceGroupName + "/providers/Microsoft.Datadog/monitors/" + monitorName - + "/singleSignOnConfigurations" + + "/tagRules/" + + ruleSetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3585,104 +7118,143 @@ public partial class Datadog // 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.Datadog.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SingleSignOnConfigurationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.TagRulesCreateOrUpdate_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). + /// update a tag rule set for a given monitor resource. + /// + /// Capture logs and metrics of Azure resources based on ARM tags. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 SingleSignOnConfigurationsList_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TagRulesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-03-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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnResourceListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Datadog/monitors/(?[^/]+)/tagRules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + var ruleSetName = _match.Groups["ruleSetName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/tagRules/" + + ruleSetName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.TagRulesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// + /// update a tag rule set for a given monitor resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name + /// Rule set name + /// Json string supplied to the TagRulesCreateOrUpdate 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.Datadog.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 SingleSignOnConfigurationsList_Validate(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task TagRulesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName, 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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { + var apiVersion = @"2021-03-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); - await eventListener.AssertNotNull(nameof(monitorName),monitorName); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/tagRules/" + + global::System.Uri.EscapeDataString(ruleSetName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TagRulesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create or update a tag rule set for a given monitor resource. + /// update a tag rule set for a given monitor resource. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Monitor resource name /// Rule set name - /// Capture logs and metrics of Azure resources based on ARM tags. - /// 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). + /// Json string supplied to the TagRulesCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 TagRulesCreateOrUpdate(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TagRulesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -3702,85 +7274,134 @@ public partial class Datadog + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.TagRulesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.TagRulesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Create or update a tag rule set for a given monitor resource. - /// + /// update a tag rule set for a given monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// Rule set name /// Capture logs and metrics of Azure resources based on ARM tags. - /// 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.Datadog.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 TagRulesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TagRulesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)/tagRules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var monitorName = _match.Groups["monitorName"].Value; - var ruleSetName = _match.Groups["ruleSetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Datadog/monitors/" - + monitorName + + global::System.Uri.EscapeDataString(monitorName) + "/tagRules/" - + ruleSetName + + global::System.Uri.EscapeDataString(ruleSetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.TagRulesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.TagRulesCreateOrUpdateWithResult_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.Datadog.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 TagRulesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRules.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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 @@ -3790,7 +7411,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task TagRulesCreateOrUpdate_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task TagRulesCreateOrUpdate_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3801,6 +7422,7 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3808,13 +7430,13 @@ public partial class Datadog case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRules.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRules.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3842,7 +7464,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task TagRulesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task TagRulesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules body, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -3851,7 +7473,7 @@ public partial class Datadog await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(monitorName),monitorName); await eventListener.AssertNotNull(nameof(ruleSetName),ruleSetName); await eventListener.AssertNotNull(nameof(body), body); @@ -3872,7 +7494,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task TagRulesGet(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TagRulesGet(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -3901,7 +7523,7 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.TagRulesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.TagRulesGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -3915,7 +7537,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task TagRulesGetViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TagRulesGetViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -3957,11 +7579,169 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.TagRulesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.TagRulesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a tag rule set for a given monitor resource. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 TagRulesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)/tagRules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + var ruleSetName = _match.Groups["ruleSetName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/tagRules/" + + ruleSetName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.TagRulesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get a tag rule set for a given monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// Rule set name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 TagRulesGetWithResult(string subscriptionId, string resourceGroupName, string monitorName, string ruleSetName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/tagRules/" + + global::System.Uri.EscapeDataString(ruleSetName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.TagRulesGetWithResult_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.Datadog.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 TagRulesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRules.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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 @@ -3971,7 +7751,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task TagRulesGet_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task TagRulesGet_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3982,6 +7762,7 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3989,13 +7770,13 @@ public partial class Datadog case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRules.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRules.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4031,7 +7812,7 @@ public partial class Datadog await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(monitorName),monitorName); await eventListener.AssertNotNull(nameof(ruleSetName),ruleSetName); } @@ -4049,7 +7830,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task TagRulesList(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TagRulesList(string subscriptionId, string resourceGroupName, string monitorName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -4077,7 +7858,7 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.TagRulesList_Call(request,onOk,onDefault,eventListener,sender); + await this.TagRulesList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -4091,7 +7872,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task TagRulesListViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TagRulesListViaIdentity(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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { var apiVersion = @"2021-03-01"; // Constant Parameters @@ -4131,11 +7912,165 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.TagRulesList_Call(request,onOk,onDefault,eventListener,sender); + await this.TagRulesList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List the tag rules for a given monitor resource. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 TagRulesListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-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.Datadog/monitors/(?[^/]+)/tagRules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var monitorName = _match.Groups["monitorName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Datadog/monitors/" + + monitorName + + "/tagRules" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.TagRulesListWithResult_Call (request, eventListener,sender); + } + } + + /// List the tag rules for a given monitor resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Monitor resource name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Datadog.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 TagRulesListWithResult(string subscriptionId, string resourceGroupName, string monitorName, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Datadog/monitors/" + + global::System.Uri.EscapeDataString(monitorName) + + "/tagRules" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.TagRulesListWithResult_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.Datadog.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 TagRulesListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRulesListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.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.Datadog.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.Datadog.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 @@ -4145,7 +8080,7 @@ public partial class Datadog /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task TagRulesList_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task TagRulesList_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.Datadog.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4156,6 +8091,7 @@ public partial class Datadog await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4163,13 +8099,13 @@ public partial class Datadog case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRulesListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRulesListResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4204,7 +8140,7 @@ public partial class Datadog await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertRegEx(nameof(resourceGroupName), resourceGroupName, @"^[-\w\._\(\)]+$"); await eventListener.AssertNotNull(nameof(monitorName),monitorName); } } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Any.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/Any.PowerShell.cs index 3ce2237bd594..e6cf57ba5fd3 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/Any.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial class Any { @@ -146,7 +146,7 @@ public override string ToString() return ToJsonString(); } } - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial interface IAny diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Any.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/Any.cs index 1cff9f2c1f0b..2515acb5a1fb 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Any.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/Any.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; - /// Any object + /// Anything public partial class Any : Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IAny, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IAnyInternal @@ -19,13 +19,13 @@ public Any() } } - /// Any object + /// Anything public partial interface IAny : Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IJsonSerializable { } - /// Any object + /// Anything internal partial interface IAnyInternal { diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Any.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/Any.json.cs index a107e3c0866a..1dcc6a648703 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Any.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/Any.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; - /// Any object + /// Anything public partial class Any { diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResource.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResource.PowerShell.cs deleted file mode 100644 index f47d57a0dd89..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResource.PowerShell.cs +++ /dev/null @@ -1,450 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; - - [System.ComponentModel.TypeConverter(typeof(DatadogMonitorResourceTypeConverter))] - public partial class DatadogMonitorResource - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal DatadogMonitorResource(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ResourceSkuTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitorPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IdentityPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("UserInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfo = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo) content.GetValueForProperty("UserInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfo, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.UserInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("MonitoringStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus?) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SkuName, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationProperty = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties) content.GetValueForProperty("DatadogOrganizationProperty",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationProperty, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogOrganizationPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("MarketplaceSubscriptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).MarketplaceSubscriptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus?) content.GetValueForProperty("MarketplaceSubscriptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).MarketplaceSubscriptionStatus, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus.CreateFrom); - } - if (content.Contains("LiftrResourceCategory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).LiftrResourceCategory = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories?) content.GetValueForProperty("LiftrResourceCategory",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).LiftrResourceCategory, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories.CreateFrom); - } - if (content.Contains("LiftrResourcePreference")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).LiftrResourcePreference = (int?) content.GetValueForProperty("LiftrResourcePreference",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).LiftrResourcePreference, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DatadogOrganizationPropertyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyName = (string) content.GetValueForProperty("DatadogOrganizationPropertyName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyName, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyId = (string) content.GetValueForProperty("DatadogOrganizationPropertyId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyId, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyRedirectUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyRedirectUri = (string) content.GetValueForProperty("DatadogOrganizationPropertyRedirectUri",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyRedirectUri, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyApiKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApiKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApiKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApiKey, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyApplicationKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApplicationKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApplicationKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApplicationKey, global::System.Convert.ToString); - } - if (content.Contains("UserInfoName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfoName = (string) content.GetValueForProperty("UserInfoName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfoName, global::System.Convert.ToString); - } - if (content.Contains("UserInfoEmailAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfoEmailAddress = (string) content.GetValueForProperty("UserInfoEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfoEmailAddress, global::System.Convert.ToString); - } - if (content.Contains("UserInfoPhoneNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfoPhoneNumber = (string) content.GetValueForProperty("UserInfoPhoneNumber",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfoPhoneNumber, global::System.Convert.ToString); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes.CreateFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DatadogOrganizationPropertyLinkingAuthCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingAuthCode = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingAuthCode",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingAuthCode, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyLinkingClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingClientId = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingClientId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingClientId, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyEnterpriseAppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyEnterpriseAppId = (string) content.GetValueForProperty("DatadogOrganizationPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyEnterpriseAppId, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DatadogMonitorResource(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ResourceSkuTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitorPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IdentityPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("UserInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfo = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo) content.GetValueForProperty("UserInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfo, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.UserInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("MonitoringStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus?) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SkuName, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationProperty = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties) content.GetValueForProperty("DatadogOrganizationProperty",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationProperty, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogOrganizationPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("MarketplaceSubscriptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).MarketplaceSubscriptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus?) content.GetValueForProperty("MarketplaceSubscriptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).MarketplaceSubscriptionStatus, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus.CreateFrom); - } - if (content.Contains("LiftrResourceCategory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).LiftrResourceCategory = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories?) content.GetValueForProperty("LiftrResourceCategory",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).LiftrResourceCategory, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories.CreateFrom); - } - if (content.Contains("LiftrResourcePreference")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).LiftrResourcePreference = (int?) content.GetValueForProperty("LiftrResourcePreference",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).LiftrResourcePreference, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DatadogOrganizationPropertyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyName = (string) content.GetValueForProperty("DatadogOrganizationPropertyName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyName, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyId = (string) content.GetValueForProperty("DatadogOrganizationPropertyId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyId, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyRedirectUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyRedirectUri = (string) content.GetValueForProperty("DatadogOrganizationPropertyRedirectUri",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyRedirectUri, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyApiKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApiKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApiKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApiKey, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyApplicationKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApplicationKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApplicationKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApplicationKey, global::System.Convert.ToString); - } - if (content.Contains("UserInfoName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfoName = (string) content.GetValueForProperty("UserInfoName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfoName, global::System.Convert.ToString); - } - if (content.Contains("UserInfoEmailAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfoEmailAddress = (string) content.GetValueForProperty("UserInfoEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfoEmailAddress, global::System.Convert.ToString); - } - if (content.Contains("UserInfoPhoneNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfoPhoneNumber = (string) content.GetValueForProperty("UserInfoPhoneNumber",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).UserInfoPhoneNumber, global::System.Convert.ToString); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes.CreateFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DatadogOrganizationPropertyLinkingAuthCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingAuthCode = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingAuthCode",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingAuthCode, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyLinkingClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingClientId = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingClientId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingClientId, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyEnterpriseAppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyEnterpriseAppId = (string) content.GetValueForProperty("DatadogOrganizationPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyEnterpriseAppId, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new DatadogMonitorResource(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new DatadogMonitorResource(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - [System.ComponentModel.TypeConverter(typeof(DatadogMonitorResourceTypeConverter))] - public partial interface IDatadogMonitorResource - - { - - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorProperties.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorProperties.PowerShell.cs deleted file mode 100644 index 2b7417e1bce4..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorProperties.PowerShell.cs +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; - - /// Properties specific to the monitor resource. - [System.ComponentModel.TypeConverter(typeof(MonitorPropertiesTypeConverter))] - public partial class MonitorProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MonitorProperties(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MonitorProperties(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal MonitorProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("DatadogOrganizationProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationProperty = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties) content.GetValueForProperty("DatadogOrganizationProperty",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationProperty, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogOrganizationPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("UserInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfo = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo) content.GetValueForProperty("UserInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfo, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.UserInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("MonitoringStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus?) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus.CreateFrom); - } - if (content.Contains("MarketplaceSubscriptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).MarketplaceSubscriptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus?) content.GetValueForProperty("MarketplaceSubscriptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).MarketplaceSubscriptionStatus, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus.CreateFrom); - } - if (content.Contains("LiftrResourceCategory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).LiftrResourceCategory = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories?) content.GetValueForProperty("LiftrResourceCategory",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).LiftrResourceCategory, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories.CreateFrom); - } - if (content.Contains("LiftrResourcePreference")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).LiftrResourcePreference = (int?) content.GetValueForProperty("LiftrResourcePreference",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).LiftrResourcePreference, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DatadogOrganizationPropertyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyName = (string) content.GetValueForProperty("DatadogOrganizationPropertyName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyName, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyId = (string) content.GetValueForProperty("DatadogOrganizationPropertyId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyId, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyRedirectUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyRedirectUri = (string) content.GetValueForProperty("DatadogOrganizationPropertyRedirectUri",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyRedirectUri, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyApiKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApiKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApiKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApiKey, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyApplicationKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApplicationKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApplicationKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApplicationKey, global::System.Convert.ToString); - } - if (content.Contains("UserInfoName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfoName = (string) content.GetValueForProperty("UserInfoName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfoName, global::System.Convert.ToString); - } - if (content.Contains("UserInfoEmailAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfoEmailAddress = (string) content.GetValueForProperty("UserInfoEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfoEmailAddress, global::System.Convert.ToString); - } - if (content.Contains("UserInfoPhoneNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfoPhoneNumber = (string) content.GetValueForProperty("UserInfoPhoneNumber",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfoPhoneNumber, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyLinkingAuthCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingAuthCode = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingAuthCode",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingAuthCode, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyLinkingClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingClientId = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingClientId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingClientId, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyEnterpriseAppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyEnterpriseAppId = (string) content.GetValueForProperty("DatadogOrganizationPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyEnterpriseAppId, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal MonitorProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("DatadogOrganizationProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationProperty = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties) content.GetValueForProperty("DatadogOrganizationProperty",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationProperty, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogOrganizationPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("UserInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfo = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo) content.GetValueForProperty("UserInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfo, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.UserInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("MonitoringStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus?) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus.CreateFrom); - } - if (content.Contains("MarketplaceSubscriptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).MarketplaceSubscriptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus?) content.GetValueForProperty("MarketplaceSubscriptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).MarketplaceSubscriptionStatus, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus.CreateFrom); - } - if (content.Contains("LiftrResourceCategory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).LiftrResourceCategory = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories?) content.GetValueForProperty("LiftrResourceCategory",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).LiftrResourceCategory, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories.CreateFrom); - } - if (content.Contains("LiftrResourcePreference")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).LiftrResourcePreference = (int?) content.GetValueForProperty("LiftrResourcePreference",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).LiftrResourcePreference, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DatadogOrganizationPropertyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyName = (string) content.GetValueForProperty("DatadogOrganizationPropertyName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyName, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyId = (string) content.GetValueForProperty("DatadogOrganizationPropertyId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyId, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyRedirectUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyRedirectUri = (string) content.GetValueForProperty("DatadogOrganizationPropertyRedirectUri",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyRedirectUri, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyApiKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApiKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApiKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApiKey, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyApplicationKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApplicationKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApplicationKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApplicationKey, global::System.Convert.ToString); - } - if (content.Contains("UserInfoName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfoName = (string) content.GetValueForProperty("UserInfoName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfoName, global::System.Convert.ToString); - } - if (content.Contains("UserInfoEmailAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfoEmailAddress = (string) content.GetValueForProperty("UserInfoEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfoEmailAddress, global::System.Convert.ToString); - } - if (content.Contains("UserInfoPhoneNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfoPhoneNumber = (string) content.GetValueForProperty("UserInfoPhoneNumber",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).UserInfoPhoneNumber, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyLinkingAuthCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingAuthCode = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingAuthCode",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingAuthCode, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyLinkingClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingClientId = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingClientId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingClientId, global::System.Convert.ToString); - } - if (content.Contains("DatadogOrganizationPropertyEnterpriseAppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyEnterpriseAppId = (string) content.GetValueForProperty("DatadogOrganizationPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyEnterpriseAppId, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Properties specific to the monitor resource. - [System.ComponentModel.TypeConverter(typeof(MonitorPropertiesTypeConverter))] - public partial interface IMonitorProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRules.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRules.PowerShell.cs deleted file mode 100644 index 970f1b1c7db1..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRules.PowerShell.cs +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; - - /// Capture logs and metrics of Azure resources based on ARM tags. - [System.ComponentModel.TypeConverter(typeof(MonitoringTagRulesTypeConverter))] - public partial class MonitoringTagRules - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MonitoringTagRules(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MonitoringTagRules(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal MonitoringTagRules(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRulesPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("LogRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules) content.GetValueForProperty("LogRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LogRulesTypeConverter.ConvertFrom); - } - if (content.Contains("MetricRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).MetricRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules) content.GetValueForProperty("MetricRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).MetricRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MetricRulesTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LogRuleFilteringTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleFilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]) content.GetValueForProperty("LogRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleFilteringTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTagTypeConverter.ConvertFrom)); - } - if (content.Contains("MetricRuleFilteringTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).MetricRuleFilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]) content.GetValueForProperty("MetricRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).MetricRuleFilteringTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTagTypeConverter.ConvertFrom)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LogRuleSendAadLog")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleSendAadLog = (bool?) content.GetValueForProperty("LogRuleSendAadLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleSendAadLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("LogRuleSendSubscriptionLog")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleSendSubscriptionLog = (bool?) content.GetValueForProperty("LogRuleSendSubscriptionLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleSendSubscriptionLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("LogRuleSendResourceLog")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleSendResourceLog = (bool?) content.GetValueForProperty("LogRuleSendResourceLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleSendResourceLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal MonitoringTagRules(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRulesPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("LogRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules) content.GetValueForProperty("LogRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LogRulesTypeConverter.ConvertFrom); - } - if (content.Contains("MetricRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).MetricRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules) content.GetValueForProperty("MetricRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).MetricRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MetricRulesTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LogRuleFilteringTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleFilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]) content.GetValueForProperty("LogRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleFilteringTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTagTypeConverter.ConvertFrom)); - } - if (content.Contains("MetricRuleFilteringTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).MetricRuleFilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]) content.GetValueForProperty("MetricRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).MetricRuleFilteringTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTagTypeConverter.ConvertFrom)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LogRuleSendAadLog")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleSendAadLog = (bool?) content.GetValueForProperty("LogRuleSendAadLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleSendAadLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("LogRuleSendSubscriptionLog")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleSendSubscriptionLog = (bool?) content.GetValueForProperty("LogRuleSendSubscriptionLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleSendSubscriptionLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("LogRuleSendResourceLog")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleSendResourceLog = (bool?) content.GetValueForProperty("LogRuleSendResourceLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal)this).LogRuleSendResourceLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Capture logs and metrics of Azure resources based on ARM tags. - [System.ComponentModel.TypeConverter(typeof(MonitoringTagRulesTypeConverter))] - public partial interface IMonitoringTagRules - - { - - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementProperties.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementProperties.PowerShell.cs similarity index 63% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementProperties.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementProperties.PowerShell.cs index 708d8b8865af..ed6ee55b92c2 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementProperties.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class DatadogAgreementProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,41 +78,41 @@ internal DatadogAgreementProperties(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("Publisher")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Publisher, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Publisher, global::System.Convert.ToString); } if (content.Contains("Product")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Product, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Product, global::System.Convert.ToString); } if (content.Contains("Plan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Plan, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Plan, global::System.Convert.ToString); } if (content.Contains("LicenseTextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).LicenseTextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).LicenseTextLink, global::System.Convert.ToString); } if (content.Contains("PrivacyPolicyLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); } if (content.Contains("RetrieveDatetime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Signature")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Signature, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Signature, global::System.Convert.ToString); } if (content.Contains("Accepted")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -127,61 +127,61 @@ internal DatadogAgreementProperties(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("Publisher")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Publisher, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Publisher, global::System.Convert.ToString); } if (content.Contains("Product")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Product, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Product, global::System.Convert.ToString); } if (content.Contains("Plan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Plan, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Plan, global::System.Convert.ToString); } if (content.Contains("LicenseTextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).LicenseTextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).LicenseTextLink, global::System.Convert.ToString); } if (content.Contains("PrivacyPolicyLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); } if (content.Contains("RetrieveDatetime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Signature")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Signature, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Signature, global::System.Convert.ToString); } if (content.Contains("Accepted")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogAgreementProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogAgreementProperties(content); } @@ -191,7 +191,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementProperties.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementProperties.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementProperties.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementProperties.TypeConverter.cs index 2e7092e32319..3bf631ebbf8a 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementProperties.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementProperties.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementProperties.cs similarity index 91% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementProperties.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementProperties.cs index 0e381dc32a7f..32e9318a0ffb 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementProperties.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Terms properties. public partial class DatadogAgreementProperties : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal { /// Backing field for property. @@ -85,6 +85,9 @@ public partial interface IDatadogAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If any version of the terms have been accepted, otherwise false.", SerializedName = @"accepted", PossibleTypes = new [] { typeof(bool) })] @@ -93,6 +96,9 @@ public partial interface IDatadogAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to HTML with Microsoft and Publisher terms.", SerializedName = @"licenseTextLink", PossibleTypes = new [] { typeof(string) })] @@ -101,6 +107,9 @@ public partial interface IDatadogAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Plan identifier string.", SerializedName = @"plan", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +118,9 @@ public partial interface IDatadogAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the privacy policy of the publisher.", SerializedName = @"privacyPolicyLink", PossibleTypes = new [] { typeof(string) })] @@ -117,6 +129,9 @@ public partial interface IDatadogAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Product identifier string.", SerializedName = @"product", PossibleTypes = new [] { typeof(string) })] @@ -125,6 +140,9 @@ public partial interface IDatadogAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Publisher identifier string.", SerializedName = @"publisher", PossibleTypes = new [] { typeof(string) })] @@ -135,6 +153,9 @@ public partial interface IDatadogAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Date and time in UTC of when the terms were accepted. This is empty if Accepted is false.", SerializedName = @"retrieveDatetime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -143,6 +164,9 @@ public partial interface IDatadogAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Terms signature.", SerializedName = @"signature", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementProperties.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementProperties.json.cs similarity index 92% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementProperties.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementProperties.json.cs index 3416a2e495c8..2f2b1b92e6fd 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementProperties.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -65,25 +65,25 @@ internal DatadogAgreementProperties(Microsoft.Azure.PowerShell.Cmdlets.Datadog.R { return; } - {_publisher = If( json?.PropertyT("publisher"), out var __jsonPublisher) ? (string)__jsonPublisher : (string)Publisher;} - {_product = If( json?.PropertyT("product"), out var __jsonProduct) ? (string)__jsonProduct : (string)Product;} - {_plan = If( json?.PropertyT("plan"), out var __jsonPlan) ? (string)__jsonPlan : (string)Plan;} - {_licenseTextLink = If( json?.PropertyT("licenseTextLink"), out var __jsonLicenseTextLink) ? (string)__jsonLicenseTextLink : (string)LicenseTextLink;} - {_privacyPolicyLink = If( json?.PropertyT("privacyPolicyLink"), out var __jsonPrivacyPolicyLink) ? (string)__jsonPrivacyPolicyLink : (string)PrivacyPolicyLink;} - {_retrieveDatetime = If( json?.PropertyT("retrieveDatetime"), out var __jsonRetrieveDatetime) ? global::System.DateTime.TryParse((string)__jsonRetrieveDatetime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRetrieveDatetimeValue) ? __jsonRetrieveDatetimeValue : RetrieveDatetime : RetrieveDatetime;} - {_signature = If( json?.PropertyT("signature"), out var __jsonSignature) ? (string)__jsonSignature : (string)Signature;} - {_accepted = If( json?.PropertyT("accepted"), out var __jsonAccepted) ? (bool?)__jsonAccepted : Accepted;} + {_publisher = If( json?.PropertyT("publisher"), out var __jsonPublisher) ? (string)__jsonPublisher : (string)_publisher;} + {_product = If( json?.PropertyT("product"), out var __jsonProduct) ? (string)__jsonProduct : (string)_product;} + {_plan = If( json?.PropertyT("plan"), out var __jsonPlan) ? (string)__jsonPlan : (string)_plan;} + {_licenseTextLink = If( json?.PropertyT("licenseTextLink"), out var __jsonLicenseTextLink) ? (string)__jsonLicenseTextLink : (string)_licenseTextLink;} + {_privacyPolicyLink = If( json?.PropertyT("privacyPolicyLink"), out var __jsonPrivacyPolicyLink) ? (string)__jsonPrivacyPolicyLink : (string)_privacyPolicyLink;} + {_retrieveDatetime = If( json?.PropertyT("retrieveDatetime"), out var __jsonRetrieveDatetime) ? global::System.DateTime.TryParse((string)__jsonRetrieveDatetime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRetrieveDatetimeValue) ? __jsonRetrieveDatetimeValue : _retrieveDatetime : _retrieveDatetime;} + {_signature = If( json?.PropertyT("signature"), out var __jsonSignature) ? (string)__jsonSignature : (string)_signature;} + {_accepted = If( json?.PropertyT("accepted"), out var __jsonAccepted) ? (bool?)__jsonAccepted : _accepted;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogAgreementProperties(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResource.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResource.PowerShell.cs similarity index 50% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResource.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResource.PowerShell.cs index 5d8afd545f0b..1ca600aafa57 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResource.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -62,7 +62,7 @@ public partial class DatadogAgreementResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -77,85 +77,85 @@ internal DatadogAgreementResource(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementPropertiesTypeConverter.ConvertFrom); } if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Publisher")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Publisher, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Publisher, global::System.Convert.ToString); } if (content.Contains("Product")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Product, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Product, global::System.Convert.ToString); } if (content.Contains("Plan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Plan, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Plan, global::System.Convert.ToString); } if (content.Contains("LicenseTextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).LicenseTextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).LicenseTextLink, global::System.Convert.ToString); } if (content.Contains("PrivacyPolicyLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); } if (content.Contains("RetrieveDatetime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Signature")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Signature, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Signature, global::System.Convert.ToString); } if (content.Contains("Accepted")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -170,105 +170,105 @@ internal DatadogAgreementResource(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementPropertiesTypeConverter.ConvertFrom); } if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Publisher")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Publisher, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Publisher, global::System.Convert.ToString); } if (content.Contains("Product")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Product, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Product, global::System.Convert.ToString); } if (content.Contains("Plan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Plan, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Plan, global::System.Convert.ToString); } if (content.Contains("LicenseTextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).LicenseTextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).LicenseTextLink, global::System.Convert.ToString); } if (content.Contains("PrivacyPolicyLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); } if (content.Contains("RetrieveDatetime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Signature")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Signature, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Signature, global::System.Convert.ToString); } if (content.Contains("Accepted")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogAgreementResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogAgreementResource(content); } @@ -278,7 +278,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResource.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResource.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResource.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResource.TypeConverter.cs index f7af820c7880..2e075f859131 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResource.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResource.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResource.cs similarity index 60% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResource.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResource.cs index 0c3f9bdbc8f7..de4e6f4b074c 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResource.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResource.cs @@ -3,18 +3,18 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; public partial class DatadogAgreementResource : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal { /// If any version of the terms have been accepted, otherwise false. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public bool? Accepted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).Accepted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).Accepted = value ?? default(bool); } + public bool? Accepted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).Accepted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).Accepted = value ?? default(bool); } /// Backing field for property. private string _id; @@ -25,22 +25,40 @@ public partial class DatadogAgreementResource : /// Link to HTML with Microsoft and Publisher terms. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string LicenseTextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).LicenseTextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).LicenseTextLink = value ?? null; } + public string LicenseTextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).LicenseTextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).LicenseTextLink = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementProperties()); set { {_property = value;} } } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedAt = value; } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedBy = value; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedByType = value; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedAt = value; } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedBy = value; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedByType = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -51,67 +69,71 @@ public partial class DatadogAgreementResource : /// Plan identifier string. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string Plan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).Plan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).Plan = value ?? null; } + public string Plan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).Plan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).Plan = value ?? null; } /// Link to the privacy policy of the publisher. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string PrivacyPolicyLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).PrivacyPolicyLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).PrivacyPolicyLink = value ?? null; } + public string PrivacyPolicyLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).PrivacyPolicyLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).PrivacyPolicyLink = value ?? null; } /// Product identifier string. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string Product { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).Product; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).Product = value ?? null; } + public string Product { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).Product; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).Product = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties _property; /// Represents the properties of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementProperties()); set => this._property = value; } /// Publisher identifier string. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string Publisher { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).Publisher; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).Publisher = value ?? null; } + public string Publisher { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).Publisher; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).Publisher = value ?? null; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// /// Date and time in UTC of when the terms were accepted. This is empty if Accepted is false. /// [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public global::System.DateTime? RetrieveDatetime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).RetrieveDatetime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).RetrieveDatetime = value ?? default(global::System.DateTime); } + public global::System.DateTime? RetrieveDatetime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).RetrieveDatetime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).RetrieveDatetime = value ?? default(global::System.DateTime); } /// Terms signature. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string Signature { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).Signature; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementPropertiesInternal)Property).Signature = value ?? null; } + public string Signature { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).Signature; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementPropertiesInternal)Property).Signature = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Backing field for property. private string _type; @@ -133,6 +155,9 @@ public partial interface IDatadogAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If any version of the terms have been accepted, otherwise false.", SerializedName = @"accepted", PossibleTypes = new [] { typeof(bool) })] @@ -141,6 +166,9 @@ public partial interface IDatadogAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"ARM id of the resource.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -149,6 +177,9 @@ public partial interface IDatadogAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to HTML with Microsoft and Publisher terms.", SerializedName = @"licenseTextLink", PossibleTypes = new [] { typeof(string) })] @@ -157,6 +188,9 @@ public partial interface IDatadogAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the agreement.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -165,6 +199,9 @@ public partial interface IDatadogAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Plan identifier string.", SerializedName = @"plan", PossibleTypes = new [] { typeof(string) })] @@ -173,6 +210,9 @@ public partial interface IDatadogAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the privacy policy of the publisher.", SerializedName = @"privacyPolicyLink", PossibleTypes = new [] { typeof(string) })] @@ -181,6 +221,9 @@ public partial interface IDatadogAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Product identifier string.", SerializedName = @"product", PossibleTypes = new [] { typeof(string) })] @@ -189,6 +232,9 @@ public partial interface IDatadogAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Publisher identifier string.", SerializedName = @"publisher", PossibleTypes = new [] { typeof(string) })] @@ -199,6 +245,9 @@ public partial interface IDatadogAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Date and time in UTC of when the terms were accepted. This is empty if Accepted is false.", SerializedName = @"retrieveDatetime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -207,6 +256,9 @@ public partial interface IDatadogAgreementResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Terms signature.", SerializedName = @"signature", PossibleTypes = new [] { typeof(string) })] @@ -214,55 +266,78 @@ public partial interface IDatadogAgreementResource : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// The type of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the resource.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -287,7 +362,7 @@ internal partial interface IDatadogAgreementResourceInternal /// Product identifier string. string Product { get; set; } /// Represents the properties of the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementProperties Property { get; set; } /// Publisher identifier string. string Publisher { get; set; } /// @@ -297,19 +372,21 @@ internal partial interface IDatadogAgreementResourceInternal /// Terms signature. string Signature { get; set; } /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// The type of the resource. string Type { get; set; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResource.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResource.json.cs similarity index 90% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResource.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResource.json.cs index 8aa2ca93bedd..f3b2952efc50 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResource.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -64,22 +64,22 @@ internal DatadogAgreementResource(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Run { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementProperties.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementProperties.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogAgreementResource(json) : null; } @@ -104,19 +104,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode ToJson(M return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResourceListResponse.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResourceListResponse.PowerShell.cs similarity index 74% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResourceListResponse.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResourceListResponse.PowerShell.cs index 98a1ddc1a2ae..d64531cc9edc 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResourceListResponse.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResourceListResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class DatadogAgreementResourceListResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal DatadogAgreementResourceListResponse(global::System.Collections.IDictio // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,39 +103,37 @@ internal DatadogAgreementResourceListResponse(global::System.Management.Automati // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogAgreementResourceListResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogAgreementResourceListResponse(content); } @@ -147,7 +145,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResourceListResponse.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResourceListResponse.TypeConverter.cs similarity index 96% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResourceListResponse.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResourceListResponse.TypeConverter.cs index c973ad0d6db0..a36fe1f7609e 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResourceListResponse.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResourceListResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResourceListResponse.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResourceListResponse.cs similarity index 71% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResourceListResponse.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResourceListResponse.cs index 1d604257a76c..0517fa9a7c97 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResourceListResponse.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResourceListResponse.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Response of a list operation. public partial class DatadogAgreementResourceListResponse : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponse, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponse, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponseInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class DatadogAgreementResourceListResponse : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource[] _value; + private System.Collections.Generic.List _value; /// Results of a list operation. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public DatadogAgreementResourceListResponse() @@ -41,6 +41,9 @@ public partial interface IDatadogAgreementResourceListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the next set of results, if any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IDatadogAgreementResourceListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Results of a list operation.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource) })] + System.Collections.Generic.List Value { get; set; } } /// Response of a list operation. @@ -62,7 +68,7 @@ internal partial interface IDatadogAgreementResourceListResponseInternal /// Link to the next set of results, if any. string NextLink { get; set; } /// Results of a list operation. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResourceListResponse.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResourceListResponse.json.cs similarity index 89% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResourceListResponse.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResourceListResponse.json.cs index 3fc351c26fec..80aed221c558 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogAgreementResourceListResponse.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogAgreementResourceListResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -65,19 +65,19 @@ internal DatadogAgreementResourceListResponse(Microsoft.Azure.PowerShell.Cmdlets { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementResource.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementResource.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogAgreementResourceListResponse(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKey.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKey.PowerShell.cs similarity index 75% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKey.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKey.PowerShell.cs index 6a059e7c3d95..be5dc15f647f 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKey.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKey.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -62,7 +62,7 @@ public partial class DatadogApiKey partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -77,25 +77,25 @@ internal DatadogApiKey(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("CreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("Created")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).Created = (string) content.GetValueForProperty("Created",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).Created, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).Created = (string) content.GetValueForProperty("Created",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).Created, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -110,45 +110,45 @@ internal DatadogApiKey(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("CreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("Created")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).Created = (string) content.GetValueForProperty("Created",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal)this).Created, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).Created = (string) content.GetValueForProperty("Created",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal)this).Created, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogApiKey(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogApiKey(content); } @@ -158,7 +158,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKey.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKey.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKey.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKey.TypeConverter.cs index 941c3c02737d..0d7fa6008c05 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKey.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKey.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKey.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKey.cs similarity index 89% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKey.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKey.cs index 1304a45c9071..190883c4d30a 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKey.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKey.cs @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; public partial class DatadogApiKey : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyInternal { /// Backing field for property. @@ -53,6 +53,9 @@ public partial interface IDatadogApiKey : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time of creation of the API key.", SerializedName = @"created", PossibleTypes = new [] { typeof(string) })] @@ -61,6 +64,9 @@ public partial interface IDatadogApiKey : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The user that created the API key.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] @@ -69,6 +75,9 @@ public partial interface IDatadogApiKey : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value of the API key.", SerializedName = @"key", PossibleTypes = new [] { typeof(string) })] @@ -77,6 +86,9 @@ public partial interface IDatadogApiKey : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the API key.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKey.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKey.json.cs similarity index 93% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKey.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKey.json.cs index f740f9ba8bee..48472dc0461a 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKey.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKey.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -64,21 +64,21 @@ internal DatadogApiKey(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.J { return; } - {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)Key;} - {_created = If( json?.PropertyT("created"), out var __jsonCreated) ? (string)__jsonCreated : (string)Created;} + {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)_createdBy;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)_key;} + {_created = If( json?.PropertyT("created"), out var __jsonCreated) ? (string)__jsonCreated : (string)_created;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogApiKey(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKeyListResponse.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKeyListResponse.PowerShell.cs similarity index 76% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKeyListResponse.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKeyListResponse.PowerShell.cs index de0191ee3fd7..bded9b5ef375 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKeyListResponse.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKeyListResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class DatadogApiKeyListResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal DatadogApiKeyListResponse(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogApiKeyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogApiKeyTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,37 +103,37 @@ internal DatadogApiKeyListResponse(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogApiKeyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogApiKeyTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogApiKeyListResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogApiKeyListResponse(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKeyListResponse.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKeyListResponse.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKeyListResponse.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKeyListResponse.TypeConverter.cs index 5b9e7959604c..ce8c155ed600 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKeyListResponse.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKeyListResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKeyListResponse.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKeyListResponse.cs similarity index 72% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKeyListResponse.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKeyListResponse.cs index 00bd3ebeef02..148f72df248e 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKeyListResponse.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKeyListResponse.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Response of a list operation. public partial class DatadogApiKeyListResponse : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponse, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponse, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponseInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class DatadogApiKeyListResponse : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey[] _value; + private System.Collections.Generic.List _value; /// Results of a list operation. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public DatadogApiKeyListResponse() @@ -41,6 +41,9 @@ public partial interface IDatadogApiKeyListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the next set of results, if any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IDatadogApiKeyListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Results of a list operation.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey) })] + System.Collections.Generic.List Value { get; set; } } /// Response of a list operation. @@ -62,7 +68,7 @@ internal partial interface IDatadogApiKeyListResponseInternal /// Link to the next set of results, if any. string NextLink { get; set; } /// Results of a list operation. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKeyListResponse.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKeyListResponse.json.cs similarity index 90% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKeyListResponse.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKeyListResponse.json.cs index dcec2246fc91..3e9e6f929241 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogApiKeyListResponse.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogApiKeyListResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -65,19 +65,19 @@ internal DatadogApiKeyListResponse(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Ru { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogApiKey.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogApiKey.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogApiKeyListResponse(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHost.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHost.PowerShell.cs similarity index 58% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHost.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHost.PowerShell.cs index 610c304d424c..dc4c1765f2ab 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHost.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHost.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -62,7 +62,7 @@ public partial class DatadogHost partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -77,53 +77,53 @@ internal DatadogHost(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Meta")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).Meta = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata) content.GetValueForProperty("Meta",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).Meta, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHostMetadataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).Meta = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata) content.GetValueForProperty("Meta",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).Meta, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHostMetadataTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Alias")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).Alias = (string[]) content.GetValueForProperty("Alias",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).Alias, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).Alias = (System.Collections.Generic.List) content.GetValueForProperty("Alias",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).Alias, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("App")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).App = (string[]) content.GetValueForProperty("App",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).App, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).App = (System.Collections.Generic.List) content.GetValueForProperty("App",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).App, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("MetaInstallMethod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).MetaInstallMethod = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod) content.GetValueForProperty("MetaInstallMethod",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).MetaInstallMethod, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogInstallMethodTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).MetaInstallMethod = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod) content.GetValueForProperty("MetaInstallMethod",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).MetaInstallMethod, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogInstallMethodTypeConverter.ConvertFrom); } if (content.Contains("MetaLogsAgent")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).MetaLogsAgent = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent) content.GetValueForProperty("MetaLogsAgent",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).MetaLogsAgent, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogLogsAgentTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).MetaLogsAgent = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent) content.GetValueForProperty("MetaLogsAgent",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).MetaLogsAgent, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogLogsAgentTypeConverter.ConvertFrom); } if (content.Contains("MetaAgentVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).MetaAgentVersion = (string) content.GetValueForProperty("MetaAgentVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).MetaAgentVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).MetaAgentVersion = (string) content.GetValueForProperty("MetaAgentVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).MetaAgentVersion, global::System.Convert.ToString); } if (content.Contains("InstallMethodTool")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).InstallMethodTool = (string) content.GetValueForProperty("InstallMethodTool",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).InstallMethodTool, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).InstallMethodTool = (string) content.GetValueForProperty("InstallMethodTool",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).InstallMethodTool, global::System.Convert.ToString); } if (content.Contains("InstallMethodToolVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).InstallMethodToolVersion = (string) content.GetValueForProperty("InstallMethodToolVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).InstallMethodToolVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).InstallMethodToolVersion = (string) content.GetValueForProperty("InstallMethodToolVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).InstallMethodToolVersion, global::System.Convert.ToString); } if (content.Contains("InstallMethodInstallerVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).InstallMethodInstallerVersion = (string) content.GetValueForProperty("InstallMethodInstallerVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).InstallMethodInstallerVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).InstallMethodInstallerVersion = (string) content.GetValueForProperty("InstallMethodInstallerVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).InstallMethodInstallerVersion, global::System.Convert.ToString); } if (content.Contains("LogAgentTransport")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).LogAgentTransport = (string) content.GetValueForProperty("LogAgentTransport",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).LogAgentTransport, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).LogAgentTransport = (string) content.GetValueForProperty("LogAgentTransport",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).LogAgentTransport, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -138,73 +138,73 @@ internal DatadogHost(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Meta")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).Meta = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata) content.GetValueForProperty("Meta",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).Meta, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHostMetadataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).Meta = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata) content.GetValueForProperty("Meta",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).Meta, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHostMetadataTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Alias")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).Alias = (string[]) content.GetValueForProperty("Alias",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).Alias, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).Alias = (System.Collections.Generic.List) content.GetValueForProperty("Alias",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).Alias, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("App")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).App = (string[]) content.GetValueForProperty("App",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).App, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).App = (System.Collections.Generic.List) content.GetValueForProperty("App",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).App, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("MetaInstallMethod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).MetaInstallMethod = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod) content.GetValueForProperty("MetaInstallMethod",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).MetaInstallMethod, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogInstallMethodTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).MetaInstallMethod = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod) content.GetValueForProperty("MetaInstallMethod",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).MetaInstallMethod, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogInstallMethodTypeConverter.ConvertFrom); } if (content.Contains("MetaLogsAgent")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).MetaLogsAgent = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent) content.GetValueForProperty("MetaLogsAgent",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).MetaLogsAgent, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogLogsAgentTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).MetaLogsAgent = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent) content.GetValueForProperty("MetaLogsAgent",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).MetaLogsAgent, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogLogsAgentTypeConverter.ConvertFrom); } if (content.Contains("MetaAgentVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).MetaAgentVersion = (string) content.GetValueForProperty("MetaAgentVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).MetaAgentVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).MetaAgentVersion = (string) content.GetValueForProperty("MetaAgentVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).MetaAgentVersion, global::System.Convert.ToString); } if (content.Contains("InstallMethodTool")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).InstallMethodTool = (string) content.GetValueForProperty("InstallMethodTool",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).InstallMethodTool, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).InstallMethodTool = (string) content.GetValueForProperty("InstallMethodTool",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).InstallMethodTool, global::System.Convert.ToString); } if (content.Contains("InstallMethodToolVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).InstallMethodToolVersion = (string) content.GetValueForProperty("InstallMethodToolVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).InstallMethodToolVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).InstallMethodToolVersion = (string) content.GetValueForProperty("InstallMethodToolVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).InstallMethodToolVersion, global::System.Convert.ToString); } if (content.Contains("InstallMethodInstallerVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).InstallMethodInstallerVersion = (string) content.GetValueForProperty("InstallMethodInstallerVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).InstallMethodInstallerVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).InstallMethodInstallerVersion = (string) content.GetValueForProperty("InstallMethodInstallerVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).InstallMethodInstallerVersion, global::System.Convert.ToString); } if (content.Contains("LogAgentTransport")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).LogAgentTransport = (string) content.GetValueForProperty("LogAgentTransport",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal)this).LogAgentTransport, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).LogAgentTransport = (string) content.GetValueForProperty("LogAgentTransport",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal)this).LogAgentTransport, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogHost(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogHost(content); } @@ -214,7 +214,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHost.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHost.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHost.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHost.TypeConverter.cs index 848f0d0555d7..d81333ad1d24 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHost.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHost.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHost.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHost.cs similarity index 62% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHost.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHost.cs index f5e585064051..3dd82fb00856 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHost.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHost.cs @@ -3,63 +3,63 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; public partial class DatadogHost : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal { /// Backing field for property. - private string[] _alias; + private System.Collections.Generic.List _alias; /// The aliases for the host. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public string[] Alias { get => this._alias; set => this._alias = value; } + public System.Collections.Generic.List Alias { get => this._alias; set => this._alias = value; } /// Backing field for property. - private string[] _app; + private System.Collections.Generic.List _app; /// The Datadog integrations reporting metrics for the host. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public string[] App { get => this._app; set => this._app = value; } + public System.Collections.Generic.List App { get => this._app; set => this._app = value; } /// The installer version. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string InstallMethodInstallerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)Meta).InstallMethodInstallerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)Meta).InstallMethodInstallerVersion = value ?? null; } + public string InstallMethodInstallerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)Meta).InstallMethodInstallerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)Meta).InstallMethodInstallerVersion = value ?? null; } /// The tool. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string InstallMethodTool { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)Meta).InstallMethodTool; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)Meta).InstallMethodTool = value ?? null; } + public string InstallMethodTool { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)Meta).InstallMethodTool; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)Meta).InstallMethodTool = value ?? null; } /// The tool version. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string InstallMethodToolVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)Meta).InstallMethodToolVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)Meta).InstallMethodToolVersion = value ?? null; } + public string InstallMethodToolVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)Meta).InstallMethodToolVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)Meta).InstallMethodToolVersion = value ?? null; } /// The transport. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string LogAgentTransport { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)Meta).LogAgentTransport; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)Meta).LogAgentTransport = value ?? null; } + public string LogAgentTransport { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)Meta).LogAgentTransport; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)Meta).LogAgentTransport = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata _meta; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata _meta; [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata Meta { get => (this._meta = this._meta ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHostMetadata()); set => this._meta = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata Meta { get => (this._meta = this._meta ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHostMetadata()); set => this._meta = value; } /// The agent version. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string MetaAgentVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)Meta).AgentVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)Meta).AgentVersion = value ?? null; } + public string MetaAgentVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)Meta).AgentVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)Meta).AgentVersion = value ?? null; } /// Internal Acessors for Meta - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal.Meta { get => (this._meta = this._meta ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHostMetadata()); set { {_meta = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal.Meta { get => (this._meta = this._meta ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHostMetadata()); set { {_meta = value;} } } /// Internal Acessors for MetaInstallMethod - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal.MetaInstallMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)Meta).InstallMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)Meta).InstallMethod = value; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal.MetaInstallMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)Meta).InstallMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)Meta).InstallMethod = value; } /// Internal Acessors for MetaLogsAgent - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostInternal.MetaLogsAgent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)Meta).LogsAgent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)Meta).LogsAgent = value; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostInternal.MetaLogsAgent { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)Meta).LogsAgent; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)Meta).LogsAgent = value; } /// Backing field for property. private string _name; @@ -81,22 +81,31 @@ public partial interface IDatadogHost : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The aliases for the host.", SerializedName = @"aliases", PossibleTypes = new [] { typeof(string) })] - string[] Alias { get; set; } + System.Collections.Generic.List Alias { get; set; } /// The Datadog integrations reporting metrics for the host. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Datadog integrations reporting metrics for the host.", SerializedName = @"apps", PossibleTypes = new [] { typeof(string) })] - string[] App { get; set; } + System.Collections.Generic.List App { get; set; } /// The installer version. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The installer version.", SerializedName = @"installerVersion", PossibleTypes = new [] { typeof(string) })] @@ -105,6 +114,9 @@ public partial interface IDatadogHost : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tool.", SerializedName = @"tool", PossibleTypes = new [] { typeof(string) })] @@ -113,6 +125,9 @@ public partial interface IDatadogHost : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tool version.", SerializedName = @"toolVersion", PossibleTypes = new [] { typeof(string) })] @@ -121,6 +136,9 @@ public partial interface IDatadogHost : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The transport.", SerializedName = @"transport", PossibleTypes = new [] { typeof(string) })] @@ -129,6 +147,9 @@ public partial interface IDatadogHost : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The agent version.", SerializedName = @"agentVersion", PossibleTypes = new [] { typeof(string) })] @@ -137,6 +158,9 @@ public partial interface IDatadogHost : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the host.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -147,9 +171,9 @@ internal partial interface IDatadogHostInternal { /// The aliases for the host. - string[] Alias { get; set; } + System.Collections.Generic.List Alias { get; set; } /// The Datadog integrations reporting metrics for the host. - string[] App { get; set; } + System.Collections.Generic.List App { get; set; } /// The installer version. string InstallMethodInstallerVersion { get; set; } /// The tool. @@ -159,13 +183,13 @@ internal partial interface IDatadogHostInternal /// The transport. string LogAgentTransport { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata Meta { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata Meta { get; set; } /// The agent version. string MetaAgentVersion { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod MetaInstallMethod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod MetaInstallMethod { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent MetaLogsAgent { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent MetaLogsAgent { get; set; } /// The name of the host. string Name { get; set; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHost.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHost.json.cs similarity index 88% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHost.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHost.json.cs index 75287cfb17d7..844d8ff99333 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHost.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHost.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -64,21 +64,19 @@ internal DatadogHost(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.Jso { return; } - {_meta = If( json?.PropertyT("meta"), out var __jsonMeta) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHostMetadata.FromJson(__jsonMeta) : Meta;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_alias = If( json?.PropertyT("aliases"), out var __jsonAliases) ? If( __jsonAliases as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Alias;} - {_app = If( json?.PropertyT("apps"), out var __jsonApps) ? If( __jsonApps as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : App;} + {_meta = If( json?.PropertyT("meta"), out var __jsonMeta) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHostMetadata.FromJson(__jsonMeta) : _meta;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_alias = If( json?.PropertyT("aliases"), out var __jsonAliases) ? If( __jsonAliases as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _alias;} + {_app = If( json?.PropertyT("apps"), out var __jsonApps) ? If( __jsonApps as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _app;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost. + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogHost(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostListResponse.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostListResponse.PowerShell.cs similarity index 76% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostListResponse.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostListResponse.PowerShell.cs index e0fd80c9e180..616c2a359c40 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostListResponse.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostListResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class DatadogHostListResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal DatadogHostListResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHostTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHostTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,37 +103,37 @@ internal DatadogHostListResponse(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHostTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHostTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogHostListResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogHostListResponse(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostListResponse.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostListResponse.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostListResponse.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostListResponse.TypeConverter.cs index b1e837013d3a..2656ee6b864d 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostListResponse.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostListResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostListResponse.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostListResponse.cs similarity index 72% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostListResponse.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostListResponse.cs index 5b55a79823c9..0e11db128aff 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostListResponse.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostListResponse.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Response of a list operation. public partial class DatadogHostListResponse : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponse, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponse, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponseInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class DatadogHostListResponse : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost[] _value; + private System.Collections.Generic.List _value; /// Results of a list operation. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public DatadogHostListResponse() @@ -41,6 +41,9 @@ public partial interface IDatadogHostListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the next set of results, if any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IDatadogHostListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Results of a list operation.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost) })] + System.Collections.Generic.List Value { get; set; } } /// Response of a list operation. @@ -62,7 +68,7 @@ internal partial interface IDatadogHostListResponseInternal /// Link to the next set of results, if any. string NextLink { get; set; } /// Results of a list operation. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostListResponse.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostListResponse.json.cs similarity index 90% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostListResponse.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostListResponse.json.cs index 0358ef6054c8..5894c8689792 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostListResponse.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostListResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -65,19 +65,19 @@ internal DatadogHostListResponse(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runt { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogHost.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogHost.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogHostListResponse(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostMetadata.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostMetadata.PowerShell.cs similarity index 63% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostMetadata.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostMetadata.PowerShell.cs index 2576b1e3286d..38452b49bcb1 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostMetadata.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostMetadata.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -62,7 +62,7 @@ public partial class DatadogHostMetadata partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -77,37 +77,37 @@ internal DatadogHostMetadata(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("InstallMethod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethod = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod) content.GetValueForProperty("InstallMethod",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethod, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogInstallMethodTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethod = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod) content.GetValueForProperty("InstallMethod",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethod, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogInstallMethodTypeConverter.ConvertFrom); } if (content.Contains("LogsAgent")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).LogsAgent = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent) content.GetValueForProperty("LogsAgent",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).LogsAgent, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogLogsAgentTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).LogsAgent = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent) content.GetValueForProperty("LogsAgent",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).LogsAgent, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogLogsAgentTypeConverter.ConvertFrom); } if (content.Contains("AgentVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).AgentVersion = (string) content.GetValueForProperty("AgentVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).AgentVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).AgentVersion = (string) content.GetValueForProperty("AgentVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).AgentVersion, global::System.Convert.ToString); } if (content.Contains("InstallMethodTool")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethodTool = (string) content.GetValueForProperty("InstallMethodTool",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethodTool, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethodTool = (string) content.GetValueForProperty("InstallMethodTool",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethodTool, global::System.Convert.ToString); } if (content.Contains("InstallMethodToolVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethodToolVersion = (string) content.GetValueForProperty("InstallMethodToolVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethodToolVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethodToolVersion = (string) content.GetValueForProperty("InstallMethodToolVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethodToolVersion, global::System.Convert.ToString); } if (content.Contains("InstallMethodInstallerVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethodInstallerVersion = (string) content.GetValueForProperty("InstallMethodInstallerVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethodInstallerVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethodInstallerVersion = (string) content.GetValueForProperty("InstallMethodInstallerVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethodInstallerVersion, global::System.Convert.ToString); } if (content.Contains("LogAgentTransport")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).LogAgentTransport = (string) content.GetValueForProperty("LogAgentTransport",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).LogAgentTransport, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).LogAgentTransport = (string) content.GetValueForProperty("LogAgentTransport",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).LogAgentTransport, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -122,57 +122,57 @@ internal DatadogHostMetadata(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("InstallMethod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethod = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod) content.GetValueForProperty("InstallMethod",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethod, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogInstallMethodTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethod = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod) content.GetValueForProperty("InstallMethod",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethod, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogInstallMethodTypeConverter.ConvertFrom); } if (content.Contains("LogsAgent")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).LogsAgent = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent) content.GetValueForProperty("LogsAgent",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).LogsAgent, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogLogsAgentTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).LogsAgent = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent) content.GetValueForProperty("LogsAgent",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).LogsAgent, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogLogsAgentTypeConverter.ConvertFrom); } if (content.Contains("AgentVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).AgentVersion = (string) content.GetValueForProperty("AgentVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).AgentVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).AgentVersion = (string) content.GetValueForProperty("AgentVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).AgentVersion, global::System.Convert.ToString); } if (content.Contains("InstallMethodTool")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethodTool = (string) content.GetValueForProperty("InstallMethodTool",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethodTool, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethodTool = (string) content.GetValueForProperty("InstallMethodTool",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethodTool, global::System.Convert.ToString); } if (content.Contains("InstallMethodToolVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethodToolVersion = (string) content.GetValueForProperty("InstallMethodToolVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethodToolVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethodToolVersion = (string) content.GetValueForProperty("InstallMethodToolVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethodToolVersion, global::System.Convert.ToString); } if (content.Contains("InstallMethodInstallerVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethodInstallerVersion = (string) content.GetValueForProperty("InstallMethodInstallerVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).InstallMethodInstallerVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethodInstallerVersion = (string) content.GetValueForProperty("InstallMethodInstallerVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).InstallMethodInstallerVersion, global::System.Convert.ToString); } if (content.Contains("LogAgentTransport")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).LogAgentTransport = (string) content.GetValueForProperty("LogAgentTransport",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal)this).LogAgentTransport, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).LogAgentTransport = (string) content.GetValueForProperty("LogAgentTransport",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal)this).LogAgentTransport, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogHostMetadata(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogHostMetadata(content); } @@ -182,7 +182,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostMetadata.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostMetadata.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostMetadata.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostMetadata.TypeConverter.cs index 6c9d3cf475b0..172b2015af7c 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostMetadata.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostMetadata.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostMetadata.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostMetadata.cs similarity index 65% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostMetadata.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostMetadata.cs index 54e84c017e4e..cdc2f0f71734 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostMetadata.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostMetadata.cs @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; public partial class DatadogHostMetadata : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal { /// Backing field for property. @@ -20,38 +20,38 @@ public partial class DatadogHostMetadata : public string AgentVersion { get => this._agentVersion; set => this._agentVersion = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod _installMethod; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod _installMethod; [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod InstallMethod { get => (this._installMethod = this._installMethod ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogInstallMethod()); set => this._installMethod = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod InstallMethod { get => (this._installMethod = this._installMethod ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogInstallMethod()); set => this._installMethod = value; } /// The installer version. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string InstallMethodInstallerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)InstallMethod).InstallerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)InstallMethod).InstallerVersion = value ?? null; } + public string InstallMethodInstallerVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)InstallMethod).InstallerVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)InstallMethod).InstallerVersion = value ?? null; } /// The tool. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string InstallMethodTool { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)InstallMethod).Tool; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)InstallMethod).Tool = value ?? null; } + public string InstallMethodTool { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)InstallMethod).Tool; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)InstallMethod).Tool = value ?? null; } /// The tool version. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string InstallMethodToolVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)InstallMethod).ToolVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)InstallMethod).ToolVersion = value ?? null; } + public string InstallMethodToolVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)InstallMethod).ToolVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)InstallMethod).ToolVersion = value ?? null; } /// The transport. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string LogAgentTransport { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgentInternal)LogsAgent).Transport; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgentInternal)LogsAgent).Transport = value ?? null; } + public string LogAgentTransport { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgentInternal)LogsAgent).Transport; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgentInternal)LogsAgent).Transport = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent _logsAgent; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent _logsAgent; [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent LogsAgent { get => (this._logsAgent = this._logsAgent ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogLogsAgent()); set => this._logsAgent = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent LogsAgent { get => (this._logsAgent = this._logsAgent ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogLogsAgent()); set => this._logsAgent = value; } /// Internal Acessors for InstallMethod - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal.InstallMethod { get => (this._installMethod = this._installMethod ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogInstallMethod()); set { {_installMethod = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal.InstallMethod { get => (this._installMethod = this._installMethod ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogInstallMethod()); set { {_installMethod = value;} } } /// Internal Acessors for LogsAgent - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadataInternal.LogsAgent { get => (this._logsAgent = this._logsAgent ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogLogsAgent()); set { {_logsAgent = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadataInternal.LogsAgent { get => (this._logsAgent = this._logsAgent ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogLogsAgent()); set { {_logsAgent = value;} } } /// Creates an new instance. public DatadogHostMetadata() @@ -66,6 +66,9 @@ public partial interface IDatadogHostMetadata : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The agent version.", SerializedName = @"agentVersion", PossibleTypes = new [] { typeof(string) })] @@ -74,6 +77,9 @@ public partial interface IDatadogHostMetadata : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The installer version.", SerializedName = @"installerVersion", PossibleTypes = new [] { typeof(string) })] @@ -82,6 +88,9 @@ public partial interface IDatadogHostMetadata : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tool.", SerializedName = @"tool", PossibleTypes = new [] { typeof(string) })] @@ -90,6 +99,9 @@ public partial interface IDatadogHostMetadata : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tool version.", SerializedName = @"toolVersion", PossibleTypes = new [] { typeof(string) })] @@ -98,6 +110,9 @@ public partial interface IDatadogHostMetadata : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The transport.", SerializedName = @"transport", PossibleTypes = new [] { typeof(string) })] @@ -110,7 +125,7 @@ internal partial interface IDatadogHostMetadataInternal /// The agent version. string AgentVersion { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod InstallMethod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod InstallMethod { get; set; } /// The installer version. string InstallMethodInstallerVersion { get; set; } /// The tool. @@ -120,7 +135,7 @@ internal partial interface IDatadogHostMetadataInternal /// The transport. string LogAgentTransport { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent LogsAgent { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent LogsAgent { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostMetadata.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostMetadata.json.cs similarity index 93% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostMetadata.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostMetadata.json.cs index e63d9dba762d..fb72e6bb30e2 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogHostMetadata.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogHostMetadata.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -64,20 +64,20 @@ internal DatadogHostMetadata(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime. { return; } - {_installMethod = If( json?.PropertyT("installMethod"), out var __jsonInstallMethod) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogInstallMethod.FromJson(__jsonInstallMethod) : InstallMethod;} - {_logsAgent = If( json?.PropertyT("logsAgent"), out var __jsonLogsAgent) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogLogsAgent.FromJson(__jsonLogsAgent) : LogsAgent;} - {_agentVersion = If( json?.PropertyT("agentVersion"), out var __jsonAgentVersion) ? (string)__jsonAgentVersion : (string)AgentVersion;} + {_installMethod = If( json?.PropertyT("installMethod"), out var __jsonInstallMethod) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogInstallMethod.FromJson(__jsonInstallMethod) : _installMethod;} + {_logsAgent = If( json?.PropertyT("logsAgent"), out var __jsonLogsAgent) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogLogsAgent.FromJson(__jsonLogsAgent) : _logsAgent;} + {_agentVersion = If( json?.PropertyT("agentVersion"), out var __jsonAgentVersion) ? (string)__jsonAgentVersion : (string)_agentVersion;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostMetadata FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostMetadata FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogHostMetadata(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogIdentity.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogIdentity.cs index e49aa03e9e9a..7951c7e7cb24 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogIdentity.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogIdentity.cs @@ -67,6 +67,9 @@ public partial interface IDatadogIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Configuration name", SerializedName = @"configurationName", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +78,9 @@ public partial interface IDatadogIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IDatadogIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Monitor resource name", SerializedName = @"monitorName", PossibleTypes = new [] { typeof(string) })] @@ -91,6 +100,9 @@ public partial interface IDatadogIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the resource group. The name is case insensitive.", SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +111,9 @@ public partial interface IDatadogIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Rule set name", SerializedName = @"ruleSetName", PossibleTypes = new [] { typeof(string) })] @@ -107,6 +122,9 @@ public partial interface IDatadogIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ID of the target subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogIdentity.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogIdentity.json.cs index a411d1dbe2ab..63d385e748e1 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogIdentity.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogIdentity.json.cs @@ -64,12 +64,12 @@ internal DatadogIdentity(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json { return; } - {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} - {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} - {_monitorName = If( json?.PropertyT("monitorName"), out var __jsonMonitorName) ? (string)__jsonMonitorName : (string)MonitorName;} - {_ruleSetName = If( json?.PropertyT("ruleSetName"), out var __jsonRuleSetName) ? (string)__jsonRuleSetName : (string)RuleSetName;} - {_configurationName = If( json?.PropertyT("configurationName"), out var __jsonConfigurationName) ? (string)__jsonConfigurationName : (string)ConfigurationName;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)_resourceGroupName;} + {_monitorName = If( json?.PropertyT("monitorName"), out var __jsonMonitorName) ? (string)__jsonMonitorName : (string)_monitorName;} + {_ruleSetName = If( json?.PropertyT("ruleSetName"), out var __jsonRuleSetName) ? (string)__jsonRuleSetName : (string)_ruleSetName;} + {_configurationName = If( json?.PropertyT("configurationName"), out var __jsonConfigurationName) ? (string)__jsonConfigurationName : (string)_configurationName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogInstallMethod.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogInstallMethod.PowerShell.cs similarity index 77% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogInstallMethod.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogInstallMethod.PowerShell.cs index c30cdc64e0c4..a37ac1fad0a6 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogInstallMethod.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogInstallMethod.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -62,7 +62,7 @@ public partial class DatadogInstallMethod partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -77,21 +77,21 @@ internal DatadogInstallMethod(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tool")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)this).Tool = (string) content.GetValueForProperty("Tool",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)this).Tool, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)this).Tool = (string) content.GetValueForProperty("Tool",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)this).Tool, global::System.Convert.ToString); } if (content.Contains("ToolVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)this).ToolVersion = (string) content.GetValueForProperty("ToolVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)this).ToolVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)this).ToolVersion = (string) content.GetValueForProperty("ToolVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)this).ToolVersion, global::System.Convert.ToString); } if (content.Contains("InstallerVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)this).InstallerVersion = (string) content.GetValueForProperty("InstallerVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)this).InstallerVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)this).InstallerVersion = (string) content.GetValueForProperty("InstallerVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)this).InstallerVersion, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -106,41 +106,41 @@ internal DatadogInstallMethod(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("Tool")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)this).Tool = (string) content.GetValueForProperty("Tool",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)this).Tool, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)this).Tool = (string) content.GetValueForProperty("Tool",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)this).Tool, global::System.Convert.ToString); } if (content.Contains("ToolVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)this).ToolVersion = (string) content.GetValueForProperty("ToolVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)this).ToolVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)this).ToolVersion = (string) content.GetValueForProperty("ToolVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)this).ToolVersion, global::System.Convert.ToString); } if (content.Contains("InstallerVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)this).InstallerVersion = (string) content.GetValueForProperty("InstallerVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal)this).InstallerVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)this).InstallerVersion = (string) content.GetValueForProperty("InstallerVersion",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal)this).InstallerVersion, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogInstallMethod(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogInstallMethod(content); } @@ -150,7 +150,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogInstallMethod.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogInstallMethod.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogInstallMethod.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogInstallMethod.TypeConverter.cs index 33ee98c2d2ea..579bb17ef4dc 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogInstallMethod.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogInstallMethod.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogInstallMethod.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogInstallMethod.cs similarity index 88% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogInstallMethod.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogInstallMethod.cs index 40ef29f93638..02cdd777a8a0 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogInstallMethod.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogInstallMethod.cs @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; public partial class DatadogInstallMethod : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethodInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethodInternal { /// Backing field for property. @@ -46,6 +46,9 @@ public partial interface IDatadogInstallMethod : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The installer version.", SerializedName = @"installerVersion", PossibleTypes = new [] { typeof(string) })] @@ -54,6 +57,9 @@ public partial interface IDatadogInstallMethod : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tool.", SerializedName = @"tool", PossibleTypes = new [] { typeof(string) })] @@ -62,6 +68,9 @@ public partial interface IDatadogInstallMethod : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tool version.", SerializedName = @"toolVersion", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogInstallMethod.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogInstallMethod.json.cs similarity index 94% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogInstallMethod.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogInstallMethod.json.cs index e217c68cd4bc..d81bd0fa0605 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogInstallMethod.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogInstallMethod.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -64,20 +64,20 @@ internal DatadogInstallMethod(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime { return; } - {_tool = If( json?.PropertyT("tool"), out var __jsonTool) ? (string)__jsonTool : (string)Tool;} - {_toolVersion = If( json?.PropertyT("toolVersion"), out var __jsonToolVersion) ? (string)__jsonToolVersion : (string)ToolVersion;} - {_installerVersion = If( json?.PropertyT("installerVersion"), out var __jsonInstallerVersion) ? (string)__jsonInstallerVersion : (string)InstallerVersion;} + {_tool = If( json?.PropertyT("tool"), out var __jsonTool) ? (string)__jsonTool : (string)_tool;} + {_toolVersion = If( json?.PropertyT("toolVersion"), out var __jsonToolVersion) ? (string)__jsonToolVersion : (string)_toolVersion;} + {_installerVersion = If( json?.PropertyT("installerVersion"), out var __jsonInstallerVersion) ? (string)__jsonInstallerVersion : (string)_installerVersion;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogInstallMethod FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogInstallMethod FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogInstallMethod(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogLogsAgent.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogLogsAgent.PowerShell.cs similarity index 85% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogLogsAgent.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogLogsAgent.PowerShell.cs index 5499a3660c39..bdfec4ffd905 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogLogsAgent.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogLogsAgent.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -62,7 +62,7 @@ public partial class DatadogLogsAgent partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -77,13 +77,13 @@ internal DatadogLogsAgent(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Transport")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgentInternal)this).Transport = (string) content.GetValueForProperty("Transport",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgentInternal)this).Transport, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgentInternal)this).Transport = (string) content.GetValueForProperty("Transport",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgentInternal)this).Transport, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -98,33 +98,33 @@ internal DatadogLogsAgent(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Transport")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgentInternal)this).Transport = (string) content.GetValueForProperty("Transport",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgentInternal)this).Transport, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgentInternal)this).Transport = (string) content.GetValueForProperty("Transport",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgentInternal)this).Transport, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogLogsAgent(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogLogsAgent(content); } @@ -134,7 +134,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogLogsAgent.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogLogsAgent.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogLogsAgent.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogLogsAgent.TypeConverter.cs index 7d6692ca66f7..ba0d291a52c8 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogLogsAgent.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogLogsAgent.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogLogsAgent.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogLogsAgent.cs similarity index 84% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogLogsAgent.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogLogsAgent.cs index f0093515ef11..95a335003a8a 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogLogsAgent.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogLogsAgent.cs @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; public partial class DatadogLogsAgent : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgentInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgentInternal { /// Backing field for property. @@ -32,6 +32,9 @@ public partial interface IDatadogLogsAgent : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The transport.", SerializedName = @"transport", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogLogsAgent.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogLogsAgent.json.cs similarity index 94% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogLogsAgent.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogLogsAgent.json.cs index 9fabd8766af1..ca9c42094ebd 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogLogsAgent.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogLogsAgent.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -64,18 +64,18 @@ internal DatadogLogsAgent(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Jso { return; } - {_transport = If( json?.PropertyT("transport"), out var __jsonTransport) ? (string)__jsonTransport : (string)Transport;} + {_transport = If( json?.PropertyT("transport"), out var __jsonTransport) ? (string)__jsonTransport : (string)_transport;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogLogsAgent FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogLogsAgent FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogLogsAgent(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResource.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResource.PowerShell.cs new file mode 100644 index 000000000000..0b17b7db0a44 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResource.PowerShell.cs @@ -0,0 +1,450 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(DatadogMonitorResourceTypeConverter))] + public partial class DatadogMonitorResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DatadogMonitorResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ResourceSkuTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitorPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IdentityPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("UserInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfo = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo) content.GetValueForProperty("UserInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfo, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.UserInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).MonitoringStatus = (string) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).MonitoringStatus, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationProperty = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties) content.GetValueForProperty("DatadogOrganizationProperty",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationProperty, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogOrganizationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("MarketplaceSubscriptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).MarketplaceSubscriptionStatus = (string) content.GetValueForProperty("MarketplaceSubscriptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).MarketplaceSubscriptionStatus, global::System.Convert.ToString); + } + if (content.Contains("LiftrResourceCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).LiftrResourceCategory = (string) content.GetValueForProperty("LiftrResourceCategory",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).LiftrResourceCategory, global::System.Convert.ToString); + } + if (content.Contains("LiftrResourcePreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).LiftrResourcePreference = (int?) content.GetValueForProperty("LiftrResourcePreference",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).LiftrResourcePreference, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DatadogOrganizationPropertyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyName = (string) content.GetValueForProperty("DatadogOrganizationPropertyName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyName, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyId = (string) content.GetValueForProperty("DatadogOrganizationPropertyId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyId, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyRedirectUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyRedirectUri = (string) content.GetValueForProperty("DatadogOrganizationPropertyRedirectUri",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyRedirectUri, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyApiKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApiKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApiKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApiKey, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyApplicationKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApplicationKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApplicationKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApplicationKey, global::System.Convert.ToString); + } + if (content.Contains("UserInfoName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfoName = (string) content.GetValueForProperty("UserInfoName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfoName, global::System.Convert.ToString); + } + if (content.Contains("UserInfoEmailAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfoEmailAddress = (string) content.GetValueForProperty("UserInfoEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfoEmailAddress, global::System.Convert.ToString); + } + if (content.Contains("UserInfoPhoneNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfoPhoneNumber = (string) content.GetValueForProperty("UserInfoPhoneNumber",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfoPhoneNumber, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DatadogOrganizationPropertyLinkingAuthCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingAuthCode = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingAuthCode",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingAuthCode, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyLinkingClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingClientId = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingClientId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingClientId, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyEnterpriseAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyEnterpriseAppId = (string) content.GetValueForProperty("DatadogOrganizationPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyEnterpriseAppId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DatadogMonitorResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ResourceSkuTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitorPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IdentityPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("UserInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfo = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo) content.GetValueForProperty("UserInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfo, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.UserInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).MonitoringStatus = (string) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).MonitoringStatus, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationProperty = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties) content.GetValueForProperty("DatadogOrganizationProperty",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationProperty, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogOrganizationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("MarketplaceSubscriptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).MarketplaceSubscriptionStatus = (string) content.GetValueForProperty("MarketplaceSubscriptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).MarketplaceSubscriptionStatus, global::System.Convert.ToString); + } + if (content.Contains("LiftrResourceCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).LiftrResourceCategory = (string) content.GetValueForProperty("LiftrResourceCategory",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).LiftrResourceCategory, global::System.Convert.ToString); + } + if (content.Contains("LiftrResourcePreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).LiftrResourcePreference = (int?) content.GetValueForProperty("LiftrResourcePreference",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).LiftrResourcePreference, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DatadogOrganizationPropertyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyName = (string) content.GetValueForProperty("DatadogOrganizationPropertyName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyName, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyId = (string) content.GetValueForProperty("DatadogOrganizationPropertyId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyId, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyRedirectUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyRedirectUri = (string) content.GetValueForProperty("DatadogOrganizationPropertyRedirectUri",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyRedirectUri, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyApiKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApiKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApiKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApiKey, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyApplicationKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApplicationKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApplicationKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyApplicationKey, global::System.Convert.ToString); + } + if (content.Contains("UserInfoName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfoName = (string) content.GetValueForProperty("UserInfoName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfoName, global::System.Convert.ToString); + } + if (content.Contains("UserInfoEmailAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfoEmailAddress = (string) content.GetValueForProperty("UserInfoEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfoEmailAddress, global::System.Convert.ToString); + } + if (content.Contains("UserInfoPhoneNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfoPhoneNumber = (string) content.GetValueForProperty("UserInfoPhoneNumber",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).UserInfoPhoneNumber, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DatadogOrganizationPropertyLinkingAuthCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingAuthCode = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingAuthCode",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingAuthCode, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyLinkingClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingClientId = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingClientId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyLinkingClientId, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyEnterpriseAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyEnterpriseAppId = (string) content.GetValueForProperty("DatadogOrganizationPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal)this).DatadogOrganizationPropertyEnterpriseAppId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DatadogMonitorResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DatadogMonitorResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + [System.ComponentModel.TypeConverter(typeof(DatadogMonitorResourceTypeConverter))] + public partial interface IDatadogMonitorResource + + { + + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResource.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResource.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResource.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResource.TypeConverter.cs index 5afc83220b78..1faf65ad64fd 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResource.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResource.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResource.cs similarity index 57% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResource.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResource.cs index 16d35f7a9bc6..d2f5c07156f8 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResource.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResource.cs @@ -3,48 +3,48 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; public partial class DatadogMonitorResource : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal { /// Api key associated to the Datadog organization. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyApiKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyApiKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyApiKey = value ?? null; } + public string DatadogOrganizationPropertyApiKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyApiKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyApiKey = value ?? null; } /// Application key associated to the Datadog organization. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyApplicationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyApplicationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyApplicationKey = value ?? null; } + public string DatadogOrganizationPropertyApplicationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyApplicationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyApplicationKey = value ?? null; } /// The Id of the Enterprise App used for Single sign on. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyEnterpriseAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyEnterpriseAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyEnterpriseAppId = value ?? null; } + public string DatadogOrganizationPropertyEnterpriseAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyEnterpriseAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyEnterpriseAppId = value ?? null; } /// Id of the Datadog organization. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyId; } + public string DatadogOrganizationPropertyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyId; } /// The auth code used to linking to an existing datadog organization. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyLinkingAuthCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyLinkingAuthCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyLinkingAuthCode = value ?? null; } + public string DatadogOrganizationPropertyLinkingAuthCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyLinkingAuthCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyLinkingAuthCode = value ?? null; } /// /// The client_id from an existing in exchange for an auth token to link organization. /// [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyLinkingClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyLinkingClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyLinkingClientId = value ?? null; } + public string DatadogOrganizationPropertyLinkingClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyLinkingClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyLinkingClientId = value ?? null; } /// Name of the Datadog organization. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyName; } + public string DatadogOrganizationPropertyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyName; } /// The redirect uri for linking. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyRedirectUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyRedirectUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyRedirectUri = value ?? null; } + public string DatadogOrganizationPropertyRedirectUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyRedirectUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyRedirectUri = value ?? null; } /// Backing field for property. private string _id; @@ -54,29 +54,29 @@ public partial class DatadogMonitorResource : public string Id { get => this._id; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties _identity; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties _identity; [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IdentityProperties()); set => this._identity = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IdentityProperties()); set => this._identity = value; } /// The identity ID. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)Identity).PrincipalId; } + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)Identity).PrincipalId; } /// The tenant ID of resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)Identity).TenantId; } + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)Identity).TenantId; } /// Identity type [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes)""); } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)Identity).Type = value ?? null; } [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories? LiftrResourceCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).LiftrResourceCategory; } + public string LiftrResourceCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).LiftrResourceCategory; } /// The priority of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public int? LiftrResourcePreference { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).LiftrResourcePreference; } + public int? LiftrResourcePreference { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).LiftrResourcePreference; } /// Backing field for property. private string _location; @@ -89,62 +89,80 @@ public partial class DatadogMonitorResource : /// go in Suspended state. /// [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).MarketplaceSubscriptionStatus; } + public string MarketplaceSubscriptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).MarketplaceSubscriptionStatus; } /// Internal Acessors for DatadogOrganizationProperty - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.DatadogOrganizationProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.DatadogOrganizationProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationProperty = value; } /// Internal Acessors for DatadogOrganizationPropertyId - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.DatadogOrganizationPropertyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.DatadogOrganizationPropertyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyId = value; } /// Internal Acessors for DatadogOrganizationPropertyName - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.DatadogOrganizationPropertyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyName = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.DatadogOrganizationPropertyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).DatadogOrganizationPropertyName = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Identity - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IdentityProperties()); set { {_identity = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IdentityProperties()); set { {_identity = value;} } } /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)Identity).PrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)Identity).PrincipalId = value; } /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)Identity).TenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)Identity).TenantId = value; } /// Internal Acessors for LiftrResourceCategory - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.LiftrResourceCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).LiftrResourceCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).LiftrResourceCategory = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.LiftrResourceCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).LiftrResourceCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).LiftrResourceCategory = value; } /// Internal Acessors for LiftrResourcePreference - int? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.LiftrResourcePreference { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).LiftrResourcePreference; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).LiftrResourcePreference = value; } + int? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.LiftrResourcePreference { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).LiftrResourcePreference; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).LiftrResourcePreference = value; } /// Internal Acessors for MarketplaceSubscriptionStatus - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.MarketplaceSubscriptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).MarketplaceSubscriptionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).MarketplaceSubscriptionStatus = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.MarketplaceSubscriptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).MarketplaceSubscriptionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).MarketplaceSubscriptionStatus = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitorProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitorProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for Sku - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ResourceSku()); set { {_sku = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ResourceSku()); set { {_sku = value;} } } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedAt = value; } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedBy = value; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedByType = value; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedAt = value; } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedBy = value; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedByType = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Internal Acessors for UserInfo - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceInternal.UserInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).UserInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).UserInfo = value; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceInternal.UserInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).UserInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).UserInfo = value; } /// Flag specifying if the resource monitoring is enabled or disabled. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus? MonitoringStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).MonitoringStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).MonitoringStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus)""); } + public string MonitoringStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).MonitoringStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).MonitoringStatus = value ?? null; } /// Backing field for property. private string _name; @@ -154,62 +172,66 @@ public partial class DatadogMonitorResource : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties _property; /// Properties specific to the monitor resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitorProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitorProperties()); set => this._property = value; } [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku _sku; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku _sku; [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ResourceSku()); set => this._sku = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ResourceSku()); set => this._sku = value; } /// Name of the SKU. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSkuInternal)Sku).Name = value ?? null; } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSkuInternal)Sku).Name = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags _tag; /// Dictionary of [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceTags()); set => this._tag = value; } /// Backing field for property. private string _type; @@ -220,15 +242,15 @@ public partial class DatadogMonitorResource : /// Email of the user used by Datadog for contacting them if needed [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string UserInfoEmailAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).UserInfoEmailAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).UserInfoEmailAddress = value ?? null; } + public string UserInfoEmailAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).UserInfoEmailAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).UserInfoEmailAddress = value ?? null; } /// Name of the user [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string UserInfoName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).UserInfoName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).UserInfoName = value ?? null; } + public string UserInfoName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).UserInfoName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).UserInfoName = value ?? null; } /// Phone number of the user used by Datadog for contacting them if needed [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string UserInfoPhoneNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).UserInfoPhoneNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal)Property).UserInfoPhoneNumber = value ?? null; } + public string UserInfoPhoneNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).UserInfoPhoneNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)Property).UserInfoPhoneNumber = value ?? null; } /// Creates an new instance. public DatadogMonitorResource() @@ -243,6 +265,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"Api key associated to the Datadog organization.", SerializedName = @"apiKey", PossibleTypes = new [] { typeof(string) })] @@ -251,6 +276,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"Application key associated to the Datadog organization.", SerializedName = @"applicationKey", PossibleTypes = new [] { typeof(string) })] @@ -259,6 +287,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"The Id of the Enterprise App used for Single sign on.", SerializedName = @"enterpriseAppId", PossibleTypes = new [] { typeof(string) })] @@ -267,6 +298,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the Datadog organization.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -275,6 +309,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"The auth code used to linking to an existing datadog organization.", SerializedName = @"linkingAuthCode", PossibleTypes = new [] { typeof(string) })] @@ -285,6 +322,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"The client_id from an existing in exchange for an auth token to link organization.", SerializedName = @"linkingClientId", PossibleTypes = new [] { typeof(string) })] @@ -293,6 +333,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the Datadog organization.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -301,6 +344,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"The redirect uri for linking.", SerializedName = @"redirectUri", PossibleTypes = new [] { typeof(string) })] @@ -309,6 +355,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"ARM id of the monitor resource.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -317,6 +366,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -325,6 +377,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The tenant ID of resource.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -333,22 +388,33 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Identity type", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes? IdentityType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("SystemAssigned", "UserAssigned")] + string IdentityType { get; set; } [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"", SerializedName = @"liftrResourceCategory", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories? LiftrResourceCategory { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Unknown", "MonitorLogs")] + string LiftrResourceCategory { get; } /// The priority of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The priority of the resource.", SerializedName = @"liftrResourcePreference", PossibleTypes = new [] { typeof(int) })] @@ -357,6 +423,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -368,22 +437,33 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will go in Suspended state.", SerializedName = @"marketplaceSubscriptionStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Provisioning", "Active", "Suspended", "Unsubscribed")] + string MarketplaceSubscriptionStatus { get; } /// Flag specifying if the resource monitoring is enabled or disabled. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag specifying if the resource monitoring is enabled or disabled.", SerializedName = @"monitoringStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus? MonitoringStatus { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string MonitoringStatus { get; set; } /// Name of the monitor resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the monitor resource.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -392,14 +472,21 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; } /// Name of the SKU. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the SKU.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -407,63 +494,89 @@ public partial interface IDatadogMonitorResource : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// Dictionary of [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Dictionary of ", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags Tag { get; set; } /// The type of the monitor resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the monitor resource.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -472,6 +585,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email of the user used by Datadog for contacting them if needed", SerializedName = @"emailAddress", PossibleTypes = new [] { typeof(string) })] @@ -480,6 +596,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the user", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -488,6 +607,9 @@ public partial interface IDatadogMonitorResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Phone number of the user used by Datadog for contacting them if needed", SerializedName = @"phoneNumber", PossibleTypes = new [] { typeof(string) })] @@ -498,7 +620,7 @@ internal partial interface IDatadogMonitorResourceInternal { /// Datadog organization properties - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties DatadogOrganizationProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties DatadogOrganizationProperty { get; set; } /// Api key associated to the Datadog organization. string DatadogOrganizationPropertyApiKey { get; set; } /// Application key associated to the Datadog organization. @@ -520,15 +642,17 @@ internal partial interface IDatadogMonitorResourceInternal /// ARM id of the monitor resource. string Id { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties Identity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties Identity { get; set; } /// The identity ID. string IdentityPrincipalId { get; set; } /// The tenant ID of resource. string IdentityTenantId { get; set; } /// Identity type - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes? IdentityType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("SystemAssigned", "UserAssigned")] + string IdentityType { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories? LiftrResourceCategory { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Unknown", "MonitorLogs")] + string LiftrResourceCategory { get; set; } /// The priority of the resource. int? LiftrResourcePreference { get; set; } @@ -537,39 +661,44 @@ internal partial interface IDatadogMonitorResourceInternal /// Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will /// go in Suspended state. /// - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Provisioning", "Active", "Suspended", "Unsubscribed")] + string MarketplaceSubscriptionStatus { get; set; } /// Flag specifying if the resource monitoring is enabled or disabled. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus? MonitoringStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string MonitoringStatus { get; set; } /// Name of the monitor resource. string Name { get; set; } /// Properties specific to the monitor resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties Property { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku Sku { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku Sku { get; set; } /// Name of the SKU. string SkuName { get; set; } /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// Dictionary of - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags Tag { get; set; } /// The type of the monitor resource. string Type { get; set; } /// User info - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo UserInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo UserInfo { get; set; } /// Email of the user used by Datadog for contacting them if needed string UserInfoEmailAddress { get; set; } /// Name of the user diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResource.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResource.json.cs similarity index 88% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResource.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResource.json.cs index 112d47bd7452..9b068d7a6a79 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResource.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -64,26 +64,26 @@ internal DatadogMonitorResource(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runti { return; } - {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ResourceSku.FromJson(__jsonSku) : Sku;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitorProperties.FromJson(__jsonProperties) : Property;} - {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IdentityProperties.FromJson(__jsonIdentity) : Identity;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceTags.FromJson(__jsonTags) : Tag;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ResourceSku.FromJson(__jsonSku) : _sku;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitorProperties.FromJson(__jsonProperties) : _property;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IdentityProperties.FromJson(__jsonIdentity) : _identity;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceTags.FromJson(__jsonTags) : _tag;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogMonitorResource(json) : null; } @@ -110,19 +110,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode ToJson(M AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceListResponse.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceListResponse.PowerShell.cs similarity index 75% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceListResponse.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceListResponse.PowerShell.cs index 47605a23e3f3..41684f892884 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceListResponse.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceListResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class DatadogMonitorResourceListResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal DatadogMonitorResourceListResponse(global::System.Collections.IDictiona // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,39 +103,37 @@ internal DatadogMonitorResourceListResponse(global::System.Management.Automation // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogMonitorResourceListResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogMonitorResourceListResponse(content); } @@ -147,7 +145,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceListResponse.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceListResponse.TypeConverter.cs similarity index 96% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceListResponse.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceListResponse.TypeConverter.cs index 1df2c998881b..3b991b27f5e8 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceListResponse.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceListResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceListResponse.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceListResponse.cs similarity index 71% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceListResponse.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceListResponse.cs index eb4eccafa21e..c69911f303fb 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceListResponse.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceListResponse.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Response of a list operation. public partial class DatadogMonitorResourceListResponse : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponse, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponseInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class DatadogMonitorResourceListResponse : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource[] _value; + private System.Collections.Generic.List _value; /// Results of a list operation. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public DatadogMonitorResourceListResponse() @@ -41,6 +41,9 @@ public partial interface IDatadogMonitorResourceListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the next set of results, if any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IDatadogMonitorResourceListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Results of a list operation.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource) })] + System.Collections.Generic.List Value { get; set; } } /// Response of a list operation. @@ -62,7 +68,7 @@ internal partial interface IDatadogMonitorResourceListResponseInternal /// Link to the next set of results, if any. string NextLink { get; set; } /// Results of a list operation. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceListResponse.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceListResponse.json.cs similarity index 89% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceListResponse.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceListResponse.json.cs index 3b6b7743453d..a9bc8cfff08b 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceListResponse.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceListResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -65,19 +65,19 @@ internal DatadogMonitorResourceListResponse(Microsoft.Azure.PowerShell.Cmdlets.D { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResource.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResource.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogMonitorResourceListResponse(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.PowerShell.cs similarity index 89% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.PowerShell.cs index 84fd8a9131fb..94e04734285b 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class DatadogMonitorResourceTags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -82,7 +82,7 @@ internal DatadogMonitorResourceTags(global::System.Collections.IDictionary conte } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -101,27 +101,27 @@ internal DatadogMonitorResourceTags(global::System.Management.Automation.PSObjec } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogMonitorResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogMonitorResourceTags(content); } @@ -131,7 +131,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.TypeConverter.cs index b893e3a48af2..c3b18143e61f 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.cs similarity index 79% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.cs index 53fed904ae56..b13a62f526f7 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Dictionary of public partial class DatadogMonitorResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTagsInternal { /// Creates an new instance. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.dictionary.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.dictionary.cs similarity index 95% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.dictionary.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.dictionary.cs index f402cbaf8917..5b0d6cfa44b5 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.dictionary.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.json.cs similarity index 95% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.json.cs index 2feb0d8be179..0ccfa0bfbeb7 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceTags.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceTags.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -71,13 +71,13 @@ internal DatadogMonitorResourceTags(Microsoft.Azure.PowerShell.Cmdlets.Datadog.R } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogMonitorResourceTags(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParameters.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParameters.PowerShell.cs similarity index 64% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParameters.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParameters.PowerShell.cs index fd2c00881232..a5a1303aede6 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParameters.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParameters.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class DatadogMonitorResourceUpdateParameters partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,29 +78,29 @@ internal DatadogMonitorResourceUpdateParameters(global::System.Collections.IDict // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitorUpdatePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitorUpdatePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ResourceSkuTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ResourceSkuTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceUpdateParametersTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceUpdateParametersTagsTypeConverter.ConvertFrom); } if (content.Contains("MonitoringStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus?) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).MonitoringStatus = (string) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).MonitoringStatus, global::System.Convert.ToString); } if (content.Contains("SkuName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).SkuName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).SkuName, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -115,51 +115,49 @@ internal DatadogMonitorResourceUpdateParameters(global::System.Management.Automa // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitorUpdatePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitorUpdatePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ResourceSkuTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ResourceSkuTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceUpdateParametersTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceUpdateParametersTagsTypeConverter.ConvertFrom); } if (content.Contains("MonitoringStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus?) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).MonitoringStatus = (string) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).MonitoringStatus, global::System.Convert.ToString); } if (content.Contains("SkuName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal)this).SkuName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal)this).SkuName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogMonitorResourceUpdateParameters(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogMonitorResourceUpdateParameters(content); } @@ -172,7 +170,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParameters.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParameters.TypeConverter.cs similarity index 96% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParameters.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParameters.TypeConverter.cs index 4e9437c3d70e..fbf651f51604 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParameters.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParameters.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParameters.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParameters.cs similarity index 56% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParameters.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParameters.cs index c034a2d7a99d..e91b13a9f802 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParameters.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParameters.cs @@ -3,51 +3,51 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// The parameters for a PATCH request to a monitor resource. public partial class DatadogMonitorResourceUpdateParameters : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParameters, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal { /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitorUpdateProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitorUpdateProperties()); set { {_property = value;} } } /// Internal Acessors for Sku - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ResourceSku()); set { {_sku = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ResourceSku()); set { {_sku = value;} } } /// Flag specifying if the resource monitoring is enabled or disabled. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus? MonitoringStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdatePropertiesInternal)Property).MonitoringStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdatePropertiesInternal)Property).MonitoringStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus)""); } + public string MonitoringStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdatePropertiesInternal)Property).MonitoringStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdatePropertiesInternal)Property).MonitoringStatus = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties _property; /// /// The set of properties that can be update in a PATCH request to a monitor resource. /// [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitorUpdateProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitorUpdateProperties()); set => this._property = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku _sku; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku _sku; [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ResourceSku()); set => this._sku = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ResourceSku()); set => this._sku = value; } /// Name of the SKU. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSkuInternal)Sku).Name = value ?? null; } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSkuInternal)Sku).Name = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags _tag; /// The new tags of the monitor resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceUpdateParametersTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceUpdateParametersTags()); set => this._tag = value; } /// Creates an new instance. public DatadogMonitorResourceUpdateParameters() @@ -63,14 +63,21 @@ public partial interface IDatadogMonitorResourceUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag specifying if the resource monitoring is enabled or disabled.", SerializedName = @"monitoringStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus? MonitoringStatus { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string MonitoringStatus { get; set; } /// Name of the SKU. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the SKU.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -79,10 +86,13 @@ public partial interface IDatadogMonitorResourceUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The new tags of the monitor resource.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags Tag { get; set; } } /// The parameters for a PATCH request to a monitor resource. @@ -90,17 +100,18 @@ internal partial interface IDatadogMonitorResourceUpdateParametersInternal { /// Flag specifying if the resource monitoring is enabled or disabled. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus? MonitoringStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string MonitoringStatus { get; set; } /// /// The set of properties that can be update in a PATCH request to a monitor resource. /// - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties Property { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku Sku { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku Sku { get; set; } /// Name of the SKU. string SkuName { get; set; } /// The new tags of the monitor resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParameters.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParameters.json.cs similarity index 90% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParameters.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParameters.json.cs index 23e893ee35c1..a5e2d935813a 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParameters.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParameters.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -65,20 +65,20 @@ internal DatadogMonitorResourceUpdateParameters(Microsoft.Azure.PowerShell.Cmdle { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitorUpdateProperties.FromJson(__jsonProperties) : Property;} - {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ResourceSku.FromJson(__jsonSku) : Sku;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceUpdateParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitorUpdateProperties.FromJson(__jsonProperties) : _property;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ResourceSku.FromJson(__jsonSku) : _sku;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceUpdateParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogMonitorResourceUpdateParameters(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.PowerShell.cs similarity index 88% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.PowerShell.cs index aacb81c9f8fb..5731b477ea70 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class DatadogMonitorResourceUpdateParametersTags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -82,7 +82,7 @@ internal DatadogMonitorResourceUpdateParametersTags(global::System.Collections.I } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -101,29 +101,29 @@ internal DatadogMonitorResourceUpdateParametersTags(global::System.Management.Au } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogMonitorResourceUpdateParametersTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogMonitorResourceUpdateParametersTags(content); } @@ -136,7 +136,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.TypeConverter.cs similarity index 96% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.TypeConverter.cs index 0986391d3fb5..c06a2e406444 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.cs similarity index 79% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.cs index f3fe27360def..271a3f644442 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// The new tags of the monitor resource. public partial class DatadogMonitorResourceUpdateParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTagsInternal { /// diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.dictionary.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.dictionary.cs similarity index 95% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.dictionary.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.dictionary.cs index 4efd35f869c8..33ce9bb63873 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.dictionary.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceUpdateParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceUpdateParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.json.cs similarity index 94% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.json.cs index 73efab76df4b..763797ec68ad 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogMonitorResourceUpdateParametersTags.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogMonitorResourceUpdateParametersTags.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -71,13 +71,13 @@ internal DatadogMonitorResourceUpdateParametersTags(Microsoft.Azure.PowerShell.C } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogMonitorResourceUpdateParametersTags(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogOrganizationProperties.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogOrganizationProperties.PowerShell.cs similarity index 64% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogOrganizationProperties.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogOrganizationProperties.PowerShell.cs index 983132b32d68..97c96b2c5264 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogOrganizationProperties.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogOrganizationProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class DatadogOrganizationProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,41 +78,41 @@ internal DatadogOrganizationProperties(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("LinkingAuthCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).LinkingAuthCode = (string) content.GetValueForProperty("LinkingAuthCode",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).LinkingAuthCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).LinkingAuthCode = (string) content.GetValueForProperty("LinkingAuthCode",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).LinkingAuthCode, global::System.Convert.ToString); } if (content.Contains("LinkingClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).LinkingClientId = (string) content.GetValueForProperty("LinkingClientId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).LinkingClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).LinkingClientId = (string) content.GetValueForProperty("LinkingClientId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).LinkingClientId, global::System.Convert.ToString); } if (content.Contains("RedirectUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).RedirectUri = (string) content.GetValueForProperty("RedirectUri",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).RedirectUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).RedirectUri = (string) content.GetValueForProperty("RedirectUri",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).RedirectUri, global::System.Convert.ToString); } if (content.Contains("ApiKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).ApiKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).ApiKey, global::System.Convert.ToString); } if (content.Contains("ApplicationKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).ApplicationKey = (string) content.GetValueForProperty("ApplicationKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).ApplicationKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).ApplicationKey = (string) content.GetValueForProperty("ApplicationKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).ApplicationKey, global::System.Convert.ToString); } if (content.Contains("EnterpriseAppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).EnterpriseAppId = (string) content.GetValueForProperty("EnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).EnterpriseAppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).EnterpriseAppId = (string) content.GetValueForProperty("EnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).EnterpriseAppId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -127,63 +127,61 @@ internal DatadogOrganizationProperties(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("LinkingAuthCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).LinkingAuthCode = (string) content.GetValueForProperty("LinkingAuthCode",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).LinkingAuthCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).LinkingAuthCode = (string) content.GetValueForProperty("LinkingAuthCode",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).LinkingAuthCode, global::System.Convert.ToString); } if (content.Contains("LinkingClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).LinkingClientId = (string) content.GetValueForProperty("LinkingClientId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).LinkingClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).LinkingClientId = (string) content.GetValueForProperty("LinkingClientId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).LinkingClientId, global::System.Convert.ToString); } if (content.Contains("RedirectUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).RedirectUri = (string) content.GetValueForProperty("RedirectUri",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).RedirectUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).RedirectUri = (string) content.GetValueForProperty("RedirectUri",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).RedirectUri, global::System.Convert.ToString); } if (content.Contains("ApiKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).ApiKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).ApiKey, global::System.Convert.ToString); } if (content.Contains("ApplicationKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).ApplicationKey = (string) content.GetValueForProperty("ApplicationKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).ApplicationKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).ApplicationKey = (string) content.GetValueForProperty("ApplicationKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).ApplicationKey, global::System.Convert.ToString); } if (content.Contains("EnterpriseAppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).EnterpriseAppId = (string) content.GetValueForProperty("EnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)this).EnterpriseAppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).EnterpriseAppId = (string) content.GetValueForProperty("EnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)this).EnterpriseAppId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogOrganizationProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogOrganizationProperties(content); } @@ -193,7 +191,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogOrganizationProperties.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogOrganizationProperties.TypeConverter.cs similarity index 96% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogOrganizationProperties.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogOrganizationProperties.TypeConverter.cs index f153750d172a..a41f40776741 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogOrganizationProperties.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogOrganizationProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogOrganizationProperties.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogOrganizationProperties.cs similarity index 90% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogOrganizationProperties.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogOrganizationProperties.cs index 9864fb1420e4..22dea53418b6 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogOrganizationProperties.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogOrganizationProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Datadog organization properties public partial class DatadogOrganizationProperties : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal { /// Backing field for property. @@ -58,10 +58,10 @@ public partial class DatadogOrganizationProperties : public string LinkingClientId { get => this._linkingClientId; set => this._linkingClientId = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal.Name { get => this._name; set { {_name = value;} } } /// Backing field for property. private string _name; @@ -91,6 +91,9 @@ public partial interface IDatadogOrganizationProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"Api key associated to the Datadog organization.", SerializedName = @"apiKey", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +102,9 @@ public partial interface IDatadogOrganizationProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"Application key associated to the Datadog organization.", SerializedName = @"applicationKey", PossibleTypes = new [] { typeof(string) })] @@ -107,6 +113,9 @@ public partial interface IDatadogOrganizationProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"The Id of the Enterprise App used for Single sign on.", SerializedName = @"enterpriseAppId", PossibleTypes = new [] { typeof(string) })] @@ -115,6 +124,9 @@ public partial interface IDatadogOrganizationProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the Datadog organization.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -123,6 +135,9 @@ public partial interface IDatadogOrganizationProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"The auth code used to linking to an existing datadog organization.", SerializedName = @"linkingAuthCode", PossibleTypes = new [] { typeof(string) })] @@ -133,6 +148,9 @@ public partial interface IDatadogOrganizationProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"The client_id from an existing in exchange for an auth token to link organization.", SerializedName = @"linkingClientId", PossibleTypes = new [] { typeof(string) })] @@ -141,6 +159,9 @@ public partial interface IDatadogOrganizationProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the Datadog organization.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -149,6 +170,9 @@ public partial interface IDatadogOrganizationProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"The redirect uri for linking.", SerializedName = @"redirectUri", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogOrganizationProperties.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogOrganizationProperties.json.cs similarity index 67% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogOrganizationProperties.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogOrganizationProperties.json.cs index 6ad1796e0721..273586dc7c62 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogOrganizationProperties.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogOrganizationProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -65,25 +65,19 @@ internal DatadogOrganizationProperties(Microsoft.Azure.PowerShell.Cmdlets.Datado { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_linkingAuthCode = If( json?.PropertyT("linkingAuthCode"), out var __jsonLinkingAuthCode) ? (string)__jsonLinkingAuthCode : (string)LinkingAuthCode;} - {_linkingClientId = If( json?.PropertyT("linkingClientId"), out var __jsonLinkingClientId) ? (string)__jsonLinkingClientId : (string)LinkingClientId;} - {_redirectUri = If( json?.PropertyT("redirectUri"), out var __jsonRedirectUri) ? (string)__jsonRedirectUri : (string)RedirectUri;} - {_apiKey = If( json?.PropertyT("apiKey"), out var __jsonApiKey) ? (string)__jsonApiKey : (string)ApiKey;} - {_applicationKey = If( json?.PropertyT("applicationKey"), out var __jsonApplicationKey) ? (string)__jsonApplicationKey : (string)ApplicationKey;} - {_enterpriseAppId = If( json?.PropertyT("enterpriseAppId"), out var __jsonEnterpriseAppId) ? (string)__jsonEnterpriseAppId : (string)EnterpriseAppId;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogOrganizationProperties(json) : null; } @@ -107,20 +101,38 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode ToJson(M { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - AddIf( null != (((object)this._linkingAuthCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._linkingAuthCode.ToString()) : null, "linkingAuthCode" ,container.Add ); - AddIf( null != (((object)this._linkingClientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._linkingClientId.ToString()) : null, "linkingClientId" ,container.Add ); - AddIf( null != (((object)this._redirectUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._redirectUri.ToString()) : null, "redirectUri" ,container.Add ); - AddIf( null != (((object)this._apiKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._apiKey.ToString()) : null, "apiKey" ,container.Add ); - AddIf( null != (((object)this._applicationKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._applicationKey.ToString()) : null, "applicationKey" ,container.Add ); - AddIf( null != (((object)this._enterpriseAppId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._enterpriseAppId.ToString()) : null, "enterpriseAppId" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._linkingAuthCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._linkingAuthCode.ToString()) : null, "linkingAuthCode" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._linkingClientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._linkingClientId.ToString()) : null, "linkingClientId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._redirectUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._redirectUri.ToString()) : null, "redirectUri" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._apiKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._apiKey.ToString()) : null, "apiKey" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._applicationKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._applicationKey.ToString()) : null, "applicationKey" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._enterpriseAppId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._enterpriseAppId.ToString()) : null, "enterpriseAppId" ,container.Add ); + } AfterToJson(ref container); return container; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSetPasswordLink.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSetPasswordLink.PowerShell.cs similarity index 84% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSetPasswordLink.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSetPasswordLink.PowerShell.cs index dbd0d978fef2..84b7fdbfe9f5 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSetPasswordLink.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSetPasswordLink.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -62,7 +62,7 @@ public partial class DatadogSetPasswordLink partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -77,13 +77,13 @@ internal DatadogSetPasswordLink(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SetPasswordLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLinkInternal)this).SetPasswordLink = (string) content.GetValueForProperty("SetPasswordLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLinkInternal)this).SetPasswordLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLinkInternal)this).SetPasswordLink = (string) content.GetValueForProperty("SetPasswordLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLinkInternal)this).SetPasswordLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -98,33 +98,33 @@ internal DatadogSetPasswordLink(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("SetPasswordLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLinkInternal)this).SetPasswordLink = (string) content.GetValueForProperty("SetPasswordLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLinkInternal)this).SetPasswordLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLinkInternal)this).SetPasswordLink = (string) content.GetValueForProperty("SetPasswordLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLinkInternal)this).SetPasswordLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogSetPasswordLink(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogSetPasswordLink(content); } @@ -134,7 +134,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSetPasswordLink.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSetPasswordLink.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSetPasswordLink.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSetPasswordLink.TypeConverter.cs index 1759a1b0534e..76b41da23853 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSetPasswordLink.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSetPasswordLink.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSetPasswordLink.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSetPasswordLink.cs similarity index 83% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSetPasswordLink.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSetPasswordLink.cs index e2dbfd5906ce..d2c542901fb3 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSetPasswordLink.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSetPasswordLink.cs @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; public partial class DatadogSetPasswordLink : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLinkInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLinkInternal { /// Backing field for property. @@ -30,6 +30,9 @@ public partial interface IDatadogSetPasswordLink : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"setPasswordLink", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSetPasswordLink.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSetPasswordLink.json.cs similarity index 94% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSetPasswordLink.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSetPasswordLink.json.cs index ddccde193225..d751003eda77 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSetPasswordLink.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSetPasswordLink.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -64,18 +64,18 @@ internal DatadogSetPasswordLink(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runti { return; } - {_setPasswordLink = If( json?.PropertyT("setPasswordLink"), out var __jsonSetPasswordLink) ? (string)__jsonSetPasswordLink : (string)SetPasswordLink;} + {_setPasswordLink = If( json?.PropertyT("setPasswordLink"), out var __jsonSetPasswordLink) ? (string)__jsonSetPasswordLink : (string)_setPasswordLink;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogSetPasswordLink(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnProperties.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnProperties.PowerShell.cs similarity index 69% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnProperties.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnProperties.PowerShell.cs index 18dbfc14d680..898c31f074ac 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnProperties.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -62,7 +62,7 @@ public partial class DatadogSingleSignOnProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -77,25 +77,25 @@ internal DatadogSingleSignOnProperties(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("SingleSignOnState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates?) content.GetValueForProperty("SingleSignOnState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnState = (string) content.GetValueForProperty("SingleSignOnState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnState, global::System.Convert.ToString); } if (content.Contains("EnterpriseAppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).EnterpriseAppId = (string) content.GetValueForProperty("EnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).EnterpriseAppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).EnterpriseAppId = (string) content.GetValueForProperty("EnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).EnterpriseAppId, global::System.Convert.ToString); } if (content.Contains("SingleSignOnUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnUrl = (string) content.GetValueForProperty("SingleSignOnUrl",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnUrl = (string) content.GetValueForProperty("SingleSignOnUrl",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnUrl, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -110,47 +110,45 @@ internal DatadogSingleSignOnProperties(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("SingleSignOnState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates?) content.GetValueForProperty("SingleSignOnState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnState = (string) content.GetValueForProperty("SingleSignOnState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnState, global::System.Convert.ToString); } if (content.Contains("EnterpriseAppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).EnterpriseAppId = (string) content.GetValueForProperty("EnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).EnterpriseAppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).EnterpriseAppId = (string) content.GetValueForProperty("EnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).EnterpriseAppId, global::System.Convert.ToString); } if (content.Contains("SingleSignOnUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnUrl = (string) content.GetValueForProperty("SingleSignOnUrl",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnUrl = (string) content.GetValueForProperty("SingleSignOnUrl",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)this).SingleSignOnUrl, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogSingleSignOnProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogSingleSignOnProperties(content); } @@ -160,7 +158,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnProperties.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnProperties.TypeConverter.cs similarity index 96% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnProperties.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnProperties.TypeConverter.cs index d5ca6b1c69ba..c62096e26844 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnProperties.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnProperties.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnProperties.cs similarity index 67% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnProperties.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnProperties.cs index d2658ad6506d..1910bf376f07 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnProperties.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnProperties.cs @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; public partial class DatadogSingleSignOnProperties : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal { /// Backing field for property. @@ -20,23 +20,23 @@ public partial class DatadogSingleSignOnProperties : public string EnterpriseAppId { get => this._enterpriseAppId; set => this._enterpriseAppId = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for SingleSignOnUrl - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal.SingleSignOnUrl { get => this._singleSignOnUrl; set { {_singleSignOnUrl = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal.SingleSignOnUrl { get => this._singleSignOnUrl; set { {_singleSignOnUrl = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? _provisioningState; + private string _provisioningState; [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates? _singleSignOnState; + private string _singleSignOnState; /// Various states of the SSO resource [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates? SingleSignOnState { get => this._singleSignOnState; set => this._singleSignOnState = value; } + public string SingleSignOnState { get => this._singleSignOnState; set => this._singleSignOnState = value; } /// Backing field for property. private string _singleSignOnUrl; @@ -58,6 +58,9 @@ public partial interface IDatadogSingleSignOnProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Id of the Enterprise App used for Single sign-on.", SerializedName = @"enterpriseAppId", PossibleTypes = new [] { typeof(string) })] @@ -66,22 +69,33 @@ public partial interface IDatadogSingleSignOnProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; } /// Various states of the SSO resource [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Various states of the SSO resource", SerializedName = @"singleSignOnState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates? SingleSignOnState { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Initial", "Enable", "Disable", "Existing")] + string SingleSignOnState { get; set; } /// The login URL specific to this Datadog Organization. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The login URL specific to this Datadog Organization.", SerializedName = @"singleSignOnUrl", PossibleTypes = new [] { typeof(string) })] @@ -94,9 +108,11 @@ internal partial interface IDatadogSingleSignOnPropertiesInternal /// The Id of the Enterprise App used for Single sign-on. string EnterpriseAppId { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; set; } /// Various states of the SSO resource - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates? SingleSignOnState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Initial", "Enable", "Disable", "Existing")] + string SingleSignOnState { get; set; } /// The login URL specific to this Datadog Organization. string SingleSignOnUrl { get; set; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnProperties.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnProperties.json.cs similarity index 92% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnProperties.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnProperties.json.cs index 1b69a19bad17..93286e1071b0 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnProperties.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -64,21 +64,21 @@ internal DatadogSingleSignOnProperties(Microsoft.Azure.PowerShell.Cmdlets.Datado { return; } - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_singleSignOnState = If( json?.PropertyT("singleSignOnState"), out var __jsonSingleSignOnState) ? (string)__jsonSingleSignOnState : (string)SingleSignOnState;} - {_enterpriseAppId = If( json?.PropertyT("enterpriseAppId"), out var __jsonEnterpriseAppId) ? (string)__jsonEnterpriseAppId : (string)EnterpriseAppId;} - {_singleSignOnUrl = If( json?.PropertyT("singleSignOnUrl"), out var __jsonSingleSignOnUrl) ? (string)__jsonSingleSignOnUrl : (string)SingleSignOnUrl;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_singleSignOnState = If( json?.PropertyT("singleSignOnState"), out var __jsonSingleSignOnState) ? (string)__jsonSingleSignOnState : (string)_singleSignOnState;} + {_enterpriseAppId = If( json?.PropertyT("enterpriseAppId"), out var __jsonEnterpriseAppId) ? (string)__jsonEnterpriseAppId : (string)_enterpriseAppId;} + {_singleSignOnUrl = If( json?.PropertyT("singleSignOnUrl"), out var __jsonSingleSignOnUrl) ? (string)__jsonSingleSignOnUrl : (string)_singleSignOnUrl;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogSingleSignOnProperties(json) : null; } @@ -102,13 +102,13 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode ToJson(M { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } AddIf( null != (((object)this._singleSignOnState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._singleSignOnState.ToString()) : null, "singleSignOnState" ,container.Add ); AddIf( null != (((object)this._enterpriseAppId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._enterpriseAppId.ToString()) : null, "enterpriseAppId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._singleSignOnUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._singleSignOnUrl.ToString()) : null, "singleSignOnUrl" ,container.Add ); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResource.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResource.PowerShell.cs similarity index 50% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResource.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResource.PowerShell.cs index dddd63816c45..eae038f8b146 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResource.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -62,7 +62,7 @@ public partial class DatadogSingleSignOnResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -77,69 +77,69 @@ internal DatadogSingleSignOnResource(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnPropertiesTypeConverter.ConvertFrom); } if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SingleSignOnState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SingleSignOnState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates?) content.GetValueForProperty("SingleSignOnState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SingleSignOnState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SingleSignOnState = (string) content.GetValueForProperty("SingleSignOnState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SingleSignOnState, global::System.Convert.ToString); } if (content.Contains("EnterpriseAppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).EnterpriseAppId = (string) content.GetValueForProperty("EnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).EnterpriseAppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).EnterpriseAppId = (string) content.GetValueForProperty("EnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).EnterpriseAppId, global::System.Convert.ToString); } if (content.Contains("SingleSignOnUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SingleSignOnUrl = (string) content.GetValueForProperty("SingleSignOnUrl",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SingleSignOnUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SingleSignOnUrl = (string) content.GetValueForProperty("SingleSignOnUrl",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SingleSignOnUrl, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -154,91 +154,89 @@ internal DatadogSingleSignOnResource(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnPropertiesTypeConverter.ConvertFrom); } if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SingleSignOnState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SingleSignOnState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates?) content.GetValueForProperty("SingleSignOnState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SingleSignOnState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SingleSignOnState = (string) content.GetValueForProperty("SingleSignOnState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SingleSignOnState, global::System.Convert.ToString); } if (content.Contains("EnterpriseAppId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).EnterpriseAppId = (string) content.GetValueForProperty("EnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).EnterpriseAppId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).EnterpriseAppId = (string) content.GetValueForProperty("EnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).EnterpriseAppId, global::System.Convert.ToString); } if (content.Contains("SingleSignOnUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SingleSignOnUrl = (string) content.GetValueForProperty("SingleSignOnUrl",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SingleSignOnUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SingleSignOnUrl = (string) content.GetValueForProperty("SingleSignOnUrl",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SingleSignOnUrl, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogSingleSignOnResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogSingleSignOnResource(content); } @@ -248,7 +246,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResource.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResource.TypeConverter.cs similarity index 96% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResource.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResource.TypeConverter.cs index 2f060238a4ef..69720b191eb0 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResource.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResource.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResource.cs similarity index 52% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResource.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResource.cs index 1c9c67a4b62c..992f3337ad8e 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResource.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResource.cs @@ -3,18 +3,18 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; public partial class DatadogSingleSignOnResource : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal { /// The Id of the Enterprise App used for Single sign-on. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string EnterpriseAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)Property).EnterpriseAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)Property).EnterpriseAppId = value ?? null; } + public string EnterpriseAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)Property).EnterpriseAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)Property).EnterpriseAppId = value ?? null; } /// Backing field for property. private string _id; @@ -24,25 +24,43 @@ public partial class DatadogSingleSignOnResource : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for SingleSignOnUrl - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal.SingleSignOnUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)Property).SingleSignOnUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)Property).SingleSignOnUrl = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal.SingleSignOnUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)Property).SingleSignOnUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)Property).SingleSignOnUrl = value; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedAt = value; } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedBy = value; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedByType = value; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedAt = value; } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedBy = value; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedByType = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -52,52 +70,56 @@ public partial class DatadogSingleSignOnResource : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties _property; [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnProperties()); set => this._property = value; } [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// Various states of the SSO resource [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates? SingleSignOnState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)Property).SingleSignOnState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)Property).SingleSignOnState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates)""); } + public string SingleSignOnState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)Property).SingleSignOnState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)Property).SingleSignOnState = value ?? null; } /// The login URL specific to this Datadog Organization. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string SingleSignOnUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnPropertiesInternal)Property).SingleSignOnUrl; } + public string SingleSignOnUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnPropertiesInternal)Property).SingleSignOnUrl; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Backing field for property. private string _type; @@ -119,6 +141,9 @@ public partial interface IDatadogSingleSignOnResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Id of the Enterprise App used for Single sign-on.", SerializedName = @"enterpriseAppId", PossibleTypes = new [] { typeof(string) })] @@ -127,6 +152,9 @@ public partial interface IDatadogSingleSignOnResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"ARM id of the resource.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -135,6 +163,9 @@ public partial interface IDatadogSingleSignOnResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the configuration.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -143,22 +174,33 @@ public partial interface IDatadogSingleSignOnResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; } /// Various states of the SSO resource [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Various states of the SSO resource", SerializedName = @"singleSignOnState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates? SingleSignOnState { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Initial", "Enable", "Disable", "Existing")] + string SingleSignOnState { get; set; } /// The login URL specific to this Datadog Organization. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The login URL specific to this Datadog Organization.", SerializedName = @"singleSignOnUrl", PossibleTypes = new [] { typeof(string) })] @@ -166,55 +208,78 @@ public partial interface IDatadogSingleSignOnResource : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// The type of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the resource.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -231,27 +296,31 @@ internal partial interface IDatadogSingleSignOnResourceInternal /// Name of the configuration. string Name { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnProperties Property { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; set; } /// Various states of the SSO resource - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates? SingleSignOnState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Initial", "Enable", "Disable", "Existing")] + string SingleSignOnState { get; set; } /// The login URL specific to this Datadog Organization. string SingleSignOnUrl { get; set; } /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// The type of the resource. string Type { get; set; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResource.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResource.json.cs similarity index 90% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResource.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResource.json.cs index 7a742713cc54..cf37e5a66265 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResource.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -64,22 +64,22 @@ internal DatadogSingleSignOnResource(Microsoft.Azure.PowerShell.Cmdlets.Datadog. { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnProperties.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnProperties.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogSingleSignOnResource(json) : null; } @@ -104,19 +104,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode ToJson(M return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResourceListResponse.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResourceListResponse.PowerShell.cs similarity index 74% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResourceListResponse.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResourceListResponse.PowerShell.cs index 735ea214f590..a090052f2b34 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResourceListResponse.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResourceListResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class DatadogSingleSignOnResourceListResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal DatadogSingleSignOnResourceListResponse(global::System.Collections.IDic // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,39 +103,39 @@ internal DatadogSingleSignOnResourceListResponse(global::System.Management.Autom // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatadogSingleSignOnResourceListResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatadogSingleSignOnResourceListResponse(content); } @@ -148,7 +148,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDat /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResourceListResponse.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResourceListResponse.TypeConverter.cs similarity index 96% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResourceListResponse.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResourceListResponse.TypeConverter.cs index cdf10517fcc5..428582136692 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResourceListResponse.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResourceListResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResourceListResponse.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResourceListResponse.cs similarity index 71% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResourceListResponse.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResourceListResponse.cs index 03e2d3b368e6..55fe6405c55f 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResourceListResponse.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResourceListResponse.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Response of a list operation. public partial class DatadogSingleSignOnResourceListResponse : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponse, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponse, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponseInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class DatadogSingleSignOnResourceListResponse : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource[] _value; + private System.Collections.Generic.List _value; /// Results of a list operation. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public DatadogSingleSignOnResourceListResponse() @@ -41,6 +41,9 @@ public partial interface IDatadogSingleSignOnResourceListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the next set of results, if any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IDatadogSingleSignOnResourceListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Results of a list operation.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource) })] + System.Collections.Generic.List Value { get; set; } } /// Response of a list operation. @@ -62,7 +68,7 @@ internal partial interface IDatadogSingleSignOnResourceListResponseInternal /// Link to the next set of results, if any. string NextLink { get; set; } /// Results of a list operation. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResourceListResponse.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResourceListResponse.json.cs similarity index 89% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResourceListResponse.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResourceListResponse.json.cs index 169340cd9f74..b55a902e6b2e 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/DatadogSingleSignOnResourceListResponse.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/DatadogSingleSignOnResourceListResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -65,19 +65,19 @@ internal DatadogSingleSignOnResourceListResponse(Microsoft.Azure.PowerShell.Cmdl { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnResource.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResource.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new DatadogSingleSignOnResourceListResponse(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs similarity index 80% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs index f61adce45ae7..1f5265649e8a 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class ErrorAdditionalInfo partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorAdditionalInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorAdditionalInfo(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,17 +104,17 @@ internal ErrorAdditionalInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Info")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -129,11 +129,11 @@ internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Info")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -143,7 +143,7 @@ internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject conte /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs index c2d6389640b3..f2083f1cb6c5 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorAdditionalInfo.cs similarity index 82% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorAdditionalInfo.cs index 38a2638af3dc..9e2c35fee91e 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorAdditionalInfo.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// The resource management error additional info. public partial class ErrorAdditionalInfo : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfo, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfoInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class ErrorAdditionalInfo : public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IAny Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Any()); } /// Internal Acessors for Info - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Any()); set { {_info = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Any()); set { {_info = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _type; @@ -47,6 +47,9 @@ public partial interface IErrorAdditionalInfo : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The additional info.", SerializedName = @"info", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IAny) })] @@ -55,6 +58,9 @@ public partial interface IErrorAdditionalInfo : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The additional info type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs similarity index 93% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs index b3bd9f87ccd4..96e390d647eb 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorAdditionalInfo.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ErrorAdditionalInfo(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime. { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Any.FromJson(__jsonInfo) : Info;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Any.FromJson(__jsonInfo) : _info;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new ErrorAdditionalInfo(json) : null; } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode ToJson(M { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._info ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._info.ToJson(null,serializationMode) : null, "info" ,container.Add ); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorDetail.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs similarity index 69% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorDetail.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs index 0d0aeb21899b..7ab5bc3030f6 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorDetail.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class ErrorDetail partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorDetail(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorDetail(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,29 +104,29 @@ internal ErrorDetail(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -141,23 +141,23 @@ internal ErrorDetail(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -167,7 +167,7 @@ internal ErrorDetail(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorDetail.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorDetail.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs index 872aeeaec0db..01483f255368 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorDetail.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorDetail.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorDetail.cs similarity index 66% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorDetail.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorDetail.cs index 0afdd76a29a2..e2cd3a0116da 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorDetail.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorDetail.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// The error detail. public partial class ErrorDetail : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo[] _additionalInfo; + private System.Collections.Generic.List _additionalInfo; /// The error additional info. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo[] AdditionalInfo { get => this._additionalInfo; } + public System.Collections.Generic.List AdditionalInfo { get => this._additionalInfo; } /// Backing field for property. private string _code; @@ -28,11 +28,11 @@ public partial class ErrorDetail : public string Code { get => this._code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail[] _detail; + private System.Collections.Generic.List _detail; /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail[] Detail { get => this._detail; } + public System.Collections.Generic.List Detail { get => this._detail; } /// Backing field for property. private string _message; @@ -42,19 +42,19 @@ public partial class ErrorDetail : public string Message { get => this._message; } /// Internal Acessors for AdditionalInfo - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal.Target { get => this._target; set { {_target = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal.Target { get => this._target; set { {_target = value;} } } /// Backing field for property. private string _target; @@ -77,14 +77,20 @@ public partial interface IErrorDetail : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error additional info.", SerializedName = @"additionalInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo[] AdditionalInfo { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -93,14 +99,20 @@ public partial interface IErrorDetail : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error details.", SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail) })] + System.Collections.Generic.List Detail { get; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +121,9 @@ public partial interface IErrorDetail : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error target.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -120,11 +135,11 @@ internal partial interface IErrorDetailInternal { /// The error additional info. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + System.Collections.Generic.List AdditionalInfo { get; set; } /// The error code. string Code { get; set; } /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// The error message. string Message { get; set; } /// The error target. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorDetail.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorDetail.json.cs similarity index 84% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorDetail.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorDetail.json.cs index 0346c276406e..286b616c0d53 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorDetail.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorDetail.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -65,22 +65,20 @@ internal ErrorDetail(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.Jso { return; } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} - {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} - {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorDetail.FromJson(__u) )) ))() : null : Detail;} - {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : AdditionalInfo;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)_target;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorDetail.FromJson(__u) )) ))() : null : _detail;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : _additionalInfo;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail. + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new ErrorDetail(json) : null; } @@ -104,19 +102,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode ToJson(M { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { if (null != this._detail) { @@ -128,7 +126,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode ToJson(M container.Add("details",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { if (null != this._additionalInfo) { diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorResponse.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 66% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorResponse.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index 2223947f5944..8386e62ceff5 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorResponse.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -66,33 +66,33 @@ public partial class ErrorResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponse(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,33 +107,33 @@ internal ErrorResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorDetailTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorDetailTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -148,27 +148,27 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorDetailTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorDetailTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -178,7 +178,7 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorResponse.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorResponse.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index 5a1305be7474..928516861d08 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorResponse.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorResponse.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorResponse.cs similarity index 58% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorResponse.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorResponse.cs index 75e865afece3..23173bbbb24a 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorResponse.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorResponse.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -12,54 +12,54 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 /// the OData error response format.). /// public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal { /// The error additional info. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo[] AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).AdditionalInfo; } + public System.Collections.Generic.List AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).AdditionalInfo; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).Code; } /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).Detail; } + public System.Collections.Generic.List Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).Detail; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail _error; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail _error; /// The error object. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorDetail()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorDetail()); set => this._error = value; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).Message; } /// Internal Acessors for AdditionalInfo - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).AdditionalInfo = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).AdditionalInfo = value; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).Code = value; } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).Detail = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).Detail = value; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorDetail()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorDetail()); set { {_error = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).Message = value; } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).Target = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).Target = value; } /// The error target. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetailInternal)Error).Target; } + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetailInternal)Error).Target; } /// Creates an new instance. public ErrorResponse() @@ -76,14 +76,20 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error additional info.", SerializedName = @"additionalInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo[] AdditionalInfo { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -92,14 +98,20 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error details.", SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail) })] + System.Collections.Generic.List Detail { get; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -108,6 +120,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error target.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -120,13 +135,13 @@ internal partial interface IErrorResponseInternal { /// The error additional info. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + System.Collections.Generic.List AdditionalInfo { get; set; } /// The error code. string Code { get; set; } /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// The error object. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorDetail Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorDetail Error { get; set; } /// The error message. string Message { get; set; } /// The error target. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorResponse.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 95% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorResponse.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorResponse.json.cs index 23652111f91d..61cc4e43814f 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/ErrorResponse.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ErrorResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -68,18 +68,18 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.J { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ErrorDetail.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ErrorDetail.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/FilteringTag.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/FilteringTag.PowerShell.cs similarity index 78% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/FilteringTag.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/FilteringTag.PowerShell.cs index 17fd8c39abc8..b21b1b3b114c 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/FilteringTag.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/FilteringTag.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -66,33 +66,33 @@ public partial class FilteringTag partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new FilteringTag(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new FilteringTag(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,21 +107,21 @@ internal FilteringTag(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTagInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTagInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTagInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTagInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTagInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTagInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTagInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTagInternal)this).Value, global::System.Convert.ToString); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTagInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTagInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTagInternal)this).Action = (string) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTagInternal)this).Action, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,15 +136,15 @@ internal FilteringTag(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTagInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTagInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTagInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTagInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTagInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTagInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTagInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTagInternal)this).Value, global::System.Convert.ToString); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTagInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTagInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTagInternal)this).Action = (string) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTagInternal)this).Action, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -154,7 +154,7 @@ internal FilteringTag(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/FilteringTag.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/FilteringTag.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/FilteringTag.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/FilteringTag.TypeConverter.cs index 7672c81a2429..76d574047a47 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/FilteringTag.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/FilteringTag.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/FilteringTag.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/FilteringTag.cs similarity index 80% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/FilteringTag.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/FilteringTag.cs index 96c647ab473e..450898766dfa 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/FilteringTag.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/FilteringTag.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -12,16 +12,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 /// monitored. /// public partial class FilteringTag : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTagInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTagInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction? _action; + private string _action; /// Valid actions for a filtering tag. Exclusion takes priority over inclusion. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction? Action { get => this._action; set => this._action = value; } + public string Action { get => this._action; set => this._action = value; } /// Backing field for property. private string _name; @@ -52,14 +52,21 @@ public partial interface IFilteringTag : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Valid actions for a filtering tag. Exclusion takes priority over inclusion.", SerializedName = @"action", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction? Action { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Include", "Exclude")] + string Action { get; set; } /// The name (also known as the key) of the tag. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name (also known as the key) of the tag.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -68,6 +75,9 @@ public partial interface IFilteringTag : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value of the tag.", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] @@ -80,7 +90,8 @@ internal partial interface IFilteringTagInternal { /// Valid actions for a filtering tag. Exclusion takes priority over inclusion. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction? Action { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Include", "Exclude")] + string Action { get; set; } /// The name (also known as the key) of the tag. string Name { get; set; } /// The value of the tag. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/FilteringTag.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/FilteringTag.json.cs similarity index 92% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/FilteringTag.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/FilteringTag.json.cs index b7c329599764..ed8d9389264b 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/FilteringTag.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/FilteringTag.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -68,20 +68,18 @@ internal FilteringTag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.Js { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} - {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)Action;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} + {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)_action;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag. + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new FilteringTag(json) : null; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/IdentityProperties.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/IdentityProperties.PowerShell.cs similarity index 76% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/IdentityProperties.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/IdentityProperties.PowerShell.cs index a44143a5dc8c..afcc1f912ea4 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/IdentityProperties.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/IdentityProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -62,27 +62,27 @@ public partial class IdentityProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IdentityProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IdentityProperties(content); } @@ -92,10 +92,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIde /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -110,21 +110,21 @@ internal IdentityProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)this).TenantId, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -139,15 +139,15 @@ internal IdentityProperties(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)this).TenantId, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/IdentityProperties.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/IdentityProperties.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/IdentityProperties.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/IdentityProperties.TypeConverter.cs index a76ee231ad18..b339263f167c 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/IdentityProperties.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/IdentityProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/IdentityProperties.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/IdentityProperties.cs similarity index 74% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/IdentityProperties.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/IdentityProperties.cs index 3204a8894a75..cb9b93e04a13 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/IdentityProperties.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/IdentityProperties.cs @@ -3,20 +3,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; public partial class IdentityProperties : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal { /// Internal Acessors for PrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } /// Internal Acessors for TenantId - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityPropertiesInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityPropertiesInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } /// Backing field for property. private string _principalId; @@ -33,11 +33,11 @@ public partial class IdentityProperties : public string TenantId { get => this._tenantId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes? _type; + private string _type; /// Identity type [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes? Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public IdentityProperties() @@ -52,6 +52,9 @@ public partial interface IIdentityProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -60,6 +63,9 @@ public partial interface IIdentityProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The tenant ID of resource.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -68,10 +74,14 @@ public partial interface IIdentityProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Identity type", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes? Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("SystemAssigned", "UserAssigned")] + string Type { get; set; } } internal partial interface IIdentityPropertiesInternal @@ -82,7 +92,8 @@ internal partial interface IIdentityPropertiesInternal /// The tenant ID of resource. string TenantId { get; set; } /// Identity type - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes? Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("SystemAssigned", "UserAssigned")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/IdentityProperties.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/IdentityProperties.json.cs similarity index 92% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/IdentityProperties.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/IdentityProperties.json.cs index 76ee795888c0..38d7c9a86849 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/IdentityProperties.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/IdentityProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -53,13 +53,13 @@ public partial class IdentityProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IIdentityProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IIdentityProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new IdentityProperties(json) : null; } @@ -76,9 +76,9 @@ internal IdentityProperties(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.J { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode ToJson(M { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResource.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResource.PowerShell.cs similarity index 85% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResource.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResource.PowerShell.cs index a7cebda951f8..d49667fce6ef 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResource.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class LinkedResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new LinkedResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new LinkedResource(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILin /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,13 +111,13 @@ internal LinkedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceInternal)this).Id, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -132,7 +132,7 @@ internal LinkedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceInternal)this).Id, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResource.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResource.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResource.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResource.TypeConverter.cs index 69f8586d24df..f2cde164c0c3 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResource.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResource.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResource.cs similarity index 86% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResource.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResource.cs index 4db7f8ceb9db..bdd380f1b79b 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResource.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResource.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// The definition of a linked resource. public partial class LinkedResource : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface ILinkedResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ARM id of the linked resource.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResource.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResource.json.cs similarity index 94% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResource.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResource.json.cs index 5a29e26ae1e1..d81330b99079 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResource.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LinkedResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new LinkedResource(json) : null; } @@ -77,7 +77,7 @@ internal LinkedResource(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json. { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResourceListResponse.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResourceListResponse.PowerShell.cs similarity index 76% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResourceListResponse.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResourceListResponse.PowerShell.cs index e21b26a2cacb..3179ea34dbec 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResourceListResponse.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResourceListResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class LinkedResourceListResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new LinkedResourceListResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new LinkedResourceListResponse(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILin /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal LinkedResourceListResponse(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LinkedResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LinkedResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal LinkedResourceListResponse(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LinkedResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LinkedResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResourceListResponse.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResourceListResponse.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResourceListResponse.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResourceListResponse.TypeConverter.cs index a14acbd97a4f..93c25687622b 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResourceListResponse.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResourceListResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResourceListResponse.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResourceListResponse.cs similarity index 72% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResourceListResponse.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResourceListResponse.cs index 63cea9b8ee39..9549e7e67836 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResourceListResponse.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResourceListResponse.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Response of a list operation. public partial class LinkedResourceListResponse : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponse, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponse, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponseInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class LinkedResourceListResponse : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource[] _value; + private System.Collections.Generic.List _value; /// Results of a list operation. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public LinkedResourceListResponse() @@ -41,6 +41,9 @@ public partial interface ILinkedResourceListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the next set of results, if any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface ILinkedResourceListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Results of a list operation.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource) })] + System.Collections.Generic.List Value { get; set; } } /// Response of a list operation. @@ -62,7 +68,7 @@ internal partial interface ILinkedResourceListResponseInternal /// Link to the next set of results, if any. string NextLink { get; set; } /// Results of a list operation. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResourceListResponse.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResourceListResponse.json.cs similarity index 90% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResourceListResponse.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResourceListResponse.json.cs index 9de6ce341c13..0a03aa6d53f5 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LinkedResourceListResponse.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/LinkedResourceListResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LinkedResourceListResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new LinkedResourceListResponse(json) : null; } @@ -77,8 +77,8 @@ internal LinkedResourceListResponse(Microsoft.Azure.PowerShell.Cmdlets.Datadog.R { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LinkedResource.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LinkedResource.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LogRules.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/LogRules.PowerShell.cs similarity index 71% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LogRules.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/LogRules.PowerShell.cs index 4cdfc199298c..f85010d6335e 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LogRules.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/LogRules.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class LogRules partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new LogRules(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new LogRules(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILog /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,25 +111,25 @@ internal LogRules(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SendAadLog")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).SendAadLog = (bool?) content.GetValueForProperty("SendAadLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).SendAadLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).SendAadLog = (bool?) content.GetValueForProperty("SendAadLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).SendAadLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("SendSubscriptionLog")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).SendSubscriptionLog = (bool?) content.GetValueForProperty("SendSubscriptionLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).SendSubscriptionLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).SendSubscriptionLog = (bool?) content.GetValueForProperty("SendSubscriptionLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).SendSubscriptionLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("SendResourceLog")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).SendResourceLog = (bool?) content.GetValueForProperty("SendResourceLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).SendResourceLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).SendResourceLog = (bool?) content.GetValueForProperty("SendResourceLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).SendResourceLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("FilteringTag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).FilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]) content.GetValueForProperty("FilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).FilteringTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTagTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).FilteringTag = (System.Collections.Generic.List) content.GetValueForProperty("FilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).FilteringTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTagTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,19 +144,19 @@ internal LogRules(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("SendAadLog")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).SendAadLog = (bool?) content.GetValueForProperty("SendAadLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).SendAadLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).SendAadLog = (bool?) content.GetValueForProperty("SendAadLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).SendAadLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("SendSubscriptionLog")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).SendSubscriptionLog = (bool?) content.GetValueForProperty("SendSubscriptionLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).SendSubscriptionLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).SendSubscriptionLog = (bool?) content.GetValueForProperty("SendSubscriptionLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).SendSubscriptionLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("SendResourceLog")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).SendResourceLog = (bool?) content.GetValueForProperty("SendResourceLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).SendResourceLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).SendResourceLog = (bool?) content.GetValueForProperty("SendResourceLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).SendResourceLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("FilteringTag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).FilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]) content.GetValueForProperty("FilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)this).FilteringTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTagTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).FilteringTag = (System.Collections.Generic.List) content.GetValueForProperty("FilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)this).FilteringTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTagTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LogRules.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/LogRules.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LogRules.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/LogRules.TypeConverter.cs index e0724c5554cf..9255d33ebec4 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LogRules.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/LogRules.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LogRules.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/LogRules.cs similarity index 85% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LogRules.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/LogRules.cs index 3f2eae2b7622..45a84106eaef 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LogRules.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/LogRules.cs @@ -3,18 +3,18 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Set of rules for sending logs for the Monitor resource. public partial class LogRules : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] _filteringTag; + private System.Collections.Generic.List _filteringTag; /// /// List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, @@ -22,7 +22,7 @@ public partial class LogRules : /// resources. If Include actions are specified, the rules will only include resources with the associated tags. /// [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] FilteringTag { get => this._filteringTag; set => this._filteringTag = value; } + public System.Collections.Generic.List FilteringTag { get => this._filteringTag; set => this._filteringTag = value; } /// Backing field for property. private bool? _sendAadLog; @@ -65,14 +65,20 @@ public partial interface ILogRules : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", SerializedName = @"filteringTags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] FilteringTag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + System.Collections.Generic.List FilteringTag { get; set; } /// Flag specifying if AAD logs should be sent for the Monitor resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag specifying if AAD logs should be sent for the Monitor resource.", SerializedName = @"sendAadLogs", PossibleTypes = new [] { typeof(bool) })] @@ -81,6 +87,9 @@ public partial interface ILogRules : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag specifying if Azure resource logs should be sent for the Monitor resource.", SerializedName = @"sendResourceLogs", PossibleTypes = new [] { typeof(bool) })] @@ -91,6 +100,9 @@ public partial interface ILogRules : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag specifying if Azure subscription logs should be sent for the Monitor resource.", SerializedName = @"sendSubscriptionLogs", PossibleTypes = new [] { typeof(bool) })] @@ -106,7 +118,7 @@ internal partial interface ILogRulesInternal /// all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available /// resources. If Include actions are specified, the rules will only include resources with the associated tags. /// - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] FilteringTag { get; set; } + System.Collections.Generic.List FilteringTag { get; set; } /// Flag specifying if AAD logs should be sent for the Monitor resource. bool? SendAadLog { get; set; } /// Flag specifying if Azure resource logs should be sent for the Monitor resource. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LogRules.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/LogRules.json.cs similarity index 89% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LogRules.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/LogRules.json.cs index 4a8c9414ba8a..8fee8e297e1d 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/LogRules.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/LogRules.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class LogRules partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules. + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new LogRules(json) : null; } @@ -77,10 +75,10 @@ internal LogRules(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonOb { return; } - {_sendAadLog = If( json?.PropertyT("sendAadLogs"), out var __jsonSendAadLogs) ? (bool?)__jsonSendAadLogs : SendAadLog;} - {_sendSubscriptionLog = If( json?.PropertyT("sendSubscriptionLogs"), out var __jsonSendSubscriptionLogs) ? (bool?)__jsonSendSubscriptionLogs : SendSubscriptionLog;} - {_sendResourceLog = If( json?.PropertyT("sendResourceLogs"), out var __jsonSendResourceLogs) ? (bool?)__jsonSendResourceLogs : SendResourceLog;} - {_filteringTag = If( json?.PropertyT("filteringTags"), out var __jsonFilteringTags) ? If( __jsonFilteringTags as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTag.FromJson(__u) )) ))() : null : FilteringTag;} + {_sendAadLog = If( json?.PropertyT("sendAadLogs"), out var __jsonSendAadLogs) ? (bool?)__jsonSendAadLogs : _sendAadLog;} + {_sendSubscriptionLog = If( json?.PropertyT("sendSubscriptionLogs"), out var __jsonSendSubscriptionLogs) ? (bool?)__jsonSendSubscriptionLogs : _sendSubscriptionLog;} + {_sendResourceLog = If( json?.PropertyT("sendResourceLogs"), out var __jsonSendResourceLogs) ? (bool?)__jsonSendResourceLogs : _sendResourceLog;} + {_filteringTag = If( json?.PropertyT("filteringTags"), out var __jsonFilteringTags) ? If( __jsonFilteringTags as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTag.FromJson(__u) )) ))() : null : _filteringTag;} AfterFromJson(json); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MetricRules.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MetricRules.PowerShell.cs similarity index 80% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MetricRules.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MetricRules.PowerShell.cs index a13444025e03..818a9a87f034 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MetricRules.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MetricRules.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class MetricRules partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MetricRules(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MetricRules(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMet /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,13 +111,13 @@ internal MetricRules(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("FilteringTag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRulesInternal)this).FilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]) content.GetValueForProperty("FilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRulesInternal)this).FilteringTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTagTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRulesInternal)this).FilteringTag = (System.Collections.Generic.List) content.GetValueForProperty("FilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRulesInternal)this).FilteringTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTagTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -132,7 +132,7 @@ internal MetricRules(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("FilteringTag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRulesInternal)this).FilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]) content.GetValueForProperty("FilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRulesInternal)this).FilteringTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTagTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRulesInternal)this).FilteringTag = (System.Collections.Generic.List) content.GetValueForProperty("FilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRulesInternal)this).FilteringTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTagTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MetricRules.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MetricRules.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MetricRules.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MetricRules.TypeConverter.cs index 4d648effa258..269586edc334 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MetricRules.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MetricRules.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MetricRules.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MetricRules.cs similarity index 76% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MetricRules.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MetricRules.cs index f0d021346f48..5f2b4d3da816 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MetricRules.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MetricRules.cs @@ -3,18 +3,18 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Set of rules for sending metrics for the Monitor resource. public partial class MetricRules : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRulesInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRulesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] _filteringTag; + private System.Collections.Generic.List _filteringTag; /// /// List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action @@ -22,7 +22,7 @@ public partial class MetricRules : /// will only include resources with the associated tags. /// [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] FilteringTag { get => this._filteringTag; set => this._filteringTag = value; } + public System.Collections.Generic.List FilteringTag { get => this._filteringTag; set => this._filteringTag = value; } /// Creates an new instance. public MetricRules() @@ -42,10 +42,13 @@ public partial interface IMetricRules : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", SerializedName = @"filteringTags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] FilteringTag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + System.Collections.Generic.List FilteringTag { get; set; } } /// Set of rules for sending metrics for the Monitor resource. @@ -57,7 +60,7 @@ internal partial interface IMetricRulesInternal /// is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules /// will only include resources with the associated tags. /// - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] FilteringTag { get; set; } + System.Collections.Generic.List FilteringTag { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MetricRules.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MetricRules.json.cs similarity index 88% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MetricRules.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MetricRules.json.cs index f8f9c46e7d64..dd30f6799829 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MetricRules.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MetricRules.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class MetricRules partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules. + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new MetricRules(json) : null; } @@ -77,7 +75,7 @@ internal MetricRules(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.Jso { return; } - {_filteringTag = If( json?.PropertyT("filteringTags"), out var __jsonFilteringTags) ? If( __jsonFilteringTags as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTag.FromJson(__u) )) ))() : null : FilteringTag;} + {_filteringTag = If( json?.PropertyT("filteringTags"), out var __jsonFilteringTags) ? If( __jsonFilteringTags as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTag.FromJson(__u) )) ))() : null : _filteringTag;} AfterFromJson(json); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorProperties.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorProperties.PowerShell.cs new file mode 100644 index 000000000000..670f3400ec7f --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorProperties.PowerShell.cs @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + + /// Properties specific to the monitor resource. + [System.ComponentModel.TypeConverter(typeof(MonitorPropertiesTypeConverter))] + public partial class MonitorProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MonitorProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MonitorProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MonitorProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatadogOrganizationProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationProperty = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties) content.GetValueForProperty("DatadogOrganizationProperty",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationProperty, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogOrganizationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("UserInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfo = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo) content.GetValueForProperty("UserInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfo, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.UserInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).MonitoringStatus = (string) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).MonitoringStatus, global::System.Convert.ToString); + } + if (content.Contains("MarketplaceSubscriptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).MarketplaceSubscriptionStatus = (string) content.GetValueForProperty("MarketplaceSubscriptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).MarketplaceSubscriptionStatus, global::System.Convert.ToString); + } + if (content.Contains("LiftrResourceCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).LiftrResourceCategory = (string) content.GetValueForProperty("LiftrResourceCategory",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).LiftrResourceCategory, global::System.Convert.ToString); + } + if (content.Contains("LiftrResourcePreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).LiftrResourcePreference = (int?) content.GetValueForProperty("LiftrResourcePreference",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).LiftrResourcePreference, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DatadogOrganizationPropertyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyName = (string) content.GetValueForProperty("DatadogOrganizationPropertyName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyName, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyId = (string) content.GetValueForProperty("DatadogOrganizationPropertyId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyId, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyRedirectUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyRedirectUri = (string) content.GetValueForProperty("DatadogOrganizationPropertyRedirectUri",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyRedirectUri, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyApiKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApiKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApiKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApiKey, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyApplicationKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApplicationKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApplicationKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApplicationKey, global::System.Convert.ToString); + } + if (content.Contains("UserInfoName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfoName = (string) content.GetValueForProperty("UserInfoName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfoName, global::System.Convert.ToString); + } + if (content.Contains("UserInfoEmailAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfoEmailAddress = (string) content.GetValueForProperty("UserInfoEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfoEmailAddress, global::System.Convert.ToString); + } + if (content.Contains("UserInfoPhoneNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfoPhoneNumber = (string) content.GetValueForProperty("UserInfoPhoneNumber",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfoPhoneNumber, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyLinkingAuthCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingAuthCode = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingAuthCode",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingAuthCode, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyLinkingClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingClientId = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingClientId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingClientId, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyEnterpriseAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyEnterpriseAppId = (string) content.GetValueForProperty("DatadogOrganizationPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyEnterpriseAppId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MonitorProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DatadogOrganizationProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationProperty = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties) content.GetValueForProperty("DatadogOrganizationProperty",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationProperty, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogOrganizationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("UserInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfo = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo) content.GetValueForProperty("UserInfo",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfo, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.UserInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).MonitoringStatus = (string) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).MonitoringStatus, global::System.Convert.ToString); + } + if (content.Contains("MarketplaceSubscriptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).MarketplaceSubscriptionStatus = (string) content.GetValueForProperty("MarketplaceSubscriptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).MarketplaceSubscriptionStatus, global::System.Convert.ToString); + } + if (content.Contains("LiftrResourceCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).LiftrResourceCategory = (string) content.GetValueForProperty("LiftrResourceCategory",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).LiftrResourceCategory, global::System.Convert.ToString); + } + if (content.Contains("LiftrResourcePreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).LiftrResourcePreference = (int?) content.GetValueForProperty("LiftrResourcePreference",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).LiftrResourcePreference, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DatadogOrganizationPropertyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyName = (string) content.GetValueForProperty("DatadogOrganizationPropertyName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyName, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyId = (string) content.GetValueForProperty("DatadogOrganizationPropertyId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyId, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyRedirectUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyRedirectUri = (string) content.GetValueForProperty("DatadogOrganizationPropertyRedirectUri",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyRedirectUri, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyApiKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApiKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApiKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApiKey, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyApplicationKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApplicationKey = (string) content.GetValueForProperty("DatadogOrganizationPropertyApplicationKey",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyApplicationKey, global::System.Convert.ToString); + } + if (content.Contains("UserInfoName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfoName = (string) content.GetValueForProperty("UserInfoName",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfoName, global::System.Convert.ToString); + } + if (content.Contains("UserInfoEmailAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfoEmailAddress = (string) content.GetValueForProperty("UserInfoEmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfoEmailAddress, global::System.Convert.ToString); + } + if (content.Contains("UserInfoPhoneNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfoPhoneNumber = (string) content.GetValueForProperty("UserInfoPhoneNumber",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).UserInfoPhoneNumber, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyLinkingAuthCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingAuthCode = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingAuthCode",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingAuthCode, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyLinkingClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingClientId = (string) content.GetValueForProperty("DatadogOrganizationPropertyLinkingClientId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyLinkingClientId, global::System.Convert.ToString); + } + if (content.Contains("DatadogOrganizationPropertyEnterpriseAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyEnterpriseAppId = (string) content.GetValueForProperty("DatadogOrganizationPropertyEnterpriseAppId",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal)this).DatadogOrganizationPropertyEnterpriseAppId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Properties specific to the monitor resource. + [System.ComponentModel.TypeConverter(typeof(MonitorPropertiesTypeConverter))] + public partial interface IMonitorProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorProperties.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorProperties.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorProperties.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorProperties.TypeConverter.cs index 711715a45785..96c919fe245c 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorProperties.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorProperties.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorProperties.cs similarity index 63% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorProperties.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorProperties.cs index 695028d3f865..b000e40cc863 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorProperties.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorProperties.cs @@ -3,62 +3,62 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Properties specific to the monitor resource. public partial class MonitorProperties : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties _datadogOrganizationProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties _datadogOrganizationProperty; /// Datadog organization properties [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties DatadogOrganizationProperty { get => (this._datadogOrganizationProperty = this._datadogOrganizationProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogOrganizationProperties()); set => this._datadogOrganizationProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties DatadogOrganizationProperty { get => (this._datadogOrganizationProperty = this._datadogOrganizationProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogOrganizationProperties()); set => this._datadogOrganizationProperty = value; } /// Api key associated to the Datadog organization. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyApiKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).ApiKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).ApiKey = value ?? null; } + public string DatadogOrganizationPropertyApiKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).ApiKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).ApiKey = value ?? null; } /// Application key associated to the Datadog organization. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyApplicationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).ApplicationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).ApplicationKey = value ?? null; } + public string DatadogOrganizationPropertyApplicationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).ApplicationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).ApplicationKey = value ?? null; } /// The Id of the Enterprise App used for Single sign on. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyEnterpriseAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).EnterpriseAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).EnterpriseAppId = value ?? null; } + public string DatadogOrganizationPropertyEnterpriseAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).EnterpriseAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).EnterpriseAppId = value ?? null; } /// Id of the Datadog organization. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).Id; } + public string DatadogOrganizationPropertyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).Id; } /// The auth code used to linking to an existing datadog organization. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyLinkingAuthCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).LinkingAuthCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).LinkingAuthCode = value ?? null; } + public string DatadogOrganizationPropertyLinkingAuthCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).LinkingAuthCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).LinkingAuthCode = value ?? null; } /// /// The client_id from an existing in exchange for an auth token to link organization. /// [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyLinkingClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).LinkingClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).LinkingClientId = value ?? null; } + public string DatadogOrganizationPropertyLinkingClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).LinkingClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).LinkingClientId = value ?? null; } /// Name of the Datadog organization. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).Name; } + public string DatadogOrganizationPropertyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).Name; } /// The redirect uri for linking. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DatadogOrganizationPropertyRedirectUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).RedirectUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).RedirectUri = value ?? null; } + public string DatadogOrganizationPropertyRedirectUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).RedirectUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).RedirectUri = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories? _liftrResourceCategory; + private string _liftrResourceCategory; [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories? LiftrResourceCategory { get => this._liftrResourceCategory; } + public string LiftrResourceCategory { get => this._liftrResourceCategory; } /// Backing field for property. private int? _liftrResourcePreference; @@ -68,70 +68,70 @@ public partial class MonitorProperties : public int? LiftrResourcePreference { get => this._liftrResourcePreference; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus? _marketplaceSubscriptionStatus; + private string _marketplaceSubscriptionStatus; /// /// Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will /// go in Suspended state. /// [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get => this._marketplaceSubscriptionStatus; } + public string MarketplaceSubscriptionStatus { get => this._marketplaceSubscriptionStatus; } /// Internal Acessors for DatadogOrganizationProperty - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal.DatadogOrganizationProperty { get => (this._datadogOrganizationProperty = this._datadogOrganizationProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogOrganizationProperties()); set { {_datadogOrganizationProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal.DatadogOrganizationProperty { get => (this._datadogOrganizationProperty = this._datadogOrganizationProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogOrganizationProperties()); set { {_datadogOrganizationProperty = value;} } } /// Internal Acessors for DatadogOrganizationPropertyId - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal.DatadogOrganizationPropertyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal.DatadogOrganizationPropertyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).Id = value; } /// Internal Acessors for DatadogOrganizationPropertyName - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal.DatadogOrganizationPropertyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal.DatadogOrganizationPropertyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationPropertiesInternal)DatadogOrganizationProperty).Name = value; } /// Internal Acessors for LiftrResourceCategory - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal.LiftrResourceCategory { get => this._liftrResourceCategory; set { {_liftrResourceCategory = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal.LiftrResourceCategory { get => this._liftrResourceCategory; set { {_liftrResourceCategory = value;} } } /// Internal Acessors for LiftrResourcePreference - int? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal.LiftrResourcePreference { get => this._liftrResourcePreference; set { {_liftrResourcePreference = value;} } } + int? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal.LiftrResourcePreference { get => this._liftrResourcePreference; set { {_liftrResourcePreference = value;} } } /// Internal Acessors for MarketplaceSubscriptionStatus - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal.MarketplaceSubscriptionStatus { get => this._marketplaceSubscriptionStatus; set { {_marketplaceSubscriptionStatus = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal.MarketplaceSubscriptionStatus { get => this._marketplaceSubscriptionStatus; set { {_marketplaceSubscriptionStatus = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for UserInfo - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorPropertiesInternal.UserInfo { get => (this._userInfo = this._userInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.UserInfo()); set { {_userInfo = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorPropertiesInternal.UserInfo { get => (this._userInfo = this._userInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.UserInfo()); set { {_userInfo = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus? _monitoringStatus; + private string _monitoringStatus; /// Flag specifying if the resource monitoring is enabled or disabled. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus? MonitoringStatus { get => this._monitoringStatus; set => this._monitoringStatus = value; } + public string MonitoringStatus { get => this._monitoringStatus; set => this._monitoringStatus = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? _provisioningState; + private string _provisioningState; [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo _userInfo; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo _userInfo; /// User info [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo UserInfo { get => (this._userInfo = this._userInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.UserInfo()); set => this._userInfo = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo UserInfo { get => (this._userInfo = this._userInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.UserInfo()); set => this._userInfo = value; } /// Email of the user used by Datadog for contacting them if needed [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string UserInfoEmailAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)UserInfo).EmailAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)UserInfo).EmailAddress = value ?? null; } + public string UserInfoEmailAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)UserInfo).EmailAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)UserInfo).EmailAddress = value ?? null; } /// Name of the user [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string UserInfoName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)UserInfo).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)UserInfo).Name = value ?? null; } + public string UserInfoName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)UserInfo).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)UserInfo).Name = value ?? null; } /// Phone number of the user used by Datadog for contacting them if needed [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string UserInfoPhoneNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)UserInfo).PhoneNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)UserInfo).PhoneNumber = value ?? null; } + public string UserInfoPhoneNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)UserInfo).PhoneNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)UserInfo).PhoneNumber = value ?? null; } /// Creates an new instance. public MonitorProperties() @@ -147,6 +147,9 @@ public partial interface IMonitorProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"Api key associated to the Datadog organization.", SerializedName = @"apiKey", PossibleTypes = new [] { typeof(string) })] @@ -155,6 +158,9 @@ public partial interface IMonitorProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"Application key associated to the Datadog organization.", SerializedName = @"applicationKey", PossibleTypes = new [] { typeof(string) })] @@ -163,6 +169,9 @@ public partial interface IMonitorProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"The Id of the Enterprise App used for Single sign on.", SerializedName = @"enterpriseAppId", PossibleTypes = new [] { typeof(string) })] @@ -171,6 +180,9 @@ public partial interface IMonitorProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the Datadog organization.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -179,6 +191,9 @@ public partial interface IMonitorProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"The auth code used to linking to an existing datadog organization.", SerializedName = @"linkingAuthCode", PossibleTypes = new [] { typeof(string) })] @@ -189,6 +204,9 @@ public partial interface IMonitorProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"The client_id from an existing in exchange for an auth token to link organization.", SerializedName = @"linkingClientId", PossibleTypes = new [] { typeof(string) })] @@ -197,6 +215,9 @@ public partial interface IMonitorProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the Datadog organization.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -205,6 +226,9 @@ public partial interface IMonitorProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"The redirect uri for linking.", SerializedName = @"redirectUri", PossibleTypes = new [] { typeof(string) })] @@ -213,14 +237,21 @@ public partial interface IMonitorProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"", SerializedName = @"liftrResourceCategory", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories? LiftrResourceCategory { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Unknown", "MonitorLogs")] + string LiftrResourceCategory { get; } /// The priority of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The priority of the resource.", SerializedName = @"liftrResourcePreference", PossibleTypes = new [] { typeof(int) })] @@ -232,30 +263,45 @@ public partial interface IMonitorProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will go in Suspended state.", SerializedName = @"marketplaceSubscriptionStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Provisioning", "Active", "Suspended", "Unsubscribed")] + string MarketplaceSubscriptionStatus { get; } /// Flag specifying if the resource monitoring is enabled or disabled. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag specifying if the resource monitoring is enabled or disabled.", SerializedName = @"monitoringStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus? MonitoringStatus { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string MonitoringStatus { get; set; } [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; } /// Email of the user used by Datadog for contacting them if needed [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email of the user used by Datadog for contacting them if needed", SerializedName = @"emailAddress", PossibleTypes = new [] { typeof(string) })] @@ -264,6 +310,9 @@ public partial interface IMonitorProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the user", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -272,6 +321,9 @@ public partial interface IMonitorProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Phone number of the user used by Datadog for contacting them if needed", SerializedName = @"phoneNumber", PossibleTypes = new [] { typeof(string) })] @@ -283,7 +335,7 @@ internal partial interface IMonitorPropertiesInternal { /// Datadog organization properties - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogOrganizationProperties DatadogOrganizationProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogOrganizationProperties DatadogOrganizationProperty { get; set; } /// Api key associated to the Datadog organization. string DatadogOrganizationPropertyApiKey { get; set; } /// Application key associated to the Datadog organization. @@ -303,20 +355,24 @@ internal partial interface IMonitorPropertiesInternal /// The redirect uri for linking. string DatadogOrganizationPropertyRedirectUri { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories? LiftrResourceCategory { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Unknown", "MonitorLogs")] + string LiftrResourceCategory { get; set; } /// The priority of the resource. int? LiftrResourcePreference { get; set; } /// /// Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will /// go in Suspended state. /// - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Provisioning", "Active", "Suspended", "Unsubscribed")] + string MarketplaceSubscriptionStatus { get; set; } /// Flag specifying if the resource monitoring is enabled or disabled. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus? MonitoringStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string MonitoringStatus { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; set; } /// User info - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo UserInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo UserInfo { get; set; } /// Email of the user used by Datadog for contacting them if needed string UserInfoEmailAddress { get; set; } /// Name of the user diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorProperties.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorProperties.json.cs similarity index 90% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorProperties.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorProperties.json.cs index 82f2b1718c8b..803d32090498 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorProperties.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MonitorProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new MonitorProperties(json) : null; } @@ -77,13 +77,13 @@ internal MonitorProperties(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Js { return; } - {_datadogOrganizationProperty = If( json?.PropertyT("datadogOrganizationProperties"), out var __jsonDatadogOrganizationProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogOrganizationProperties.FromJson(__jsonDatadogOrganizationProperties) : DatadogOrganizationProperty;} - {_userInfo = If( json?.PropertyT("userInfo"), out var __jsonUserInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.UserInfo.FromJson(__jsonUserInfo) : UserInfo;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_monitoringStatus = If( json?.PropertyT("monitoringStatus"), out var __jsonMonitoringStatus) ? (string)__jsonMonitoringStatus : (string)MonitoringStatus;} - {_marketplaceSubscriptionStatus = If( json?.PropertyT("marketplaceSubscriptionStatus"), out var __jsonMarketplaceSubscriptionStatus) ? (string)__jsonMarketplaceSubscriptionStatus : (string)MarketplaceSubscriptionStatus;} - {_liftrResourceCategory = If( json?.PropertyT("liftrResourceCategory"), out var __jsonLiftrResourceCategory) ? (string)__jsonLiftrResourceCategory : (string)LiftrResourceCategory;} - {_liftrResourcePreference = If( json?.PropertyT("liftrResourcePreference"), out var __jsonLiftrResourcePreference) ? (int?)__jsonLiftrResourcePreference : LiftrResourcePreference;} + {_datadogOrganizationProperty = If( json?.PropertyT("datadogOrganizationProperties"), out var __jsonDatadogOrganizationProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogOrganizationProperties.FromJson(__jsonDatadogOrganizationProperties) : _datadogOrganizationProperty;} + {_userInfo = If( json?.PropertyT("userInfo"), out var __jsonUserInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.UserInfo.FromJson(__jsonUserInfo) : _userInfo;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_monitoringStatus = If( json?.PropertyT("monitoringStatus"), out var __jsonMonitoringStatus) ? (string)__jsonMonitoringStatus : (string)_monitoringStatus;} + {_marketplaceSubscriptionStatus = If( json?.PropertyT("marketplaceSubscriptionStatus"), out var __jsonMarketplaceSubscriptionStatus) ? (string)__jsonMarketplaceSubscriptionStatus : (string)_marketplaceSubscriptionStatus;} + {_liftrResourceCategory = If( json?.PropertyT("liftrResourceCategory"), out var __jsonLiftrResourceCategory) ? (string)__jsonLiftrResourceCategory : (string)_liftrResourceCategory;} + {_liftrResourcePreference = If( json?.PropertyT("liftrResourcePreference"), out var __jsonLiftrResourcePreference) ? (int?)__jsonLiftrResourcePreference : _liftrResourcePreference;} AfterFromJson(json); } @@ -108,20 +108,20 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode ToJson(M } AddIf( null != this._datadogOrganizationProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._datadogOrganizationProperty.ToJson(null,serializationMode) : null, "datadogOrganizationProperties" ,container.Add ); AddIf( null != this._userInfo ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._userInfo.ToJson(null,serializationMode) : null, "userInfo" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } AddIf( null != (((object)this._monitoringStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._monitoringStatus.ToString()) : null, "monitoringStatus" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._marketplaceSubscriptionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._marketplaceSubscriptionStatus.ToString()) : null, "marketplaceSubscriptionStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._liftrResourceCategory)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._liftrResourceCategory.ToString()) : null, "liftrResourceCategory" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._liftrResourcePreference ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNumber((int)this._liftrResourcePreference) : null, "liftrResourcePreference" ,container.Add ); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorUpdateProperties.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorUpdateProperties.PowerShell.cs similarity index 82% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorUpdateProperties.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorUpdateProperties.PowerShell.cs index f06a52227545..7ecc0e4247b5 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorUpdateProperties.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorUpdateProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class MonitorUpdateProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MonitorUpdateProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MonitorUpdateProperties(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMon /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,13 +113,13 @@ internal MonitorUpdateProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("MonitoringStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdatePropertiesInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus?) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdatePropertiesInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdatePropertiesInternal)this).MonitoringStatus = (string) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdatePropertiesInternal)this).MonitoringStatus, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,7 +134,7 @@ internal MonitorUpdateProperties(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("MonitoringStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdatePropertiesInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus?) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdatePropertiesInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdatePropertiesInternal)this).MonitoringStatus = (string) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdatePropertiesInternal)this).MonitoringStatus, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorUpdateProperties.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorUpdateProperties.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorUpdateProperties.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorUpdateProperties.TypeConverter.cs index 326265f50536..24c1316abfca 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorUpdateProperties.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorUpdateProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorUpdateProperties.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorUpdateProperties.cs similarity index 68% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorUpdateProperties.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorUpdateProperties.cs index aecab80a4dba..67ed17fce380 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorUpdateProperties.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorUpdateProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -11,16 +11,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 /// The set of properties that can be update in a PATCH request to a monitor resource. /// public partial class MonitorUpdateProperties : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdatePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdatePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus? _monitoringStatus; + private string _monitoringStatus; /// Flag specifying if the resource monitoring is enabled or disabled. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus? MonitoringStatus { get => this._monitoringStatus; set => this._monitoringStatus = value; } + public string MonitoringStatus { get => this._monitoringStatus; set => this._monitoringStatus = value; } /// Creates an new instance. public MonitorUpdateProperties() @@ -36,10 +36,14 @@ public partial interface IMonitorUpdateProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag specifying if the resource monitoring is enabled or disabled.", SerializedName = @"monitoringStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus? MonitoringStatus { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string MonitoringStatus { get; set; } } /// The set of properties that can be update in a PATCH request to a monitor resource. @@ -47,7 +51,8 @@ internal partial interface IMonitorUpdatePropertiesInternal { /// Flag specifying if the resource monitoring is enabled or disabled. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus? MonitoringStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string MonitoringStatus { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorUpdateProperties.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorUpdateProperties.json.cs similarity index 94% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorUpdateProperties.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorUpdateProperties.json.cs index 8e0655918a1e..5711b1f4fb54 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitorUpdateProperties.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitorUpdateProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class MonitorUpdateProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitorUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitorUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new MonitorUpdateProperties(json) : null; } @@ -79,7 +79,7 @@ internal MonitorUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runt { return; } - {_monitoringStatus = If( json?.PropertyT("monitoringStatus"), out var __jsonMonitoringStatus) ? (string)__jsonMonitoringStatus : (string)MonitoringStatus;} + {_monitoringStatus = If( json?.PropertyT("monitoringStatus"), out var __jsonMonitoringStatus) ? (string)__jsonMonitoringStatus : (string)_monitoringStatus;} AfterFromJson(json); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResource.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResource.PowerShell.cs similarity index 71% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResource.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResource.PowerShell.cs index e87b9da90a84..1169cc9918e1 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResource.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class MonitoredResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MonitoredResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MonitoredResource(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMon /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,29 +113,29 @@ internal MonitoredResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("SendingMetric")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).SendingMetric = (bool?) content.GetValueForProperty("SendingMetric",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).SendingMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).SendingMetric = (bool?) content.GetValueForProperty("SendingMetric",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).SendingMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ReasonForMetricsStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).ReasonForMetricsStatus = (string) content.GetValueForProperty("ReasonForMetricsStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).ReasonForMetricsStatus, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).ReasonForMetricsStatus = (string) content.GetValueForProperty("ReasonForMetricsStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).ReasonForMetricsStatus, global::System.Convert.ToString); } if (content.Contains("SendingLog")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).SendingLog = (bool?) content.GetValueForProperty("SendingLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).SendingLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).SendingLog = (bool?) content.GetValueForProperty("SendingLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).SendingLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ReasonForLogsStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).ReasonForLogsStatus = (string) content.GetValueForProperty("ReasonForLogsStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).ReasonForLogsStatus, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).ReasonForLogsStatus = (string) content.GetValueForProperty("ReasonForLogsStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).ReasonForLogsStatus, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -150,23 +150,23 @@ internal MonitoredResource(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("SendingMetric")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).SendingMetric = (bool?) content.GetValueForProperty("SendingMetric",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).SendingMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).SendingMetric = (bool?) content.GetValueForProperty("SendingMetric",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).SendingMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ReasonForMetricsStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).ReasonForMetricsStatus = (string) content.GetValueForProperty("ReasonForMetricsStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).ReasonForMetricsStatus, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).ReasonForMetricsStatus = (string) content.GetValueForProperty("ReasonForMetricsStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).ReasonForMetricsStatus, global::System.Convert.ToString); } if (content.Contains("SendingLog")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).SendingLog = (bool?) content.GetValueForProperty("SendingLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).SendingLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).SendingLog = (bool?) content.GetValueForProperty("SendingLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).SendingLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ReasonForLogsStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).ReasonForLogsStatus = (string) content.GetValueForProperty("ReasonForLogsStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal)this).ReasonForLogsStatus, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).ReasonForLogsStatus = (string) content.GetValueForProperty("ReasonForLogsStatus",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal)this).ReasonForLogsStatus, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResource.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResource.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResource.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResource.TypeConverter.cs index 66436c4fabba..bc84b4c68b6c 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResource.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResource.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResource.cs similarity index 91% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResource.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResource.cs index 3fb651652c50..845ab5217d9b 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResource.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResource.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 /// The properties of a resource currently being monitored by the Datadog monitor resource. /// public partial class MonitoredResource : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceInternal { /// Backing field for property. @@ -64,6 +64,9 @@ public partial interface IMonitoredResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ARM id of the resource.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -72,6 +75,9 @@ public partial interface IMonitoredResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Reason for why the resource is sending logs (or why it is not sending).", SerializedName = @"reasonForLogsStatus", PossibleTypes = new [] { typeof(string) })] @@ -80,6 +86,9 @@ public partial interface IMonitoredResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Reason for why the resource is sending metrics (or why it is not sending).", SerializedName = @"reasonForMetricsStatus", PossibleTypes = new [] { typeof(string) })] @@ -88,6 +97,9 @@ public partial interface IMonitoredResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag indicating if resource is sending logs to Datadog.", SerializedName = @"sendingLogs", PossibleTypes = new [] { typeof(bool) })] @@ -96,6 +108,9 @@ public partial interface IMonitoredResource : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag indicating if resource is sending metrics to Datadog.", SerializedName = @"sendingMetrics", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResource.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResource.json.cs similarity index 93% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResource.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResource.json.cs index b71948dd2968..11bb470d2fac 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResource.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class MonitoredResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new MonitoredResource(json) : null; } @@ -79,11 +79,11 @@ internal MonitoredResource(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Js { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_sendingMetric = If( json?.PropertyT("sendingMetrics"), out var __jsonSendingMetrics) ? (bool?)__jsonSendingMetrics : SendingMetric;} - {_reasonForMetricsStatus = If( json?.PropertyT("reasonForMetricsStatus"), out var __jsonReasonForMetricsStatus) ? (string)__jsonReasonForMetricsStatus : (string)ReasonForMetricsStatus;} - {_sendingLog = If( json?.PropertyT("sendingLogs"), out var __jsonSendingLogs) ? (bool?)__jsonSendingLogs : SendingLog;} - {_reasonForLogsStatus = If( json?.PropertyT("reasonForLogsStatus"), out var __jsonReasonForLogsStatus) ? (string)__jsonReasonForLogsStatus : (string)ReasonForLogsStatus;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_sendingMetric = If( json?.PropertyT("sendingMetrics"), out var __jsonSendingMetrics) ? (bool?)__jsonSendingMetrics : _sendingMetric;} + {_reasonForMetricsStatus = If( json?.PropertyT("reasonForMetricsStatus"), out var __jsonReasonForMetricsStatus) ? (string)__jsonReasonForMetricsStatus : (string)_reasonForMetricsStatus;} + {_sendingLog = If( json?.PropertyT("sendingLogs"), out var __jsonSendingLogs) ? (bool?)__jsonSendingLogs : _sendingLog;} + {_reasonForLogsStatus = If( json?.PropertyT("reasonForLogsStatus"), out var __jsonReasonForLogsStatus) ? (string)__jsonReasonForLogsStatus : (string)_reasonForLogsStatus;} AfterFromJson(json); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResourceListResponse.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResourceListResponse.PowerShell.cs similarity index 75% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResourceListResponse.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResourceListResponse.PowerShell.cs index 2295ad3cc91f..8cdcdbe2aa4d 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResourceListResponse.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResourceListResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class MonitoredResourceListResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MonitoredResourceListResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MonitoredResourceListResponse(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMon /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,17 +111,17 @@ internal MonitoredResourceListResponse(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoredResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoredResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -138,11 +136,11 @@ internal MonitoredResourceListResponse(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoredResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoredResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResourceListResponse.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResourceListResponse.TypeConverter.cs similarity index 96% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResourceListResponse.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResourceListResponse.TypeConverter.cs index d2df24674035..e6726d70f67b 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResourceListResponse.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResourceListResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResourceListResponse.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResourceListResponse.cs similarity index 72% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResourceListResponse.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResourceListResponse.cs index 9a3224551b16..5406447131e5 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResourceListResponse.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResourceListResponse.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Response of a list operation. public partial class MonitoredResourceListResponse : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponse, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponse, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponseInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class MonitoredResourceListResponse : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource[] _value; + private System.Collections.Generic.List _value; /// Results of a list operation. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public MonitoredResourceListResponse() @@ -41,6 +41,9 @@ public partial interface IMonitoredResourceListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the next set of results, if any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IMonitoredResourceListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Results of a list operation.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource) })] + System.Collections.Generic.List Value { get; set; } } /// Response of a list operation. @@ -62,7 +68,7 @@ internal partial interface IMonitoredResourceListResponseInternal /// Link to the next set of results, if any. string NextLink { get; set; } /// Results of a list operation. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResourceListResponse.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResourceListResponse.json.cs similarity index 89% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResourceListResponse.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResourceListResponse.json.cs index 4bb809a0c7e7..8377cab2fe19 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoredResourceListResponse.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoredResourceListResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MonitoredResourceListResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new MonitoredResourceListResponse(json) : null; } @@ -77,8 +77,8 @@ internal MonitoredResourceListResponse(Microsoft.Azure.PowerShell.Cmdlets.Datado { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoredResource.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoredResource.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRules.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRules.PowerShell.cs new file mode 100644 index 000000000000..47f237d73ee9 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRules.PowerShell.cs @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + + /// Capture logs and metrics of Azure resources based on ARM tags. + [System.ComponentModel.TypeConverter(typeof(MonitoringTagRulesTypeConverter))] + public partial class MonitoringTagRules + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MonitoringTagRules(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MonitoringTagRules(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MonitoringTagRules(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRulesPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("LogRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules) content.GetValueForProperty("LogRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LogRulesTypeConverter.ConvertFrom); + } + if (content.Contains("MetricRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).MetricRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules) content.GetValueForProperty("MetricRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).MetricRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MetricRulesTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LogRuleFilteringTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleFilteringTag = (System.Collections.Generic.List) content.GetValueForProperty("LogRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleFilteringTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTagTypeConverter.ConvertFrom)); + } + if (content.Contains("MetricRuleFilteringTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).MetricRuleFilteringTag = (System.Collections.Generic.List) content.GetValueForProperty("MetricRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).MetricRuleFilteringTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTagTypeConverter.ConvertFrom)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LogRuleSendAadLog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleSendAadLog = (bool?) content.GetValueForProperty("LogRuleSendAadLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleSendAadLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LogRuleSendSubscriptionLog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleSendSubscriptionLog = (bool?) content.GetValueForProperty("LogRuleSendSubscriptionLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleSendSubscriptionLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LogRuleSendResourceLog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleSendResourceLog = (bool?) content.GetValueForProperty("LogRuleSendResourceLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleSendResourceLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MonitoringTagRules(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRulesPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("LogRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules) content.GetValueForProperty("LogRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LogRulesTypeConverter.ConvertFrom); + } + if (content.Contains("MetricRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).MetricRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules) content.GetValueForProperty("MetricRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).MetricRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MetricRulesTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LogRuleFilteringTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleFilteringTag = (System.Collections.Generic.List) content.GetValueForProperty("LogRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleFilteringTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTagTypeConverter.ConvertFrom)); + } + if (content.Contains("MetricRuleFilteringTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).MetricRuleFilteringTag = (System.Collections.Generic.List) content.GetValueForProperty("MetricRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).MetricRuleFilteringTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTagTypeConverter.ConvertFrom)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LogRuleSendAadLog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleSendAadLog = (bool?) content.GetValueForProperty("LogRuleSendAadLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleSendAadLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LogRuleSendSubscriptionLog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleSendSubscriptionLog = (bool?) content.GetValueForProperty("LogRuleSendSubscriptionLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleSendSubscriptionLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LogRuleSendResourceLog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleSendResourceLog = (bool?) content.GetValueForProperty("LogRuleSendResourceLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal)this).LogRuleSendResourceLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Capture logs and metrics of Azure resources based on ARM tags. + [System.ComponentModel.TypeConverter(typeof(MonitoringTagRulesTypeConverter))] + public partial interface IMonitoringTagRules + + { + + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRules.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRules.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRules.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRules.TypeConverter.cs index 1ac9acac0ebb..35a3f87df149 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRules.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRules.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRules.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRules.cs similarity index 57% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRules.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRules.cs index eb16da7a13e1..19ec0f669bbf 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRules.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRules.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Capture logs and metrics of Azure resources based on ARM tags. public partial class MonitoringTagRules : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal { /// Backing field for property. @@ -26,21 +26,21 @@ public partial class MonitoringTagRules : /// resources. If Include actions are specified, the rules will only include resources with the associated tags. /// [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] LogRuleFilteringTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).LogRuleFilteringTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).LogRuleFilteringTag = value ?? null /* arrayOf */; } + public System.Collections.Generic.List LogRuleFilteringTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).LogRuleFilteringTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).LogRuleFilteringTag = value ?? null /* arrayOf */; } /// Flag specifying if AAD logs should be sent for the Monitor resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public bool? LogRuleSendAadLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).LogRuleSendAadLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).LogRuleSendAadLog = value ?? default(bool); } + public bool? LogRuleSendAadLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).LogRuleSendAadLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).LogRuleSendAadLog = value ?? default(bool); } /// Flag specifying if Azure resource logs should be sent for the Monitor resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public bool? LogRuleSendResourceLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).LogRuleSendResourceLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).LogRuleSendResourceLog = value ?? default(bool); } + public bool? LogRuleSendResourceLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).LogRuleSendResourceLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).LogRuleSendResourceLog = value ?? default(bool); } /// /// Flag specifying if Azure subscription logs should be sent for the Monitor resource. /// [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public bool? LogRuleSendSubscriptionLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).LogRuleSendSubscriptionLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).LogRuleSendSubscriptionLog = value ?? default(bool); } + public bool? LogRuleSendSubscriptionLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).LogRuleSendSubscriptionLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).LogRuleSendSubscriptionLog = value ?? default(bool); } /// /// List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action @@ -48,31 +48,49 @@ public partial class MonitoringTagRules : /// will only include resources with the associated tags. /// [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] MetricRuleFilteringTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).MetricRuleFilteringTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).MetricRuleFilteringTag = value ?? null /* arrayOf */; } + public System.Collections.Generic.List MetricRuleFilteringTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).MetricRuleFilteringTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).MetricRuleFilteringTag = value ?? null /* arrayOf */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for LogRule - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal.LogRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).LogRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).LogRule = value; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal.LogRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).LogRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).LogRule = value; } /// Internal Acessors for MetricRule - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal.MetricRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).MetricRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).MetricRule = value; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal.MetricRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).MetricRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).MetricRule = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRulesProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRulesProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedAt = value; } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedBy = value; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedByType = value; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedAt = value; } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedBy = value; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedByType = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -82,45 +100,49 @@ public partial class MonitoringTagRules : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties _property; /// Definition of the properties for a TagRules resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRulesProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRulesProperties()); set => this._property = value; } [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Backing field for property. private string _type; @@ -143,6 +165,9 @@ public partial interface IMonitoringTagRules : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The id of the rule set.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -155,14 +180,20 @@ public partial interface IMonitoringTagRules : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", SerializedName = @"filteringTags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] LogRuleFilteringTag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + System.Collections.Generic.List LogRuleFilteringTag { get; set; } /// Flag specifying if AAD logs should be sent for the Monitor resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag specifying if AAD logs should be sent for the Monitor resource.", SerializedName = @"sendAadLogs", PossibleTypes = new [] { typeof(bool) })] @@ -171,6 +202,9 @@ public partial interface IMonitoringTagRules : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag specifying if Azure resource logs should be sent for the Monitor resource.", SerializedName = @"sendResourceLogs", PossibleTypes = new [] { typeof(bool) })] @@ -181,6 +215,9 @@ public partial interface IMonitoringTagRules : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag specifying if Azure subscription logs should be sent for the Monitor resource.", SerializedName = @"sendSubscriptionLogs", PossibleTypes = new [] { typeof(bool) })] @@ -193,14 +230,20 @@ public partial interface IMonitoringTagRules : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", SerializedName = @"filteringTags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] MetricRuleFilteringTag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + System.Collections.Generic.List MetricRuleFilteringTag { get; set; } /// Name of the rule set. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the rule set.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -209,62 +252,89 @@ public partial interface IMonitoringTagRules : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// The type of the rule set. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the rule set.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -278,13 +348,13 @@ internal partial interface IMonitoringTagRulesInternal /// The id of the rule set. string Id { get; set; } /// Set of rules for sending logs for the Monitor resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules LogRule { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules LogRule { get; set; } /// /// List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, /// all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available /// resources. If Include actions are specified, the rules will only include resources with the associated tags. /// - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] LogRuleFilteringTag { get; set; } + System.Collections.Generic.List LogRuleFilteringTag { get; set; } /// Flag specifying if AAD logs should be sent for the Monitor resource. bool? LogRuleSendAadLog { get; set; } /// Flag specifying if Azure resource logs should be sent for the Monitor resource. @@ -294,33 +364,36 @@ internal partial interface IMonitoringTagRulesInternal /// bool? LogRuleSendSubscriptionLog { get; set; } /// Set of rules for sending metrics for the Monitor resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules MetricRule { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules MetricRule { get; set; } /// /// List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action /// is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules /// will only include resources with the associated tags. /// - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] MetricRuleFilteringTag { get; set; } + System.Collections.Generic.List MetricRuleFilteringTag { get; set; } /// Name of the rule set. string Name { get; set; } /// Definition of the properties for a TagRules resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties Property { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; set; } /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// The type of the rule set. string Type { get; set; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRules.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRules.json.cs similarity index 90% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRules.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRules.json.cs index 4cfdbe1ff017..908e58b964b1 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRules.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRules.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MonitoringTagRules partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new MonitoringTagRules(json) : null; } @@ -77,11 +77,11 @@ internal MonitoringTagRules(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.J { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRulesProperties.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRulesProperties.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -105,19 +105,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode ToJson(M return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesListResponse.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesListResponse.PowerShell.cs similarity index 75% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesListResponse.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesListResponse.PowerShell.cs index 70a169325b8c..0ea5cc105a69 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesListResponse.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesListResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class MonitoringTagRulesListResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MonitoringTagRulesListResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MonitoringTagRulesListResponse(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMon /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,17 +111,17 @@ internal MonitoringTagRulesListResponse(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRulesTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRulesTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -138,11 +136,11 @@ internal MonitoringTagRulesListResponse(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRulesTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRulesTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponseInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesListResponse.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesListResponse.TypeConverter.cs similarity index 96% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesListResponse.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesListResponse.TypeConverter.cs index 21159d8cdfcc..8b5a51caf198 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesListResponse.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesListResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesListResponse.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesListResponse.cs similarity index 71% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesListResponse.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesListResponse.cs index 75dd1dc0fef7..28dbaa0874f2 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesListResponse.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesListResponse.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Response of a list operation. public partial class MonitoringTagRulesListResponse : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponse, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponse, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponseInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class MonitoringTagRulesListResponse : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules[] _value; + private System.Collections.Generic.List _value; /// Results of a list operation. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public MonitoringTagRulesListResponse() @@ -41,6 +41,9 @@ public partial interface IMonitoringTagRulesListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the next set of results, if any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IMonitoringTagRulesListResponse : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Results of a list operation.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules) })] + System.Collections.Generic.List Value { get; set; } } /// Response of a list operation. @@ -62,7 +68,7 @@ internal partial interface IMonitoringTagRulesListResponseInternal /// Link to the next set of results, if any. string NextLink { get; set; } /// Results of a list operation. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesListResponse.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesListResponse.json.cs similarity index 89% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesListResponse.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesListResponse.json.cs index 6ca218ecb5ed..e940069ae80f 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesListResponse.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesListResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MonitoringTagRulesListResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new MonitoringTagRulesListResponse(json) : null; } @@ -77,8 +77,8 @@ internal MonitoringTagRulesListResponse(Microsoft.Azure.PowerShell.Cmdlets.Datad { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRules.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRules.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesProperties.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesProperties.PowerShell.cs similarity index 56% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesProperties.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesProperties.PowerShell.cs index 132d64d9a032..505abbba03c7 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesProperties.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class MonitoringTagRulesProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MonitoringTagRulesProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MonitoringTagRulesProperties(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMon /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,41 +111,41 @@ internal MonitoringTagRulesProperties(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("LogRule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules) content.GetValueForProperty("LogRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LogRulesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules) content.GetValueForProperty("LogRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LogRulesTypeConverter.ConvertFrom); } if (content.Contains("MetricRule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).MetricRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules) content.GetValueForProperty("MetricRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).MetricRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MetricRulesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).MetricRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules) content.GetValueForProperty("MetricRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).MetricRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MetricRulesTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("LogRuleFilteringTag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleFilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]) content.GetValueForProperty("LogRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleFilteringTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTagTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleFilteringTag = (System.Collections.Generic.List) content.GetValueForProperty("LogRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleFilteringTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTagTypeConverter.ConvertFrom)); } if (content.Contains("MetricRuleFilteringTag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).MetricRuleFilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]) content.GetValueForProperty("MetricRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).MetricRuleFilteringTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTagTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).MetricRuleFilteringTag = (System.Collections.Generic.List) content.GetValueForProperty("MetricRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).MetricRuleFilteringTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTagTypeConverter.ConvertFrom)); } if (content.Contains("LogRuleSendAadLog")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendAadLog = (bool?) content.GetValueForProperty("LogRuleSendAadLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendAadLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendAadLog = (bool?) content.GetValueForProperty("LogRuleSendAadLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendAadLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("LogRuleSendSubscriptionLog")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendSubscriptionLog = (bool?) content.GetValueForProperty("LogRuleSendSubscriptionLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendSubscriptionLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendSubscriptionLog = (bool?) content.GetValueForProperty("LogRuleSendSubscriptionLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendSubscriptionLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("LogRuleSendResourceLog")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendResourceLog = (bool?) content.GetValueForProperty("LogRuleSendResourceLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendResourceLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendResourceLog = (bool?) content.GetValueForProperty("LogRuleSendResourceLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendResourceLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -162,35 +160,35 @@ internal MonitoringTagRulesProperties(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("LogRule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules) content.GetValueForProperty("LogRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LogRulesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules) content.GetValueForProperty("LogRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LogRulesTypeConverter.ConvertFrom); } if (content.Contains("MetricRule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).MetricRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules) content.GetValueForProperty("MetricRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).MetricRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MetricRulesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).MetricRule = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules) content.GetValueForProperty("MetricRule",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).MetricRule, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MetricRulesTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("LogRuleFilteringTag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleFilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]) content.GetValueForProperty("LogRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleFilteringTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTagTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleFilteringTag = (System.Collections.Generic.List) content.GetValueForProperty("LogRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleFilteringTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTagTypeConverter.ConvertFrom)); } if (content.Contains("MetricRuleFilteringTag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).MetricRuleFilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[]) content.GetValueForProperty("MetricRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).MetricRuleFilteringTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.FilteringTagTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).MetricRuleFilteringTag = (System.Collections.Generic.List) content.GetValueForProperty("MetricRuleFilteringTag",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).MetricRuleFilteringTag, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.FilteringTagTypeConverter.ConvertFrom)); } if (content.Contains("LogRuleSendAadLog")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendAadLog = (bool?) content.GetValueForProperty("LogRuleSendAadLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendAadLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendAadLog = (bool?) content.GetValueForProperty("LogRuleSendAadLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendAadLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("LogRuleSendSubscriptionLog")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendSubscriptionLog = (bool?) content.GetValueForProperty("LogRuleSendSubscriptionLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendSubscriptionLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendSubscriptionLog = (bool?) content.GetValueForProperty("LogRuleSendSubscriptionLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendSubscriptionLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("LogRuleSendResourceLog")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendResourceLog = (bool?) content.GetValueForProperty("LogRuleSendResourceLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendResourceLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendResourceLog = (bool?) content.GetValueForProperty("LogRuleSendResourceLog",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal)this).LogRuleSendResourceLog, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesProperties.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesProperties.TypeConverter.cs similarity index 96% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesProperties.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesProperties.TypeConverter.cs index e615bc0ce653..f5a9c6f8c501 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesProperties.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesProperties.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesProperties.cs similarity index 66% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesProperties.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesProperties.cs index 473a6aa9d098..95f31f58a27b 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesProperties.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesProperties.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Definition of the properties for a TagRules resource. public partial class MonitoringTagRulesProperties : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules _logRule; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules _logRule; /// Set of rules for sending logs for the Monitor resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules LogRule { get => (this._logRule = this._logRule ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LogRules()); set => this._logRule = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules LogRule { get => (this._logRule = this._logRule ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LogRules()); set => this._logRule = value; } /// /// List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, @@ -26,28 +26,28 @@ public partial class MonitoringTagRulesProperties : /// resources. If Include actions are specified, the rules will only include resources with the associated tags. /// [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] LogRuleFilteringTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)LogRule).FilteringTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)LogRule).FilteringTag = value ?? null /* arrayOf */; } + public System.Collections.Generic.List LogRuleFilteringTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)LogRule).FilteringTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)LogRule).FilteringTag = value ?? null /* arrayOf */; } /// Flag specifying if AAD logs should be sent for the Monitor resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public bool? LogRuleSendAadLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)LogRule).SendAadLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)LogRule).SendAadLog = value ?? default(bool); } + public bool? LogRuleSendAadLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)LogRule).SendAadLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)LogRule).SendAadLog = value ?? default(bool); } /// Flag specifying if Azure resource logs should be sent for the Monitor resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public bool? LogRuleSendResourceLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)LogRule).SendResourceLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)LogRule).SendResourceLog = value ?? default(bool); } + public bool? LogRuleSendResourceLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)LogRule).SendResourceLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)LogRule).SendResourceLog = value ?? default(bool); } /// /// Flag specifying if Azure subscription logs should be sent for the Monitor resource. /// [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public bool? LogRuleSendSubscriptionLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)LogRule).SendSubscriptionLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRulesInternal)LogRule).SendSubscriptionLog = value ?? default(bool); } + public bool? LogRuleSendSubscriptionLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)LogRule).SendSubscriptionLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRulesInternal)LogRule).SendSubscriptionLog = value ?? default(bool); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules _metricRule; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules _metricRule; /// Set of rules for sending metrics for the Monitor resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules MetricRule { get => (this._metricRule = this._metricRule ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MetricRules()); set => this._metricRule = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules MetricRule { get => (this._metricRule = this._metricRule ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MetricRules()); set => this._metricRule = value; } /// /// List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action @@ -55,22 +55,22 @@ public partial class MonitoringTagRulesProperties : /// will only include resources with the associated tags. /// [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] MetricRuleFilteringTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRulesInternal)MetricRule).FilteringTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRulesInternal)MetricRule).FilteringTag = value ?? null /* arrayOf */; } + public System.Collections.Generic.List MetricRuleFilteringTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRulesInternal)MetricRule).FilteringTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRulesInternal)MetricRule).FilteringTag = value ?? null /* arrayOf */; } /// Internal Acessors for LogRule - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal.LogRule { get => (this._logRule = this._logRule ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LogRules()); set { {_logRule = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal.LogRule { get => (this._logRule = this._logRule ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LogRules()); set { {_logRule = value;} } } /// Internal Acessors for MetricRule - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal.MetricRule { get => (this._metricRule = this._metricRule ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MetricRules()); set { {_metricRule = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal.MetricRule { get => (this._metricRule = this._metricRule ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MetricRules()); set { {_metricRule = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? _provisioningState; + private string _provisioningState; [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Creates an new instance. public MonitoringTagRulesProperties() @@ -90,14 +90,20 @@ public partial interface IMonitoringTagRulesProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", SerializedName = @"filteringTags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] LogRuleFilteringTag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + System.Collections.Generic.List LogRuleFilteringTag { get; set; } /// Flag specifying if AAD logs should be sent for the Monitor resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag specifying if AAD logs should be sent for the Monitor resource.", SerializedName = @"sendAadLogs", PossibleTypes = new [] { typeof(bool) })] @@ -106,6 +112,9 @@ public partial interface IMonitoringTagRulesProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag specifying if Azure resource logs should be sent for the Monitor resource.", SerializedName = @"sendResourceLogs", PossibleTypes = new [] { typeof(bool) })] @@ -116,6 +125,9 @@ public partial interface IMonitoringTagRulesProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Flag specifying if Azure subscription logs should be sent for the Monitor resource.", SerializedName = @"sendSubscriptionLogs", PossibleTypes = new [] { typeof(bool) })] @@ -128,18 +140,25 @@ public partial interface IMonitoringTagRulesProperties : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", SerializedName = @"filteringTags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] MetricRuleFilteringTag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + System.Collections.Generic.List MetricRuleFilteringTag { get; set; } [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; } } /// Definition of the properties for a TagRules resource. @@ -147,13 +166,13 @@ internal partial interface IMonitoringTagRulesPropertiesInternal { /// Set of rules for sending logs for the Monitor resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILogRules LogRule { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILogRules LogRule { get; set; } /// /// List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, /// all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available /// resources. If Include actions are specified, the rules will only include resources with the associated tags. /// - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] LogRuleFilteringTag { get; set; } + System.Collections.Generic.List LogRuleFilteringTag { get; set; } /// Flag specifying if AAD logs should be sent for the Monitor resource. bool? LogRuleSendAadLog { get; set; } /// Flag specifying if Azure resource logs should be sent for the Monitor resource. @@ -163,15 +182,16 @@ internal partial interface IMonitoringTagRulesPropertiesInternal /// bool? LogRuleSendSubscriptionLog { get; set; } /// Set of rules for sending metrics for the Monitor resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMetricRules MetricRule { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMetricRules MetricRule { get; set; } /// /// List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action /// is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules /// will only include resources with the associated tags. /// - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] MetricRuleFilteringTag { get; set; } + System.Collections.Generic.List MetricRuleFilteringTag { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesProperties.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesProperties.json.cs similarity index 92% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesProperties.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesProperties.json.cs index a2b4fcf997da..f34b99ae6142 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/MonitoringTagRulesProperties.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/MonitoringTagRulesProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MonitoringTagRulesProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new MonitoringTagRulesProperties(json) : null; } @@ -77,9 +77,9 @@ internal MonitoringTagRulesProperties(Microsoft.Azure.PowerShell.Cmdlets.Datadog { return; } - {_logRule = If( json?.PropertyT("logRules"), out var __jsonLogRules) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.LogRules.FromJson(__jsonLogRules) : LogRule;} - {_metricRule = If( json?.PropertyT("metricRules"), out var __jsonMetricRules) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MetricRules.FromJson(__jsonMetricRules) : MetricRule;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_logRule = If( json?.PropertyT("logRules"), out var __jsonLogRules) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.LogRules.FromJson(__jsonLogRules) : _logRule;} + {_metricRule = If( json?.PropertyT("metricRules"), out var __jsonMetricRules) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MetricRules.FromJson(__jsonMetricRules) : _metricRule;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode ToJson(M } AddIf( null != this._logRule ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._logRule.ToJson(null,serializationMode) : null, "logRules" ,container.Add ); AddIf( null != this._metricRule ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) this._metricRule.ToJson(null,serializationMode) : null, "metricRules" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationDisplay.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs similarity index 75% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationDisplay.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs index 48646c53270f..3e8ba03ba1c0 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationDisplay.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class OperationDisplay partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationDisplay(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationDisplay(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOpe /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,25 +111,25 @@ internal OperationDisplay(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,19 +144,19 @@ internal OperationDisplay(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationDisplay.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationDisplay.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs index 533dcf446a10..839d7ea405cf 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationDisplay.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationDisplay.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationDisplay.cs similarity index 90% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationDisplay.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/OperationDisplay.cs index 2f2d514ebd2f..70c628a2aece 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationDisplay.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationDisplay.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// The object that represents the operation. public partial class OperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Description of the operation, e.g., 'Write monitors'.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation type, e.g., read, write, delete, etc.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service provider, i.e., Microsoft.Datadog.", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type on which the operation is performed, e.g., 'monitors'.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationDisplay.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationDisplay.json.cs similarity index 93% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationDisplay.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/OperationDisplay.json.cs index 7a5bd1c14796..6b9155c4b640 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationDisplay.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationDisplay.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationDisplay partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; } @@ -77,10 +77,10 @@ internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Jso { return; } - {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} - {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} - {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)_provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)_resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)_operation;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} AfterFromJson(json); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationListResult.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationListResult.PowerShell.cs similarity index 77% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationListResult.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/OperationListResult.PowerShell.cs index c1a01fbba31e..d78fe8c0f91d 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationListResult.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class OperationListResult partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationListResult(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOpe /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal OperationListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationResultTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationResultTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal OperationListResult(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationResultTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationResultTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationListResult.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationListResult.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs index b068c6429805..8b05f002bf32 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationListResult.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationListResult.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationListResult.cs similarity index 74% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationListResult.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/OperationListResult.cs index d312e300c2d3..ecd4de6fadb5 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationListResult.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationListResult.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Result of GET request to list the Microsoft.Datadog operations. public partial class OperationListResult : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResult, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class OperationListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult[] _value; + private System.Collections.Generic.List _value; /// List of operations supported by the Microsoft.Datadog provider. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public OperationListResult() @@ -41,6 +41,9 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"URL to get the next set of operation list results if there are any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of operations supported by the Microsoft.Datadog provider.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult) })] + System.Collections.Generic.List Value { get; set; } } /// Result of GET request to list the Microsoft.Datadog operations. @@ -62,7 +68,7 @@ internal partial interface IOperationListResultInternal /// URL to get the next set of operation list results if there are any. string NextLink { get; set; } /// List of operations supported by the Microsoft.Datadog provider. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationListResult.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationListResult.json.cs similarity index 90% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationListResult.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/OperationListResult.json.cs index 4c550a23986a..e34173cb627e 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationListResult.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; } @@ -77,8 +77,8 @@ internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime. { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationResult.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult) (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationResult.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationResult.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationResult.PowerShell.cs similarity index 66% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationResult.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/OperationResult.PowerShell.cs index f67b74fb6ce0..31d9648a8f37 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationResult.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class OperationResult partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationResult(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOpe /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,37 +111,37 @@ internal OperationResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -156,31 +156,31 @@ internal OperationResult(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationResult.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationResult.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationResult.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/OperationResult.TypeConverter.cs index 2eeb05b7914e..83d40e3dd12d 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationResult.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationResult.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationResult.cs similarity index 76% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationResult.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/OperationResult.cs index 42090d0d9d1c..9441c1879c7a 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationResult.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationResult.cs @@ -3,38 +3,38 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// A Microsoft.Datadog REST API operation. public partial class OperationResult : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay _display; + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay _display; /// The object that represents the operation. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationDisplay()); set => this._display = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationDisplay()); set => this._display = value; } /// Description of the operation, e.g., 'Write monitors'. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)Display).Description = value ?? null; } + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)Display).Description = value ?? null; } /// Operation type, e.g., read, write, delete, etc. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)Display).Operation = value ?? null; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)Display).Operation = value ?? null; } /// Service provider, i.e., Microsoft.Datadog. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)Display).Provider = value ?? null; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)Display).Provider = value ?? null; } /// Type on which the operation is performed, e.g., 'monitors'. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplayInternal)Display).Resource = value ?? null; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplayInternal)Display).Resource = value ?? null; } /// Backing field for property. private bool? _isDataAction; @@ -44,7 +44,7 @@ public partial class OperationResult : public bool? IsDataAction { get => this._isDataAction; set => this._isDataAction = value; } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResultInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationDisplay()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResultInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationDisplay()); set { {_display = value;} } } /// Backing field for property. private string _name; @@ -67,6 +67,9 @@ public partial interface IOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Description of the operation, e.g., 'Write monitors'.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +78,9 @@ public partial interface IOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation type, e.g., read, write, delete, etc.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service provider, i.e., Microsoft.Datadog.", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -91,6 +100,9 @@ public partial interface IOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type on which the operation is performed, e.g., 'monitors'.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +111,9 @@ public partial interface IOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether the operation is a data action", SerializedName = @"isDataAction", PossibleTypes = new [] { typeof(bool) })] @@ -107,6 +122,9 @@ public partial interface IOperationResult : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation name, i.e., {provider}/{resource}/{operation}.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -118,7 +136,7 @@ internal partial interface IOperationResultInternal { /// The object that represents the operation. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationDisplay Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationDisplay Display { get; set; } /// Description of the operation, e.g., 'Write monitors'. string DisplayDescription { get; set; } /// Operation type, e.g., read, write, delete, etc. diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationResult.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationResult.json.cs similarity index 94% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationResult.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/OperationResult.json.cs index 5c513f0fb8af..d6d8f430e426 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/OperationResult.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/OperationResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new OperationResult(json) : null; } @@ -77,9 +77,9 @@ internal OperationResult(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.OperationDisplay.FromJson(__jsonDisplay) : Display;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : IsDataAction;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.OperationDisplay.FromJson(__jsonDisplay) : _display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : _isDataAction;} AfterFromJson(json); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/ResourceSku.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ResourceSku.PowerShell.cs similarity index 85% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/ResourceSku.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ResourceSku.PowerShell.cs index 394ff07b71b8..cd37a3af6aab 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/ResourceSku.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ResourceSku.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -62,27 +62,27 @@ public partial class ResourceSku partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ResourceSku(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceSku(content); } @@ -92,10 +92,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IRes /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -110,13 +110,13 @@ internal ResourceSku(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSkuInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSkuInternal)this).Name, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -131,7 +131,7 @@ internal ResourceSku(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSkuInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSkuInternal)this).Name, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/ResourceSku.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ResourceSku.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/ResourceSku.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ResourceSku.TypeConverter.cs index ca5fae5c56b3..8f104df6a1c2 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/ResourceSku.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ResourceSku.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/ResourceSku.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ResourceSku.cs similarity index 84% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/ResourceSku.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ResourceSku.cs index ff9d3d5fd196..a606dea1a726 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/ResourceSku.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ResourceSku.cs @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; public partial class ResourceSku : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSkuInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSkuInternal { /// Backing field for property. @@ -32,6 +32,9 @@ public partial interface IResourceSku : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the SKU.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/ResourceSku.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/ResourceSku.json.cs similarity index 93% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/ResourceSku.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/ResourceSku.json.cs index 394727b1e9b6..5d058111c453 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/ResourceSku.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/ResourceSku.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -53,13 +53,11 @@ public partial class ResourceSku partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IResourceSku FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku. + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IResourceSku FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new ResourceSku(json) : null; } @@ -76,7 +74,7 @@ internal ResourceSku(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.Jso { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/SystemData.PowerShell.cs similarity index 67% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/SystemData.PowerShell.cs index ad0f7e920b65..f5d3b53519f6 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/SystemData.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class SystemData partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SystemData(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SystemData(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDat /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,33 +111,33 @@ internal SystemData(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("CreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -152,27 +152,27 @@ internal SystemData(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("CreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/SystemData.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/SystemData.TypeConverter.cs index 65f162b2c0b9..a46b3abbb592 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/SystemData.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/SystemData.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/SystemData.cs similarity index 78% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/SystemData.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/SystemData.cs index c8093eb6ce88..39eb4aecb773 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/SystemData.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/SystemData.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// Metadata pertaining to creation and last modification of the resource. public partial class SystemData : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemDataInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemDataInternal { /// Backing field for property. @@ -28,11 +28,11 @@ public partial class SystemData : public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? _createdByType; + private string _createdByType; /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? CreatedByType { get => this._createdByType; set => this._createdByType = value; } + public string CreatedByType { get => this._createdByType; set => this._createdByType = value; } /// Backing field for property. private global::System.DateTime? _lastModifiedAt; @@ -49,11 +49,11 @@ public partial class SystemData : public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? _lastModifiedByType; + private string _lastModifiedByType; /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Origin(Microsoft.Azure.PowerShell.Cmdlets.Datadog.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } + public string LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } /// Creates an new instance. public SystemData() @@ -69,6 +69,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -77,6 +80,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] @@ -85,14 +91,21 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? CreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -101,6 +114,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] @@ -109,10 +125,14 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? LastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } /// Metadata pertaining to creation and last modification of the resource. @@ -124,13 +144,15 @@ internal partial interface ISystemDataInternal /// The identity that created the resource. string CreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? CreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? LastModifiedAt { get; set; } /// The identity that last modified the resource. string LastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType? LastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/SystemData.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/SystemData.json.cs similarity index 93% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/SystemData.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/SystemData.json.cs index 46e717089b66..794dddc59880 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20/SystemData.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/SystemData.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class SystemData partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData. + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new SystemData(json) : null; } @@ -77,12 +75,12 @@ internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.Json { return; } - {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy;} - {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)CreatedByType;} - {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : CreatedAt : CreatedAt;} - {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)LastModifiedBy;} - {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)LastModifiedByType;} - {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : LastModifiedAt : LastModifiedAt;} + {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)_createdBy;} + {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)_createdByType;} + {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : _createdAt : _createdAt;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)_lastModifiedBy;} + {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)_lastModifiedByType;} + {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : _lastModifiedAt : _lastModifiedAt;} AfterFromJson(json); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/UserInfo.PowerShell.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/UserInfo.PowerShell.cs similarity index 79% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/UserInfo.PowerShell.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/UserInfo.PowerShell.cs index 70fa32fadabd..e6c9ac144289 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/UserInfo.PowerShell.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/UserInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class UserInfo partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new UserInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new UserInfo(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUse /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,21 +128,21 @@ internal UserInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("EmailAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)this).EmailAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)this).EmailAddress, global::System.Convert.ToString); } if (content.Contains("PhoneNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)this).PhoneNumber = (string) content.GetValueForProperty("PhoneNumber",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)this).PhoneNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)this).PhoneNumber = (string) content.GetValueForProperty("PhoneNumber",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)this).PhoneNumber, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -157,15 +157,15 @@ internal UserInfo(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("EmailAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)this).EmailAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)this).EmailAddress = (string) content.GetValueForProperty("EmailAddress",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)this).EmailAddress, global::System.Convert.ToString); } if (content.Contains("PhoneNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)this).PhoneNumber = (string) content.GetValueForProperty("PhoneNumber",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal)this).PhoneNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)this).PhoneNumber = (string) content.GetValueForProperty("PhoneNumber",((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal)this).PhoneNumber, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/UserInfo.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/UserInfo.TypeConverter.cs similarity index 97% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/UserInfo.TypeConverter.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/UserInfo.TypeConverter.cs index 8bee2b4cccfa..17c582f70cf9 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/UserInfo.TypeConverter.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/UserInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/UserInfo.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/UserInfo.cs similarity index 90% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/UserInfo.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/UserInfo.cs index 1f3c397e4b48..8af6f2b27af3 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/UserInfo.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/UserInfo.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; /// User info public partial class UserInfo : - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfoInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IUserInfo : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email of the user used by Datadog for contacting them if needed", SerializedName = @"emailAddress", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IUserInfo : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the user", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IUserInfo : [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Phone number of the user used by Datadog for contacting them if needed", SerializedName = @"phoneNumber", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/UserInfo.json.cs b/generated/Datadog/Datadog.Autorest/generated/api/Models/UserInfo.json.cs similarity index 93% rename from generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/UserInfo.json.cs rename to generated/Datadog/Datadog.Autorest/generated/api/Models/UserInfo.json.cs index d356f29e2706..92d14d9d705d 100644 --- a/generated/Datadog/Datadog.Autorest/generated/api/Models/Api20210301/UserInfo.json.cs +++ b/generated/Datadog/Datadog.Autorest/generated/api/Models/UserInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301 +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class UserInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IUserInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo. + public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IUserInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonObject json ? new UserInfo(json) : null; } @@ -103,9 +101,9 @@ internal UserInfo(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Json.JsonOb { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_emailAddress = If( json?.PropertyT("emailAddress"), out var __jsonEmailAddress) ? (string)__jsonEmailAddress : (string)EmailAddress;} - {_phoneNumber = If( json?.PropertyT("phoneNumber"), out var __jsonPhoneNumber) ? (string)__jsonPhoneNumber : (string)PhoneNumber;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_emailAddress = If( json?.PropertyT("emailAddress"), out var __jsonEmailAddress) ? (string)__jsonEmailAddress : (string)_emailAddress;} + {_phoneNumber = If( json?.PropertyT("phoneNumber"), out var __jsonPhoneNumber) ? (string)__jsonPhoneNumber : (string)_phoneNumber;} AfterFromJson(json); } } diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/CreatedByType.Completer.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/CreatedByType.Completer.cs deleted file mode 100644 index d917f0a68128..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/CreatedByType.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// The type of identity that created the resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByTypeTypeConverter))] - public partial struct CreatedByType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Application".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Application'", "Application", global::System.Management.Automation.CompletionResultType.ParameterValue, "Application"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ManagedIdentity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ManagedIdentity'", "ManagedIdentity", global::System.Management.Automation.CompletionResultType.ParameterValue, "ManagedIdentity"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Key".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Key'", "Key", global::System.Management.Automation.CompletionResultType.ParameterValue, "Key"); - } - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs deleted file mode 100644 index 797356f8f750..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// The type of identity that created the resource. - public partial class CreatedByTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CreatedByType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/CreatedByType.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/CreatedByType.cs deleted file mode 100644 index 002bd66f01f7..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/CreatedByType.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// The type of identity that created the resource. - public partial struct CreatedByType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType Key = @"Key"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType User = @"User"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to CreatedByType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CreatedByType(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private CreatedByType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type CreatedByType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type CreatedByType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is CreatedByType && Equals((CreatedByType)obj); - } - - /// Returns hashCode for enum CreatedByType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CreatedByType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CreatedByType - /// the value to convert to an instance of . - - public static implicit operator CreatedByType(string value) - { - return new CreatedByType(value); - } - - /// Implicit operator to convert CreatedByType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType e) - { - return e._value; - } - - /// Overriding != operator for enum CreatedByType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CreatedByType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.CreatedByType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/LiftrResourceCategories.Completer.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/LiftrResourceCategories.Completer.cs deleted file mode 100644 index 158e19134754..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/LiftrResourceCategories.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// Argument completer implementation for LiftrResourceCategories. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategoriesTypeConverter))] - public partial struct LiftrResourceCategories : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Unknown'", "Unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unknown"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "MonitorLogs".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MonitorLogs'", "MonitorLogs", global::System.Management.Automation.CompletionResultType.ParameterValue, "MonitorLogs"); - } - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/LiftrResourceCategories.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/LiftrResourceCategories.TypeConverter.cs deleted file mode 100644 index 47f72064928c..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/LiftrResourceCategories.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// TypeConverter implementation for LiftrResourceCategories. - public partial class LiftrResourceCategoriesTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => LiftrResourceCategories.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/LiftrResourceCategories.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/LiftrResourceCategories.cs deleted file mode 100644 index 5b040b8a0e9b..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/LiftrResourceCategories.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - public partial struct LiftrResourceCategories : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories MonitorLogs = @"MonitorLogs"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories Unknown = @"Unknown"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to LiftrResourceCategories - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new LiftrResourceCategories(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type LiftrResourceCategories - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type LiftrResourceCategories (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is LiftrResourceCategories && Equals((LiftrResourceCategories)obj); - } - - /// Returns hashCode for enum LiftrResourceCategories - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private LiftrResourceCategories(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for LiftrResourceCategories - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to LiftrResourceCategories - /// the value to convert to an instance of . - - public static implicit operator LiftrResourceCategories(string value) - { - return new LiftrResourceCategories(value); - } - - /// Implicit operator to convert LiftrResourceCategories to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories e) - { - return e._value; - } - - /// Overriding != operator for enum LiftrResourceCategories - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum LiftrResourceCategories - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.LiftrResourceCategories e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/ManagedIdentityTypes.Completer.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/ManagedIdentityTypes.Completer.cs deleted file mode 100644 index 3811b6c29819..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/ManagedIdentityTypes.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// Identity type - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypesTypeConverter))] - public partial struct ManagedIdentityTypes : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SystemAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SystemAssigned'", "SystemAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemAssigned"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "UserAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'UserAssigned'", "UserAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "UserAssigned"); - } - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/ManagedIdentityTypes.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/ManagedIdentityTypes.TypeConverter.cs deleted file mode 100644 index 0455e7330cdd..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/ManagedIdentityTypes.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// Identity type - public partial class ManagedIdentityTypesTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ManagedIdentityTypes.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/ManagedIdentityTypes.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/ManagedIdentityTypes.cs deleted file mode 100644 index c6b186fda723..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/ManagedIdentityTypes.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// Identity type - public partial struct ManagedIdentityTypes : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes SystemAssigned = @"SystemAssigned"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes UserAssigned = @"UserAssigned"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ManagedIdentityTypes - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ManagedIdentityTypes(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ManagedIdentityTypes - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ManagedIdentityTypes (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is ManagedIdentityTypes && Equals((ManagedIdentityTypes)obj); - } - - /// Returns hashCode for enum ManagedIdentityTypes - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ManagedIdentityTypes(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ManagedIdentityTypes - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ManagedIdentityTypes - /// the value to convert to an instance of . - - public static implicit operator ManagedIdentityTypes(string value) - { - return new ManagedIdentityTypes(value); - } - - /// Implicit operator to convert ManagedIdentityTypes to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes e) - { - return e._value; - } - - /// Overriding != operator for enum ManagedIdentityTypes - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ManagedIdentityTypes - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/MarketplaceSubscriptionStatus.Completer.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/MarketplaceSubscriptionStatus.Completer.cs deleted file mode 100644 index 253afe420f85..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/MarketplaceSubscriptionStatus.Completer.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// - /// Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will - /// go in Suspended state. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatusTypeConverter))] - public partial struct MarketplaceSubscriptionStatus : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Active".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Active'", "Active", global::System.Management.Automation.CompletionResultType.ParameterValue, "Active"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Suspended".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Suspended'", "Suspended", global::System.Management.Automation.CompletionResultType.ParameterValue, "Suspended"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unsubscribed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Unsubscribed'", "Unsubscribed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unsubscribed"); - } - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/MarketplaceSubscriptionStatus.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/MarketplaceSubscriptionStatus.TypeConverter.cs deleted file mode 100644 index 566e481b0796..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/MarketplaceSubscriptionStatus.TypeConverter.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// - /// Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will - /// go in Suspended state. - /// - public partial class MarketplaceSubscriptionStatusTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MarketplaceSubscriptionStatus.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/MarketplaceSubscriptionStatus.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/MarketplaceSubscriptionStatus.cs deleted file mode 100644 index 14411fa2b109..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/MarketplaceSubscriptionStatus.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// - /// Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will - /// go in Suspended state. - /// - public partial struct MarketplaceSubscriptionStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus Active = @"Active"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus Suspended = @"Suspended"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus Unsubscribed = @"Unsubscribed"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to MarketplaceSubscriptionStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new MarketplaceSubscriptionStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type MarketplaceSubscriptionStatus - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type MarketplaceSubscriptionStatus (override for Object) - /// - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is MarketplaceSubscriptionStatus && Equals((MarketplaceSubscriptionStatus)obj); - } - - /// Returns hashCode for enum MarketplaceSubscriptionStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private MarketplaceSubscriptionStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for MarketplaceSubscriptionStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to MarketplaceSubscriptionStatus - /// the value to convert to an instance of . - - public static implicit operator MarketplaceSubscriptionStatus(string value) - { - return new MarketplaceSubscriptionStatus(value); - } - - /// Implicit operator to convert MarketplaceSubscriptionStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus e) - { - return e._value; - } - - /// Overriding != operator for enum MarketplaceSubscriptionStatus - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum MarketplaceSubscriptionStatus - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MarketplaceSubscriptionStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/MonitoringStatus.Completer.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/MonitoringStatus.Completer.cs deleted file mode 100644 index e7a717aca655..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/MonitoringStatus.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// Flag specifying if the resource monitoring is enabled or disabled. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatusTypeConverter))] - public partial struct MonitoringStatus : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); - } - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/MonitoringStatus.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/MonitoringStatus.TypeConverter.cs deleted file mode 100644 index 7c0a18d610fa..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/MonitoringStatus.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// Flag specifying if the resource monitoring is enabled or disabled. - public partial class MonitoringStatusTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MonitoringStatus.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/MonitoringStatus.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/MonitoringStatus.cs deleted file mode 100644 index 5d4906fe5fe9..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/MonitoringStatus.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// Flag specifying if the resource monitoring is enabled or disabled. - public partial struct MonitoringStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus Enabled = @"Enabled"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to MonitoringStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new MonitoringStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type MonitoringStatus - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type MonitoringStatus (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is MonitoringStatus && Equals((MonitoringStatus)obj); - } - - /// Returns hashCode for enum MonitoringStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private MonitoringStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for MonitoringStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to MonitoringStatus - /// the value to convert to an instance of . - - public static implicit operator MonitoringStatus(string value) - { - return new MonitoringStatus(value); - } - - /// Implicit operator to convert MonitoringStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus e) - { - return e._value; - } - - /// Overriding != operator for enum MonitoringStatus - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum MonitoringStatus - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/ProvisioningState.Completer.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/ProvisioningState.Completer.cs deleted file mode 100644 index e79c04b21be0..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/ProvisioningState.Completer.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// Argument completer implementation for ProvisioningState. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningStateTypeConverter))] - public partial struct ProvisioningState : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Accepted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Accepted'", "Accepted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Accepted"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleted'", "Deleted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleted"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotSpecified".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NotSpecified'", "NotSpecified", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotSpecified"); - } - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/ProvisioningState.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/ProvisioningState.TypeConverter.cs deleted file mode 100644 index 5aac980e5ef9..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/ProvisioningState.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// TypeConverter implementation for ProvisioningState. - public partial class ProvisioningStateTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ProvisioningState.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/ProvisioningState.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/ProvisioningState.cs deleted file mode 100644 index b4233a536e0a..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/ProvisioningState.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - public partial struct ProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState Creating = @"Creating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState Deleted = @"Deleted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState NotSpecified = @"NotSpecified"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState Updating = @"Updating"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ProvisioningState - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ProvisioningState (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is ProvisioningState && Equals((ProvisioningState)obj); - } - - /// Returns hashCode for enum ProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ProvisioningState - /// the value to convert to an instance of . - - public static implicit operator ProvisioningState(string value) - { - return new ProvisioningState(value); - } - - /// Implicit operator to convert ProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum ProvisioningState - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ProvisioningState - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/SingleSignOnStates.Completer.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/SingleSignOnStates.Completer.cs deleted file mode 100644 index cbf3bb0ac7f3..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/SingleSignOnStates.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// Various states of the SSO resource - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStatesTypeConverter))] - public partial struct SingleSignOnStates : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Initial".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Initial'", "Initial", global::System.Management.Automation.CompletionResultType.ParameterValue, "Initial"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Enable'", "Enable", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enable"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disable'", "Disable", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disable"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Existing".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Existing'", "Existing", global::System.Management.Automation.CompletionResultType.ParameterValue, "Existing"); - } - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/SingleSignOnStates.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/SingleSignOnStates.TypeConverter.cs deleted file mode 100644 index 627f3792386c..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/SingleSignOnStates.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// Various states of the SSO resource - public partial class SingleSignOnStatesTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SingleSignOnStates.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/SingleSignOnStates.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/SingleSignOnStates.cs deleted file mode 100644 index 6bcc9ac2ef78..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/SingleSignOnStates.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// Various states of the SSO resource - public partial struct SingleSignOnStates : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates Disable = @"Disable"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates Enable = @"Enable"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates Existing = @"Existing"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates Initial = @"Initial"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to SingleSignOnStates - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new SingleSignOnStates(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type SingleSignOnStates - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type SingleSignOnStates (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is SingleSignOnStates && Equals((SingleSignOnStates)obj); - } - - /// Returns hashCode for enum SingleSignOnStates - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private SingleSignOnStates(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for SingleSignOnStates - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to SingleSignOnStates - /// the value to convert to an instance of . - - public static implicit operator SingleSignOnStates(string value) - { - return new SingleSignOnStates(value); - } - - /// Implicit operator to convert SingleSignOnStates to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates e) - { - return e._value; - } - - /// Overriding != operator for enum SingleSignOnStates - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum SingleSignOnStates - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/TagAction.Completer.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/TagAction.Completer.cs deleted file mode 100644 index 56ae6afc0fe6..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/TagAction.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// Valid actions for a filtering tag. Exclusion takes priority over inclusion. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagActionTypeConverter))] - public partial struct TagAction : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Include".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Include'", "Include", global::System.Management.Automation.CompletionResultType.ParameterValue, "Include"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Exclude".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Exclude'", "Exclude", global::System.Management.Automation.CompletionResultType.ParameterValue, "Exclude"); - } - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/TagAction.TypeConverter.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/TagAction.TypeConverter.cs deleted file mode 100644 index 40dc32e77f35..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/TagAction.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// Valid actions for a filtering tag. Exclusion takes priority over inclusion. - public partial class TagActionTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => TagAction.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/api/Support/TagAction.cs b/generated/Datadog/Datadog.Autorest/generated/api/Support/TagAction.cs deleted file mode 100644 index 175cca4e4ee7..000000000000 --- a/generated/Datadog/Datadog.Autorest/generated/api/Support/TagAction.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support -{ - - /// Valid actions for a filtering tag. Exclusion takes priority over inclusion. - public partial struct TagAction : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction Exclude = @"Exclude"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction Include = @"Include"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to TagAction - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new TagAction(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type TagAction - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type TagAction (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is TagAction && Equals((TagAction)obj); - } - - /// Returns hashCode for enum TagAction - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private TagAction(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for TagAction - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to TagAction - /// the value to convert to an instance of . - - public static implicit operator TagAction(string value) - { - return new TagAction(value); - } - - /// Implicit operator to convert TagAction to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction e) - { - return e._value; - } - - /// Overriding != operator for enum TagAction - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum TagAction - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction e1, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.TagAction e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMarketplaceAgreement_List.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMarketplaceAgreement_List.cs index 71118f9f85b0..76747c62d93d 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMarketplaceAgreement_List.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMarketplaceAgreement_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// List Datadog marketplace agreements in the subscription. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogMarketplaceAgreement_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"List Datadog marketplace agreements in the subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements", ApiVersion = "2021-03-01")] public partial class GetAzDatadogMarketplaceAgreement_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzDatadogMarketplaceAgreement_List : global::System.Mana /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzDatadogMarketplaceAgreement_List : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -84,7 +105,7 @@ public partial class GetAzDatadogMarketplaceAgreement_List : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,7 +137,8 @@ public partial class GetAzDatadogMarketplaceAgreement_List : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -125,24 +147,24 @@ public partial class GetAzDatadogMarketplaceAgreement_List : global::System.Mana /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -165,6 +187,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -186,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogMarketplaceAgreement_List() { @@ -237,8 +264,33 @@ public GetAzDatadogMarketplaceAgreement_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -291,7 +343,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -312,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -350,12 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -372,15 +424,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -390,12 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResourceListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -407,15 +459,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResourceListResponse + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorApiKey_List.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorApiKey_List.cs index b39de8f6c1a7..5b8e7c5559ec 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorApiKey_List.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorApiKey_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// List the api keys for a given monitor resource. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] ListApiKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listApiKeys" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogMonitorApiKey_List", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"List the api keys for a given monitor resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listApiKeys", ApiVersion = "2021-03-01")] public partial class GetAzDatadogMonitorApiKey_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzDatadogMonitorApiKey_List : global::System.Management. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzDatadogMonitorApiKey_List : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -98,7 +119,7 @@ public partial class GetAzDatadogMonitorApiKey_List : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -144,7 +165,8 @@ public partial class GetAzDatadogMonitorApiKey_List : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -153,24 +175,24 @@ public partial class GetAzDatadogMonitorApiKey_List : global::System.Management. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -193,6 +215,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -214,7 +241,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogMonitorApiKey_List() { @@ -265,8 +292,33 @@ public GetAzDatadogMonitorApiKey_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -322,7 +374,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -343,7 +395,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -381,12 +433,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -403,15 +455,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -421,12 +473,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKeyListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -438,15 +490,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKeyListResponse + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorDefaultKey_Get.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorDefaultKey_Get.cs index aa7e05398967..7a0cd1236f4f 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorDefaultKey_Get.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorDefaultKey_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Get the default api key. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] GetDefaultKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getDefaultKey" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogMonitorDefaultKey_Get", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Get the default api key.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getDefaultKey", ApiVersion = "2021-03-01")] public partial class GetAzDatadogMonitorDefaultKey_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzDatadogMonitorDefaultKey_Get : global::System.Manageme /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzDatadogMonitorDefaultKey_Get : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -92,7 +113,7 @@ public partial class GetAzDatadogMonitorDefaultKey_Get : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -138,7 +159,8 @@ public partial class GetAzDatadogMonitorDefaultKey_Get : global::System.Manageme [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -147,24 +169,24 @@ public partial class GetAzDatadogMonitorDefaultKey_Get : global::System.Manageme /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -187,6 +209,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -208,7 +235,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogMonitorDefaultKey_Get() { @@ -259,8 +286,33 @@ public GetAzDatadogMonitorDefaultKey_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -316,7 +368,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -337,7 +389,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -375,12 +427,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -397,15 +449,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -415,12 +467,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -432,8 +484,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorDefaultKey_GetViaIdentity.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorDefaultKey_GetViaIdentity.cs index 3b0d47f2676a..6182010520f9 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorDefaultKey_GetViaIdentity.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorDefaultKey_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Get the default api key. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] GetDefaultKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getDefaultKey" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogMonitorDefaultKey_GetViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Get the default api key.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getDefaultKey", ApiVersion = "2021-03-01")] public partial class GetAzDatadogMonitorDefaultKey_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzDatadogMonitorDefaultKey_GetViaIdentity : global::Syst /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzDatadogMonitorDefaultKey_GetViaIdentity : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,7 +107,7 @@ public partial class GetAzDatadogMonitorDefaultKey_GetViaIdentity : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -109,24 +130,24 @@ public partial class GetAzDatadogMonitorDefaultKey_GetViaIdentity : global::Syst /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogMonitorDefaultKey_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzDatadogMonitorDefaultKey_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -278,7 +329,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -316,7 +367,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -354,12 +405,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -376,7 +427,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -394,12 +445,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -411,8 +462,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorHost_List.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorHost_List.cs index 79188c92eb07..3deb660083d7 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorHost_List.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorHost_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// List the hosts for a given monitor resource. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] ListHosts=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listHosts" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogMonitorHost_List", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHost))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHost))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"List the hosts for a given monitor resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listHosts", ApiVersion = "2021-03-01")] public partial class GetAzDatadogMonitorHost_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzDatadogMonitorHost_List : global::System.Management.Au /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzDatadogMonitorHost_List : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -98,7 +119,7 @@ public partial class GetAzDatadogMonitorHost_List : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -144,7 +165,8 @@ public partial class GetAzDatadogMonitorHost_List : global::System.Management.Au [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -153,24 +175,24 @@ public partial class GetAzDatadogMonitorHost_List : global::System.Management.Au /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -193,6 +215,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -214,7 +241,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogMonitorHost_List() { @@ -265,8 +292,33 @@ public GetAzDatadogMonitorHost_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -322,7 +374,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -343,7 +395,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -381,12 +433,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -403,15 +455,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -421,12 +473,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogHostListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -438,15 +490,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogHostListResponse + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorLinkedResource_List.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorLinkedResource_List.cs index 17dde285a483..826665e2b3e9 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorLinkedResource_List.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorLinkedResource_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] ListLinkedResources=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listLinkedResources" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogMonitorLinkedResource_List", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"List all Azure resources associated to the same Datadog organization as the target resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listLinkedResources", ApiVersion = "2021-03-01")] public partial class GetAzDatadogMonitorLinkedResource_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,17 +39,32 @@ public partial class GetAzDatadogMonitorLinkedResource_List : global::System.Man /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -60,6 +78,9 @@ public partial class GetAzDatadogMonitorLinkedResource_List : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -100,7 +121,7 @@ public partial class GetAzDatadogMonitorLinkedResource_List : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -146,7 +167,8 @@ public partial class GetAzDatadogMonitorLinkedResource_List : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -155,24 +177,24 @@ public partial class GetAzDatadogMonitorLinkedResource_List : global::System.Man /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -195,6 +217,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -216,7 +243,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogMonitorLinkedResource_List() { @@ -267,8 +294,33 @@ public GetAzDatadogMonitorLinkedResource_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -324,7 +376,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -345,7 +397,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -383,12 +435,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -405,15 +457,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -423,12 +475,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.ILinkedResourceListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -440,15 +492,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.ILinkedResourceListResponse + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorMonitoredResource_List.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorMonitoredResource_List.cs index baa5dc880817..20debccba4e3 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorMonitoredResource_List.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitorMonitoredResource_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// List the resources currently being monitored by the Datadog monitor resource. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] ListMonitoredResources=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listMonitoredResources" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogMonitorMonitoredResource_List", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"List the resources currently being monitored by the Datadog monitor resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listMonitoredResources", ApiVersion = "2021-03-01")] public partial class GetAzDatadogMonitorMonitoredResource_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzDatadogMonitorMonitoredResource_List : global::System. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzDatadogMonitorMonitoredResource_List : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -98,7 +119,7 @@ public partial class GetAzDatadogMonitorMonitoredResource_List : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -144,7 +165,8 @@ public partial class GetAzDatadogMonitorMonitoredResource_List : global::System. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -153,24 +175,24 @@ public partial class GetAzDatadogMonitorMonitoredResource_List : global::System. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -193,6 +215,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -214,7 +241,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogMonitorMonitoredResource_List() { @@ -265,8 +292,33 @@ public GetAzDatadogMonitorMonitoredResource_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -322,7 +374,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -343,7 +395,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -381,12 +433,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -403,15 +455,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -421,12 +473,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoredResourceListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -438,15 +490,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoredResourceListResponse + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_Get.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_Get.cs index 6b23dbaeb01c..793f06c96760 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_Get.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Get the properties of a specific monitor resource. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogMonitor_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Get the properties of a specific monitor resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", ApiVersion = "2021-03-01")] public partial class GetAzDatadogMonitor_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzDatadogMonitor_Get : global::System.Management.Automat /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzDatadogMonitor_Get : global::System.Management.Automat [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class GetAzDatadogMonitor_Get : global::System.Management.Automat /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -139,7 +160,8 @@ public partial class GetAzDatadogMonitor_Get : global::System.Management.Automat [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -148,24 +170,24 @@ public partial class GetAzDatadogMonitor_Get : global::System.Management.Automat /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -188,6 +210,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -209,7 +236,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogMonitor_Get() { @@ -260,8 +287,33 @@ public GetAzDatadogMonitor_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -314,7 +366,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -373,12 +425,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -395,15 +447,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -413,12 +465,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -430,8 +482,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_GetViaIdentity.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_GetViaIdentity.cs index 6c7e527347b5..aceaa37e8efb 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_GetViaIdentity.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Get the properties of a specific monitor resource. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogMonitor_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Get the properties of a specific monitor resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", ApiVersion = "2021-03-01")] public partial class GetAzDatadogMonitor_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzDatadogMonitor_GetViaIdentity : global::System.Managem /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzDatadogMonitor_GetViaIdentity : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,7 +107,7 @@ public partial class GetAzDatadogMonitor_GetViaIdentity : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -109,24 +130,24 @@ public partial class GetAzDatadogMonitor_GetViaIdentity : global::System.Managem /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogMonitor_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzDatadogMonitor_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -351,12 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -373,7 +424,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -391,12 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -408,8 +459,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_List.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_List.cs index d209b1da6161..c3d62da0a926 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_List.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// List all monitors under the specified subscription. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogMonitor_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"List all monitors under the specified subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors", ApiVersion = "2021-03-01")] public partial class GetAzDatadogMonitor_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzDatadogMonitor_List : global::System.Management.Automa /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzDatadogMonitor_List : global::System.Management.Automa [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -84,7 +105,7 @@ public partial class GetAzDatadogMonitor_List : global::System.Management.Automa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,7 +137,8 @@ public partial class GetAzDatadogMonitor_List : global::System.Management.Automa [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -125,24 +147,24 @@ public partial class GetAzDatadogMonitor_List : global::System.Management.Automa /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -165,6 +187,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -186,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogMonitor_List() { @@ -237,8 +264,33 @@ public GetAzDatadogMonitor_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -291,7 +343,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -312,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -350,12 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -372,15 +424,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -390,12 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -407,15 +459,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_List1.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_List1.cs index f5fdc503943d..d30b0aabd72a 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_List1.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogMonitor_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// List all monitors under the specified resource group. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogMonitor_List1")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"List all monitors under the specified resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors", ApiVersion = "2021-03-01")] public partial class GetAzDatadogMonitor_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzDatadogMonitor_List1 : global::System.Management.Autom /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzDatadogMonitor_List1 : global::System.Management.Autom [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -84,7 +105,7 @@ public partial class GetAzDatadogMonitor_List1 : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -130,7 +151,8 @@ public partial class GetAzDatadogMonitor_List1 : global::System.Management.Autom [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -139,24 +161,24 @@ public partial class GetAzDatadogMonitor_List1 : global::System.Management.Autom /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -179,6 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -200,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogMonitor_List1() { @@ -251,8 +278,33 @@ public GetAzDatadogMonitor_List1() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -305,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -326,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -364,12 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -386,15 +438,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -404,12 +456,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -421,15 +473,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceListResponse + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogOperation_List.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogOperation_List.cs index 23ade5df76d5..76452c1ff127 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogOperation_List.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"List all operations provided by Microsoft.Datadog for the 2021-03-01 api version.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/providers/Microsoft.Datadog/operations", ApiVersion = "2021-03-01")] public partial class GetAzDatadogOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,17 +40,32 @@ public partial class GetAzDatadogOperation_List : global::System.Management.Auto /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -61,6 +79,9 @@ public partial class GetAzDatadogOperation_List : global::System.Management.Auto [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -87,7 +108,7 @@ public partial class GetAzDatadogOperation_List : global::System.Management.Auto /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -110,24 +131,24 @@ public partial class GetAzDatadogOperation_List : global::System.Management.Auto /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -150,6 +171,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +197,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogOperation_List() { @@ -222,8 +248,33 @@ public GetAzDatadogOperation_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +327,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -294,7 +345,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -332,12 +383,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -354,7 +405,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -372,12 +423,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -389,15 +440,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_Get.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_Get.cs index 938b3307d549..5a83c1ca5b0b 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_Get.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Gets the datadog single sign-on resource for the given Monitor. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogSingleSignOnConfiguration_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Gets the datadog single sign-on resource for the given Monitor.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", ApiVersion = "2021-03-01")] public partial class GetAzDatadogSingleSignOnConfiguration_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzDatadogSingleSignOnConfiguration_Get : global::System. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzDatadogSingleSignOnConfiguration_Get : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -106,7 +127,7 @@ public partial class GetAzDatadogSingleSignOnConfiguration_Get : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -152,7 +173,8 @@ public partial class GetAzDatadogSingleSignOnConfiguration_Get : global::System. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -161,24 +183,24 @@ public partial class GetAzDatadogSingleSignOnConfiguration_Get : global::System. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -201,6 +223,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -222,7 +249,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogSingleSignOnConfiguration_Get() { @@ -273,8 +300,33 @@ public GetAzDatadogSingleSignOnConfiguration_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -327,7 +379,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -348,7 +400,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -386,12 +438,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -408,15 +460,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MonitorName=MonitorName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MonitorName=MonitorName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -426,12 +478,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -443,8 +495,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_GetViaIdentity.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_GetViaIdentity.cs index 6b65d0c83256..c3f34702bf53 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_GetViaIdentity.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Gets the datadog single sign-on resource for the given Monitor. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogSingleSignOnConfiguration_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Gets the datadog single sign-on resource for the given Monitor.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", ApiVersion = "2021-03-01")] public partial class GetAzDatadogSingleSignOnConfiguration_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzDatadogSingleSignOnConfiguration_GetViaIdentity : glob /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzDatadogSingleSignOnConfiguration_GetViaIdentity : glob [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,7 +107,7 @@ public partial class GetAzDatadogSingleSignOnConfiguration_GetViaIdentity : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -109,24 +130,24 @@ public partial class GetAzDatadogSingleSignOnConfiguration_GetViaIdentity : glob /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogSingleSignOnConfiguration_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzDatadogSingleSignOnConfiguration_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -317,7 +368,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,12 +406,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,7 +428,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -395,12 +446,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -412,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_GetViaIdentityMonitor.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_GetViaIdentityMonitor.cs new file mode 100644 index 000000000000..60c227f04107 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_GetViaIdentityMonitor.cs @@ -0,0 +1,500 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// Gets the datadog single sign-on resource for the given Monitor. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogSingleSignOnConfiguration_GetViaIdentityMonitor")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Gets the datadog single sign-on resource for the given Monitor.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", ApiVersion = "2021-03-01")] + public partial class GetAzDatadogSingleSignOnConfiguration_GetViaIdentityMonitor : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity _monitorInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity MonitorInputObject { get => this._monitorInputObject; set => this._monitorInputObject = value; } + + /// Backing field for property. + private string _name; + + /// Configuration name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Configuration name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Configuration name", + SerializedName = @"configurationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzDatadogSingleSignOnConfiguration_GetViaIdentityMonitor() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (MonitorInputObject?.Id != null) + { + this.MonitorInputObject.Id += $"/singleSignOnConfigurations/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.SingleSignOnConfigurationsGetViaIdentity(MonitorInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == MonitorInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + if (null == MonitorInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + if (null == MonitorInputObject.MonitorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.MonitorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + await this.Client.SingleSignOnConfigurationsGet(MonitorInputObject.SubscriptionId ?? null, MonitorInputObject.ResourceGroupName ?? null, MonitorInputObject.MonitorName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_List.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_List.cs index 724779b6390b..28ccbc8a27da 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_List.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogSingleSignOnConfiguration_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// List the single sign-on configurations for a given monitor resource. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogSingleSignOnConfiguration_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"List the single sign-on configurations for a given monitor resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations", ApiVersion = "2021-03-01")] public partial class GetAzDatadogSingleSignOnConfiguration_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzDatadogSingleSignOnConfiguration_List : global::System /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzDatadogSingleSignOnConfiguration_List : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -98,7 +119,7 @@ public partial class GetAzDatadogSingleSignOnConfiguration_List : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -144,7 +165,8 @@ public partial class GetAzDatadogSingleSignOnConfiguration_List : global::System [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -153,24 +175,24 @@ public partial class GetAzDatadogSingleSignOnConfiguration_List : global::System /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -193,6 +215,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -214,7 +241,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogSingleSignOnConfiguration_List() { @@ -265,8 +292,33 @@ public GetAzDatadogSingleSignOnConfiguration_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -319,7 +371,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -340,7 +392,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -378,12 +430,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -400,15 +452,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MonitorName=MonitorName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MonitorName=MonitorName }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -418,12 +470,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResourceListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -435,15 +487,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResourceListResponse + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_Get.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_Get.cs index 8543a3dc2c90..a60f891b72a6 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_Get.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Get a tag rule set for a given monitor resource. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogTagRule_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Get a tag rule set for a given monitor resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}", ApiVersion = "2021-03-01")] public partial class GetAzDatadogTagRule_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzDatadogTagRule_Get : global::System.Management.Automat /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzDatadogTagRule_Get : global::System.Management.Automat [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -106,7 +127,7 @@ public partial class GetAzDatadogTagRule_Get : global::System.Management.Automat /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -152,7 +173,8 @@ public partial class GetAzDatadogTagRule_Get : global::System.Management.Automat [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -161,24 +183,24 @@ public partial class GetAzDatadogTagRule_Get : global::System.Management.Automat /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -201,6 +223,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -222,7 +249,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogTagRule_Get() { @@ -273,8 +300,33 @@ public GetAzDatadogTagRule_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -327,7 +379,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -348,7 +400,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -386,12 +438,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -408,15 +460,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MonitorName=MonitorName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MonitorName=MonitorName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -426,12 +478,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -443,8 +495,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_GetViaIdentity.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_GetViaIdentity.cs index c8c7fb30ce4e..83f1dec977d8 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_GetViaIdentity.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Get a tag rule set for a given monitor resource. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogTagRule_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Get a tag rule set for a given monitor resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}", ApiVersion = "2021-03-01")] public partial class GetAzDatadogTagRule_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzDatadogTagRule_GetViaIdentity : global::System.Managem /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzDatadogTagRule_GetViaIdentity : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,7 +107,7 @@ public partial class GetAzDatadogTagRule_GetViaIdentity : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -109,24 +130,24 @@ public partial class GetAzDatadogTagRule_GetViaIdentity : global::System.Managem /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogTagRule_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzDatadogTagRule_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -317,7 +368,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,12 +406,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,7 +428,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -395,12 +446,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -412,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_GetViaIdentityMonitor.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_GetViaIdentityMonitor.cs new file mode 100644 index 000000000000..8b204a626e4a --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_GetViaIdentityMonitor.cs @@ -0,0 +1,500 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// Get a tag rule set for a given monitor resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogTagRule_GetViaIdentityMonitor")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Get a tag rule set for a given monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}", ApiVersion = "2021-03-01")] + public partial class GetAzDatadogTagRule_GetViaIdentityMonitor : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity _monitorInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity MonitorInputObject { get => this._monitorInputObject; set => this._monitorInputObject = value; } + + /// Backing field for property. + private string _name; + + /// Rule set name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Rule set name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Rule set name", + SerializedName = @"ruleSetName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzDatadogTagRule_GetViaIdentityMonitor() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (MonitorInputObject?.Id != null) + { + this.MonitorInputObject.Id += $"/tagRules/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.TagRulesGetViaIdentity(MonitorInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == MonitorInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + if (null == MonitorInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + if (null == MonitorInputObject.MonitorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.MonitorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + await this.Client.TagRulesGet(MonitorInputObject.SubscriptionId ?? null, MonitorInputObject.ResourceGroupName ?? null, MonitorInputObject.MonitorName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_List.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_List.cs index bd2f8de4bb66..cc51160f3a67 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_List.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/GetAzDatadogTagRule_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// List the tag rules for a given monitor resource. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDatadogTagRule_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"List the tag rules for a given monitor resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules", ApiVersion = "2021-03-01")] public partial class GetAzDatadogTagRule_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzDatadogTagRule_List : global::System.Management.Automa /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzDatadogTagRule_List : global::System.Management.Automa [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -98,7 +119,7 @@ public partial class GetAzDatadogTagRule_List : global::System.Management.Automa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -144,7 +165,8 @@ public partial class GetAzDatadogTagRule_List : global::System.Management.Automa [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -153,24 +175,24 @@ public partial class GetAzDatadogTagRule_List : global::System.Management.Automa /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -193,6 +215,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -214,7 +241,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDatadogTagRule_List() { @@ -265,8 +292,33 @@ public GetAzDatadogTagRule_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -319,7 +371,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -340,7 +392,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -378,12 +430,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -400,15 +452,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MonitorName=MonitorName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MonitorName=MonitorName }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -418,12 +470,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRulesListResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -435,15 +487,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRulesListResponse + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMarketplaceAgreement_CreateExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMarketplaceAgreement_CreateExpanded.cs index b87239b88123..fc7ed4f1e9d6 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMarketplaceAgreement_CreateExpanded.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMarketplaceAgreement_CreateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; - /// Create Datadog marketplace agreement in the subscription. + /// create Datadog marketplace agreement in the subscription. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogMarketplaceAgreement_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Create Datadog marketplace agreement in the subscription.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"create Datadog marketplace agreement in the subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default", ApiVersion = "2021-03-01")] public partial class NewAzDatadogMarketplaceAgreement_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -29,13 +32,25 @@ public partial class NewAzDatadogMarketplaceAgreement_CreateExpanded : global::S /// A unique id generatd for the this cmdlet when ProcessRecord() is called. private string __processRecordId; - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogAgreementResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogAgreementResource(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// If any version of the terms have been accepted, otherwise false. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If any version of the terms have been accepted, otherwise false.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] @@ -52,6 +67,9 @@ public partial class NewAzDatadogMarketplaceAgreement_CreateExpanded : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -65,6 +83,9 @@ public partial class NewAzDatadogMarketplaceAgreement_CreateExpanded : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -102,7 +123,7 @@ public partial class NewAzDatadogMarketplaceAgreement_CreateExpanded : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// Plan identifier string. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Plan identifier string.")] @@ -202,7 +223,8 @@ public partial class NewAzDatadogMarketplaceAgreement_CreateExpanded : global::S [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -211,24 +233,24 @@ public partial class NewAzDatadogMarketplaceAgreement_CreateExpanded : global::S /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -251,6 +273,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -315,8 +342,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -326,7 +378,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzDatadogMarketplaceAgreement_CreateExpanded() { @@ -380,7 +432,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -393,12 +445,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.MarketplaceAgreementsCreateOrUpdate(SubscriptionId, _body, onOk, onDefault, this, Pipeline); + await this.Client.MarketplaceAgreementsCreateOrUpdate(SubscriptionId, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -436,12 +488,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -458,15 +510,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -476,12 +528,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -493,8 +545,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogAgreementResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMarketplaceAgreement_CreateViaJsonFilePath.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMarketplaceAgreement_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..8de8d9ac8922 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMarketplaceAgreement_CreateViaJsonFilePath.cs @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// create Datadog marketplace agreement in the subscription. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogMarketplaceAgreement_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"create Datadog marketplace agreement in the subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default", ApiVersion = "2021-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.NotSuggestDefaultParameterSet] + public partial class NewAzDatadogMarketplaceAgreement_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzDatadogMarketplaceAgreement_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MarketplaceAgreementsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MarketplaceAgreementsCreateOrUpdateViaJsonString(SubscriptionId, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMarketplaceAgreement_CreateViaJsonString.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMarketplaceAgreement_CreateViaJsonString.cs new file mode 100644 index 000000000000..ff4e43c825b7 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMarketplaceAgreement_CreateViaJsonString.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// create Datadog marketplace agreement in the subscription. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogMarketplaceAgreement_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"create Datadog marketplace agreement in the subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default", ApiVersion = "2021-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.NotSuggestDefaultParameterSet] + public partial class NewAzDatadogMarketplaceAgreement_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzDatadogMarketplaceAgreement_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MarketplaceAgreementsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MarketplaceAgreementsCreateOrUpdateViaJsonString(SubscriptionId, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogAgreementResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateExpanded.cs index d4dfc316a1d2..9a7278e52e22 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateExpanded.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; - /// Create a monitor resource. + /// create a monitor resource. /// /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogMonitor_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Create a monitor resource.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"create a monitor resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", ApiVersion = "2021-03-01")] public partial class NewAzDatadogMonitor_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -29,13 +32,25 @@ public partial class NewAzDatadogMonitor_CreateExpanded : global::System.Managem /// A unique id generatd for the this cmdlet when ProcessRecord() is called. private string __processRecordId; - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResource(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] @@ -46,6 +61,9 @@ public partial class NewAzDatadogMonitor_CreateExpanded : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -59,6 +77,13 @@ public partial class NewAzDatadogMonitor_CreateExpanded : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public global::System.Management.Automation.SwitchParameter EnableSystemAssignedIdentity { set => _body.IdentityType = value.IsPresent ? "SystemAssigned": null ; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -71,26 +96,14 @@ public partial class NewAzDatadogMonitor_CreateExpanded : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Identity type - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identity type")] - [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Identity type", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes))] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes IdentityType { get => _body.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.ManagedIdentityTypes)""); set => _body.IdentityType = value; } - /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// . - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = ".")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, Description = @".", SerializedName = @"location", @@ -113,9 +126,9 @@ public partial class NewAzDatadogMonitor_CreateExpanded : global::System.Managem ReadOnly = false, Description = @"Flag specifying if the resource monitoring is enabled or disabled.", SerializedName = @"monitoringStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus))] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus MonitoringStatus { get => _body.MonitoringStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus)""); set => _body.MonitoringStatus = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string MonitoringStatus { get => _body.MonitoringStatus ?? null; set => _body.MonitoringStatus = value; } /// Backing field for property. private string _name; @@ -211,7 +224,7 @@ public partial class NewAzDatadogMonitor_CreateExpanded : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -268,7 +281,8 @@ public partial class NewAzDatadogMonitor_CreateExpanded : global::System.Managem [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -281,8 +295,8 @@ public partial class NewAzDatadogMonitor_CreateExpanded : global::System.Managem ReadOnly = false, Description = @"Dictionary of ", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// Email of the user used by Datadog for contacting them if needed [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Email of the user used by Datadog for contacting them if needed")] @@ -322,24 +336,24 @@ public partial class NewAzDatadogMonitor_CreateExpanded : global::System.Managem /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -386,6 +400,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.NewAzDatadogMonitor_Cr /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -450,11 +469,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -466,10 +510,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -479,7 +539,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzDatadogMonitor_CreateExpanded() { @@ -545,7 +605,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -558,12 +618,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.MonitorsCreate(SubscriptionId, ResourceGroupName, Name, _body, onOk, onDefault, this, Pipeline); + await this.Client.MonitorsCreate(SubscriptionId, ResourceGroupName, Name, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -601,12 +661,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -623,15 +683,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -641,12 +701,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -658,8 +718,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateViaIdentityExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..050a886c6224 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateViaIdentityExpanded.cs @@ -0,0 +1,721 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// create a monitor resource. + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogMonitor_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"create a monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", ApiVersion = "2021-03-01")] + public partial class NewAzDatadogMonitor_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResource(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public global::System.Management.Automation.SwitchParameter EnableSystemAssignedIdentity { set => _body.IdentityType = value.IsPresent ? "SystemAssigned": null ; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _body.Location ?? null; set => _body.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Flag specifying if the resource monitoring is enabled or disabled. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if the resource monitoring is enabled or disabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag specifying if the resource monitoring is enabled or disabled.", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string MonitoringStatus { get => _body.MonitoringStatus ?? null; set => _body.MonitoringStatus = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Api key associated to the Datadog organization. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Api key associated to the Datadog organization.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Api key associated to the Datadog organization.", + SerializedName = @"apiKey", + PossibleTypes = new [] { typeof(string) })] + public string OrganizationApiKey { get => _body.DatadogOrganizationPropertyApiKey ?? null; set => _body.DatadogOrganizationPropertyApiKey = value; } + + /// Application key associated to the Datadog organization. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Application key associated to the Datadog organization.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Application key associated to the Datadog organization.", + SerializedName = @"applicationKey", + PossibleTypes = new [] { typeof(string) })] + public string OrganizationApplicationKey { get => _body.DatadogOrganizationPropertyApplicationKey ?? null; set => _body.DatadogOrganizationPropertyApplicationKey = value; } + + /// The Id of the Enterprise App used for Single sign on. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Id of the Enterprise App used for Single sign on.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Id of the Enterprise App used for Single sign on.", + SerializedName = @"enterpriseAppId", + PossibleTypes = new [] { typeof(string) })] + public string OrganizationEnterpriseAppId { get => _body.DatadogOrganizationPropertyEnterpriseAppId ?? null; set => _body.DatadogOrganizationPropertyEnterpriseAppId = value; } + + /// The auth code used to linking to an existing datadog organization. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The auth code used to linking to an existing datadog organization.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The auth code used to linking to an existing datadog organization.", + SerializedName = @"linkingAuthCode", + PossibleTypes = new [] { typeof(string) })] + public string OrganizationLinkingAuthCode { get => _body.DatadogOrganizationPropertyLinkingAuthCode ?? null; set => _body.DatadogOrganizationPropertyLinkingAuthCode = value; } + + /// + /// The client_id from an existing in exchange for an auth token to link organization. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The client_id from an existing in exchange for an auth token to link organization.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client_id from an existing in exchange for an auth token to link organization.", + SerializedName = @"linkingClientId", + PossibleTypes = new [] { typeof(string) })] + public string OrganizationLinkingClientId { get => _body.DatadogOrganizationPropertyLinkingClientId ?? null; set => _body.DatadogOrganizationPropertyLinkingClientId = value; } + + /// The redirect uri for linking. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The redirect uri for linking.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The redirect uri for linking.", + SerializedName = @"redirectUri", + PossibleTypes = new [] { typeof(string) })] + public string OrganizationRedirectUri { get => _body.DatadogOrganizationPropertyRedirectUri ?? null; set => _body.DatadogOrganizationPropertyRedirectUri = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Name of the SKU. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the SKU.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the SKU.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string SkuName { get => _body.SkuName ?? null; set => _body.SkuName = value; } + + /// Dictionary of + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Dictionary of ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dictionary of ", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + + /// Email of the user used by Datadog for contacting them if needed + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Email of the user used by Datadog for contacting them if needed")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Email of the user used by Datadog for contacting them if needed", + SerializedName = @"emailAddress", + PossibleTypes = new [] { typeof(string) })] + public string UserInfoEmailAddress { get => _body.UserInfoEmailAddress ?? null; set => _body.UserInfoEmailAddress = value; } + + /// Name of the user + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the user")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the user", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string UserInfoName { get => _body.UserInfoName ?? null; set => _body.UserInfoName = value; } + + /// Phone number of the user used by Datadog for contacting them if needed + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Phone number of the user used by Datadog for contacting them if needed")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Phone number of the user used by Datadog for contacting them if needed", + SerializedName = @"phoneNumber", + PossibleTypes = new [] { typeof(string) })] + public string UserInfoPhoneNumber { get => _body.UserInfoPhoneNumber ?? null; set => _body.UserInfoPhoneNumber = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDatadogMonitor_CreateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.NewAzDatadogMonitor_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzDatadogMonitor_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._body = this._body; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzDatadogMonitor_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MonitorsCreate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.MonitorsCreateViaIdentity(InputObject.Id, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.MonitorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.MonitorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.MonitorsCreate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MonitorName ?? null, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateViaJsonFilePath.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..a0822a37644d --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateViaJsonFilePath.cs @@ -0,0 +1,607 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// create a monitor resource. + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogMonitor_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"create a monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", ApiVersion = "2021-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.NotSuggestDefaultParameterSet] + public partial class NewAzDatadogMonitor_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Monitor resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Monitor resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Monitor resource name", + SerializedName = @"monitorName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("MonitorName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDatadogMonitor_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.NewAzDatadogMonitor_CreateViaJsonFilePath Clone() + { + var clone = new NewAzDatadogMonitor_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzDatadogMonitor_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MonitorsCreate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MonitorsCreateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateViaJsonString.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateViaJsonString.cs new file mode 100644 index 000000000000..73b52228713f --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogMonitor_CreateViaJsonString.cs @@ -0,0 +1,605 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// create a monitor resource. + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogMonitor_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"create a monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", ApiVersion = "2021-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.NotSuggestDefaultParameterSet] + public partial class NewAzDatadogMonitor_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Monitor resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Monitor resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Monitor resource name", + SerializedName = @"monitorName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("MonitorName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDatadogMonitor_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.NewAzDatadogMonitor_CreateViaJsonString Clone() + { + var clone = new NewAzDatadogMonitor_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzDatadogMonitor_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MonitorsCreate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MonitorsCreateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateExpanded.cs index 92f085f81e5b..2cba895c9a8d 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateExpanded.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Configures single-sign-on for this resource. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogSingleSignOnConfiguration_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Configures single-sign-on for this resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", ApiVersion = "2021-03-01")] public partial class NewAzDatadogSingleSignOnConfiguration_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -29,13 +32,25 @@ public partial class NewAzDatadogSingleSignOnConfiguration_CreateExpanded : glob /// A unique id generatd for the this cmdlet when ProcessRecord() is called. private string __processRecordId; - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResource(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] @@ -46,6 +61,9 @@ public partial class NewAzDatadogSingleSignOnConfiguration_CreateExpanded : glob [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -70,6 +88,9 @@ public partial class NewAzDatadogSingleSignOnConfiguration_CreateExpanded : glob PossibleTypes = new [] { typeof(string) })] public string EnterpriseAppId { get => _body.EnterpriseAppId ?? null; set => _body.EnterpriseAppId = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -132,7 +153,7 @@ public partial class NewAzDatadogSingleSignOnConfiguration_CreateExpanded : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -172,9 +193,9 @@ public partial class NewAzDatadogSingleSignOnConfiguration_CreateExpanded : glob ReadOnly = false, Description = @"Various states of the SSO resource", SerializedName = @"singleSignOnState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates))] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates SingleSignOnState { get => _body.SingleSignOnState ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates)""); set => _body.SingleSignOnState = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Initial", "Enable", "Disable", "Existing")] + public string SingleSignOnState { get => _body.SingleSignOnState ?? null; set => _body.SingleSignOnState = value; } /// Backing field for property. private string _subscriptionId; @@ -190,7 +211,8 @@ public partial class NewAzDatadogSingleSignOnConfiguration_CreateExpanded : glob [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -199,24 +221,24 @@ public partial class NewAzDatadogSingleSignOnConfiguration_CreateExpanded : glob /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -264,6 +286,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.NewAzDatadogSingleSign /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -328,11 +355,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -344,10 +396,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -357,7 +425,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzDatadogSingleSignOnConfiguration_CreateExpanded() { @@ -423,7 +491,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -436,12 +504,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.SingleSignOnConfigurationsCreateOrUpdate(SubscriptionId, ResourceGroupName, MonitorName, Name, _body, onOk, onDefault, this, Pipeline); + await this.Client.SingleSignOnConfigurationsCreateOrUpdate(SubscriptionId, ResourceGroupName, MonitorName, Name, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,Name=Name,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -479,12 +547,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -501,15 +569,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MonitorName=MonitorName, Name=Name, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MonitorName=MonitorName, Name=Name, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -519,12 +587,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -536,8 +604,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityExpanded.cs index 61ff0fe72b4a..d5408d6f8692 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityExpanded.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Configures single-sign-on for this resource. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogSingleSignOnConfiguration_CreateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Configures single-sign-on for this resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", ApiVersion = "2021-03-01")] public partial class NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -29,13 +32,25 @@ public partial class NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityExpa /// A unique id generatd for the this cmdlet when ProcessRecord() is called. private string __processRecordId; - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogSingleSignOnResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResource(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] @@ -46,6 +61,9 @@ public partial class NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityExpa [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -70,6 +88,9 @@ public partial class NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityExpa PossibleTypes = new [] { typeof(string) })] public string EnterpriseAppId { get => _body.EnterpriseAppId ?? null; set => _body.EnterpriseAppId = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -112,7 +133,7 @@ public partial class NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityExpa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -138,33 +159,33 @@ public partial class NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityExpa ReadOnly = false, Description = @"Various states of the SSO resource", SerializedName = @"singleSignOnState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates))] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates SingleSignOnState { get => _body.SingleSignOnState ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.SingleSignOnStates)""); set => _body.SingleSignOnState = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Initial", "Enable", "Disable", "Existing")] + public string SingleSignOnState { get => _body.SingleSignOnState ?? null; set => _body.SingleSignOnState = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -210,6 +231,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.NewAzDatadogSingleSign /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -274,11 +300,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -290,10 +341,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -303,7 +370,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityExpanded() @@ -370,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -385,7 +452,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.SingleSignOnConfigurationsCreateOrUpdateViaIdentity(InputObject.Id, _body, onOk, onDefault, this, Pipeline); + await this.Client.SingleSignOnConfigurationsCreateOrUpdateViaIdentity(InputObject.Id, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate); } else { @@ -406,13 +473,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ConfigurationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.SingleSignOnConfigurationsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MonitorName ?? null, InputObject.ConfigurationName ?? null, _body, onOk, onDefault, this, Pipeline); + await this.Client.SingleSignOnConfigurationsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MonitorName ?? null, InputObject.ConfigurationName ?? null, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate); } await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -450,12 +517,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -472,15 +539,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -490,12 +557,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -507,8 +574,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSingleSignOnResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityMonitorExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityMonitorExpanded.cs new file mode 100644 index 000000000000..6f2207fdc107 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityMonitorExpanded.cs @@ -0,0 +1,612 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// Configures single-sign-on for this resource. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogSingleSignOnConfiguration_CreateViaIdentityMonitorExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Configures single-sign-on for this resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", ApiVersion = "2021-03-01")] + public partial class NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityMonitorExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResource(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The Id of the Enterprise App used for Single sign-on. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Id of the Enterprise App used for Single sign-on.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Id of the Enterprise App used for Single sign-on.", + SerializedName = @"enterpriseAppId", + PossibleTypes = new [] { typeof(string) })] + public string EnterpriseAppId { get => _body.EnterpriseAppId ?? null; set => _body.EnterpriseAppId = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity _monitorInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity MonitorInputObject { get => this._monitorInputObject; set => this._monitorInputObject = value; } + + /// Backing field for property. + private string _name; + + /// Configuration name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Configuration name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Configuration name", + SerializedName = @"configurationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Various states of the SSO resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Various states of the SSO resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Various states of the SSO resource", + SerializedName = @"singleSignOnState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Initial", "Enable", "Disable", "Existing")] + public string SingleSignOnState { get => _body.SingleSignOnState ?? null; set => _body.SingleSignOnState = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityMonitorExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityMonitorExpanded Clone() + { + var clone = new NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityMonitorExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._body = this._body; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the + /// cmdlet class. + /// + public NewAzDatadogSingleSignOnConfiguration_CreateViaIdentityMonitorExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SingleSignOnConfigurationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (MonitorInputObject?.Id != null) + { + this.MonitorInputObject.Id += $"/singleSignOnConfigurations/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.SingleSignOnConfigurationsCreateOrUpdateViaIdentity(MonitorInputObject.Id, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == MonitorInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + if (null == MonitorInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + if (null == MonitorInputObject.MonitorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.MonitorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + await this.Client.SingleSignOnConfigurationsCreateOrUpdate(MonitorInputObject.SubscriptionId ?? null, MonitorInputObject.ResourceGroupName ?? null, MonitorInputObject.MonitorName ?? null, Name, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaJsonFilePath.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..b0ceef86215a --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaJsonFilePath.cs @@ -0,0 +1,623 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// Configures single-sign-on for this resource. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogSingleSignOnConfiguration_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Configures single-sign-on for this resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", ApiVersion = "2021-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.NotSuggestDefaultParameterSet] + public partial class NewAzDatadogSingleSignOnConfiguration_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _monitorName; + + /// Monitor resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Monitor resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Monitor resource name", + SerializedName = @"monitorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string MonitorName { get => this._monitorName; set => this._monitorName = value; } + + /// Backing field for property. + private string _name; + + /// Configuration name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Configuration name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Configuration name", + SerializedName = @"configurationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzDatadogSingleSignOnConfiguration_CreateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.NewAzDatadogSingleSignOnConfiguration_CreateViaJsonFilePath Clone() + { + var clone = new NewAzDatadogSingleSignOnConfiguration_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.MonitorName = this.MonitorName; + clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzDatadogSingleSignOnConfiguration_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SingleSignOnConfigurationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SingleSignOnConfigurationsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, MonitorName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaJsonString.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaJsonString.cs new file mode 100644 index 000000000000..d463293fd61e --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogSingleSignOnConfiguration_CreateViaJsonString.cs @@ -0,0 +1,621 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// Configures single-sign-on for this resource. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogSingleSignOnConfiguration_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Configures single-sign-on for this resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}", ApiVersion = "2021-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.NotSuggestDefaultParameterSet] + public partial class NewAzDatadogSingleSignOnConfiguration_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _monitorName; + + /// Monitor resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Monitor resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Monitor resource name", + SerializedName = @"monitorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string MonitorName { get => this._monitorName; set => this._monitorName = value; } + + /// Backing field for property. + private string _name; + + /// Configuration name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Configuration name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Configuration name", + SerializedName = @"configurationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzDatadogSingleSignOnConfiguration_CreateViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.NewAzDatadogSingleSignOnConfiguration_CreateViaJsonString Clone() + { + var clone = new NewAzDatadogSingleSignOnConfiguration_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.MonitorName = this.MonitorName; + clone.Name = this.Name; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzDatadogSingleSignOnConfiguration_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SingleSignOnConfigurationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SingleSignOnConfigurationsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, MonitorName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateExpanded.cs index 3e492360b94c..8b93d9577ff2 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateExpanded.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; - /// Create or update a tag rule set for a given monitor resource. + /// create a tag rule set for a given monitor resource. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogTagRule_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Create or update a tag rule set for a given monitor resource.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"create a tag rule set for a given monitor resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}", ApiVersion = "2021-03-01")] public partial class NewAzDatadogTagRule_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,18 +33,33 @@ public partial class NewAzDatadogTagRule_CreateExpanded : global::System.Managem private string __processRecordId; /// Capture logs and metrics of Azure resources based on ARM tags. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRules(); + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRules(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class NewAzDatadogTagRule_CreateExpanded : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -83,8 +104,8 @@ public partial class NewAzDatadogTagRule_CreateExpanded : global::System.Managem ReadOnly = false, Description = @"List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", SerializedName = @"filteringTags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag) })] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] LogRuleFilteringTag { get => _body.LogRuleFilteringTag ?? null /* arrayOf */; set => _body.LogRuleFilteringTag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[] LogRuleFilteringTag { get => _body.LogRuleFilteringTag?.ToArray() ?? null /* fixedArrayOf */; set => _body.LogRuleFilteringTag = (value != null ? new System.Collections.Generic.List(value) : null); } /// Flag specifying if AAD logs should be sent for the Monitor resource. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if AAD logs should be sent for the Monitor resource.")] @@ -134,8 +155,8 @@ public partial class NewAzDatadogTagRule_CreateExpanded : global::System.Managem ReadOnly = false, Description = @"List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", SerializedName = @"filteringTags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag) })] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] MetricRuleFilteringTag { get => _body.MetricRuleFilteringTag ?? null /* arrayOf */; set => _body.MetricRuleFilteringTag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[] MetricRuleFilteringTag { get => _body.MetricRuleFilteringTag?.ToArray() ?? null /* fixedArrayOf */; set => _body.MetricRuleFilteringTag = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// cancellation delegate. Stops the cmdlet when called. @@ -176,7 +197,7 @@ public partial class NewAzDatadogTagRule_CreateExpanded : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -222,7 +243,8 @@ public partial class NewAzDatadogTagRule_CreateExpanded : global::System.Managem [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -231,24 +253,24 @@ public partial class NewAzDatadogTagRule_CreateExpanded : global::System.Managem /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -271,6 +293,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -335,8 +362,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -346,7 +398,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzDatadogTagRule_CreateExpanded() { @@ -400,7 +452,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -413,12 +465,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.TagRulesCreateOrUpdate(SubscriptionId, ResourceGroupName, MonitorName, Name, _body, onOk, onDefault, this, Pipeline); + await this.Client.TagRulesCreateOrUpdate(SubscriptionId, ResourceGroupName, MonitorName, Name, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,Name=Name,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -456,12 +508,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -478,15 +530,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MonitorName=MonitorName, Name=Name, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MonitorName=MonitorName, Name=Name, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -496,12 +548,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -513,8 +565,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaIdentityExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaIdentityExpanded.cs index 1f724401af1d..9810ca198522 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaIdentityExpanded.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaIdentityExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; - /// Create or update a tag rule set for a given monitor resource. + /// create a tag rule set for a given monitor resource. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogTagRule_CreateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Create or update a tag rule set for a given monitor resource.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"create a tag rule set for a given monitor resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}", ApiVersion = "2021-03-01")] public partial class NewAzDatadogTagRule_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,18 +33,33 @@ public partial class NewAzDatadogTagRule_CreateViaIdentityExpanded : global::Sys private string __processRecordId; /// Capture logs and metrics of Azure resources based on ARM tags. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.MonitoringTagRules(); + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRules(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class NewAzDatadogTagRule_CreateViaIdentityExpanded : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -91,8 +112,8 @@ public partial class NewAzDatadogTagRule_CreateViaIdentityExpanded : global::Sys ReadOnly = false, Description = @"List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", SerializedName = @"filteringTags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag) })] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] LogRuleFilteringTag { get => _body.LogRuleFilteringTag ?? null /* arrayOf */; set => _body.LogRuleFilteringTag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[] LogRuleFilteringTag { get => _body.LogRuleFilteringTag?.ToArray() ?? null /* fixedArrayOf */; set => _body.LogRuleFilteringTag = (value != null ? new System.Collections.Generic.List(value) : null); } /// Flag specifying if AAD logs should be sent for the Monitor resource. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if AAD logs should be sent for the Monitor resource.")] @@ -142,8 +163,8 @@ public partial class NewAzDatadogTagRule_CreateViaIdentityExpanded : global::Sys ReadOnly = false, Description = @"List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", SerializedName = @"filteringTags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag) })] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IFilteringTag[] MetricRuleFilteringTag { get => _body.MetricRuleFilteringTag ?? null /* arrayOf */; set => _body.MetricRuleFilteringTag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[] MetricRuleFilteringTag { get => _body.MetricRuleFilteringTag?.ToArray() ?? null /* fixedArrayOf */; set => _body.MetricRuleFilteringTag = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// cancellation delegate. Stops the cmdlet when called. @@ -156,7 +177,7 @@ public partial class NewAzDatadogTagRule_CreateViaIdentityExpanded : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -179,24 +200,24 @@ public partial class NewAzDatadogTagRule_CreateViaIdentityExpanded : global::Sys /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -219,6 +240,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -283,8 +309,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -294,7 +345,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzDatadogTagRule_CreateViaIdentityExpanded() { @@ -348,7 +399,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -363,7 +414,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.TagRulesCreateOrUpdateViaIdentity(InputObject.Id, _body, onOk, onDefault, this, Pipeline); + await this.Client.TagRulesCreateOrUpdateViaIdentity(InputObject.Id, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate); } else { @@ -384,13 +435,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RuleSetName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.TagRulesCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MonitorName ?? null, InputObject.RuleSetName ?? null, _body, onOk, onDefault, this, Pipeline); + await this.Client.TagRulesCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MonitorName ?? null, InputObject.RuleSetName ?? null, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate); } await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -428,12 +479,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -450,15 +501,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -468,12 +519,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -485,8 +536,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IMonitoringTagRules - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaIdentityMonitorExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaIdentityMonitorExpanded.cs new file mode 100644 index 000000000000..1ad9cfd564f5 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaIdentityMonitorExpanded.cs @@ -0,0 +1,573 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// create a tag rule set for a given monitor resource. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogTagRule_CreateViaIdentityMonitorExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"create a tag rule set for a given monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}", ApiVersion = "2021-03-01")] + public partial class NewAzDatadogTagRule_CreateViaIdentityMonitorExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// Capture logs and metrics of Azure resources based on ARM tags. + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRules(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, + /// all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available + /// resources. If Include actions are specified, the rules will only include resources with the associated tags. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", + SerializedName = @"filteringTags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[] LogRuleFilteringTag { get => _body.LogRuleFilteringTag?.ToArray() ?? null /* fixedArrayOf */; set => _body.LogRuleFilteringTag = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Flag specifying if AAD logs should be sent for the Monitor resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if AAD logs should be sent for the Monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag specifying if AAD logs should be sent for the Monitor resource.", + SerializedName = @"sendAadLogs", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter LogRuleSendAadLog { get => _body.LogRuleSendAadLog ?? default(global::System.Management.Automation.SwitchParameter); set => _body.LogRuleSendAadLog = value; } + + /// Flag specifying if Azure resource logs should be sent for the Monitor resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if Azure resource logs should be sent for the Monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag specifying if Azure resource logs should be sent for the Monitor resource.", + SerializedName = @"sendResourceLogs", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter LogRuleSendResourceLog { get => _body.LogRuleSendResourceLog ?? default(global::System.Management.Automation.SwitchParameter); set => _body.LogRuleSendResourceLog = value; } + + /// + /// Flag specifying if Azure subscription logs should be sent for the Monitor resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if Azure subscription logs should be sent for the Monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag specifying if Azure subscription logs should be sent for the Monitor resource.", + SerializedName = @"sendSubscriptionLogs", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter LogRuleSendSubscriptionLog { get => _body.LogRuleSendSubscriptionLog ?? default(global::System.Management.Automation.SwitchParameter); set => _body.LogRuleSendSubscriptionLog = value; } + + /// + /// List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action + /// is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules + /// will only include resources with the associated tags. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", + SerializedName = @"filteringTags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[] MetricRuleFilteringTag { get => _body.MetricRuleFilteringTag?.ToArray() ?? null /* fixedArrayOf */; set => _body.MetricRuleFilteringTag = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity _monitorInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity MonitorInputObject { get => this._monitorInputObject; set => this._monitorInputObject = value; } + + /// Backing field for property. + private string _name; + + /// Rule set name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Rule set name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Rule set name", + SerializedName = @"ruleSetName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzDatadogTagRule_CreateViaIdentityMonitorExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TagRulesCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (MonitorInputObject?.Id != null) + { + this.MonitorInputObject.Id += $"/tagRules/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.TagRulesCreateOrUpdateViaIdentity(MonitorInputObject.Id, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == MonitorInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + if (null == MonitorInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + if (null == MonitorInputObject.MonitorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.MonitorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + await this.Client.TagRulesCreateOrUpdate(MonitorInputObject.SubscriptionId ?? null, MonitorInputObject.ResourceGroupName ?? null, MonitorInputObject.MonitorName ?? null, Name, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaJsonFilePath.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..1d13b551a8ff --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaJsonFilePath.cs @@ -0,0 +1,537 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// create a tag rule set for a given monitor resource. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogTagRule_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"create a tag rule set for a given monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}", ApiVersion = "2021-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.NotSuggestDefaultParameterSet] + public partial class NewAzDatadogTagRule_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _monitorName; + + /// Monitor resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Monitor resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Monitor resource name", + SerializedName = @"monitorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string MonitorName { get => this._monitorName; set => this._monitorName = value; } + + /// Backing field for property. + private string _name; + + /// Rule set name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Rule set name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Rule set name", + SerializedName = @"ruleSetName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzDatadogTagRule_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TagRulesCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TagRulesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, MonitorName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaJsonString.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaJsonString.cs new file mode 100644 index 000000000000..55fa144ace65 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/NewAzDatadogTagRule_CreateViaJsonString.cs @@ -0,0 +1,535 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// create a tag rule set for a given monitor resource. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDatadogTagRule_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"create a tag rule set for a given monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}", ApiVersion = "2021-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.NotSuggestDefaultParameterSet] + public partial class NewAzDatadogTagRule_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _monitorName; + + /// Monitor resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Monitor resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Monitor resource name", + SerializedName = @"monitorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string MonitorName { get => this._monitorName; set => this._monitorName = value; } + + /// Backing field for property. + private string _name; + + /// Rule set name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Rule set name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Rule set name", + SerializedName = @"ruleSetName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzDatadogTagRule_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TagRulesCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TagRulesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, MonitorName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/RemoveAzDatadogMonitor_Delete.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/RemoveAzDatadogMonitor_Delete.cs index 788166ebd90f..6b54d228bd22 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/RemoveAzDatadogMonitor_Delete.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/RemoveAzDatadogMonitor_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Delete a monitor resource. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", ApiVersion = "2021-03-01")] public partial class RemoveAzDatadogMonitor_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,18 @@ public partial class RemoveAzDatadogMonitor_Delete : global::System.Management.A /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] @@ -44,6 +59,9 @@ public partial class RemoveAzDatadogMonitor_Delete : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -57,6 +75,9 @@ public partial class RemoveAzDatadogMonitor_Delete : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -113,7 +134,7 @@ public partial class RemoveAzDatadogMonitor_Delete : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -159,7 +180,8 @@ public partial class RemoveAzDatadogMonitor_Delete : global::System.Management.A [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -168,12 +190,12 @@ public partial class RemoveAzDatadogMonitor_Delete : global::System.Management.A /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -239,6 +261,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.RemoveAzDatadogMonitor /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -303,11 +330,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -319,10 +371,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -390,7 +458,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -408,7 +476,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -421,7 +489,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzDatadogMonitor_Delete() { @@ -454,12 +522,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -476,15 +544,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/RemoveAzDatadogMonitor_DeleteViaIdentity.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/RemoveAzDatadogMonitor_DeleteViaIdentity.cs index e6bd5348834c..77065d3c9f4f 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/RemoveAzDatadogMonitor_DeleteViaIdentity.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/RemoveAzDatadogMonitor_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Delete a monitor resource. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", ApiVersion = "2021-03-01")] public partial class RemoveAzDatadogMonitor_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,18 @@ public partial class RemoveAzDatadogMonitor_DeleteViaIdentity : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] @@ -44,6 +59,9 @@ public partial class RemoveAzDatadogMonitor_DeleteViaIdentity : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -57,6 +75,9 @@ public partial class RemoveAzDatadogMonitor_DeleteViaIdentity : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -106,7 +127,7 @@ public partial class RemoveAzDatadogMonitor_DeleteViaIdentity : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -129,12 +150,12 @@ public partial class RemoveAzDatadogMonitor_DeleteViaIdentity : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -197,6 +218,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.RemoveAzDatadogMonitor /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -261,11 +287,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -277,10 +328,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -348,7 +415,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -386,7 +453,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -399,7 +466,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzDatadogMonitor_DeleteViaIdentity() { @@ -432,12 +499,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -454,7 +521,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/SetAzDatadogMonitorDefaultKey_SetExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/SetAzDatadogMonitorDefaultKey_SetExpanded.cs index cc1f2ab30c63..1a1e9ec27b67 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/SetAzDatadogMonitorDefaultKey_SetExpanded.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/SetAzDatadogMonitorDefaultKey_SetExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Set the default api key. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/setDefaultKey", ApiVersion = "2021-03-01")] public partial class SetAzDatadogMonitorDefaultKey_SetExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -29,18 +32,33 @@ public partial class SetAzDatadogMonitorDefaultKey_SetExpanded : global::System. /// A unique id generatd for the this cmdlet when ProcessRecord() is called. private string __processRecordId; - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogApiKey _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogApiKey(); + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogApiKey _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogApiKey(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -76,6 +94,9 @@ public partial class SetAzDatadogMonitorDefaultKey_SetExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -92,10 +113,10 @@ public partial class SetAzDatadogMonitorDefaultKey_SetExpanded : global::System. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// The value of the API key. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The value of the API key.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The value of the API key.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, Description = @"The value of the API key.", SerializedName = @"key", @@ -145,7 +166,7 @@ public partial class SetAzDatadogMonitorDefaultKey_SetExpanded : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -191,7 +212,8 @@ public partial class SetAzDatadogMonitorDefaultKey_SetExpanded : global::System. [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -200,12 +222,12 @@ public partial class SetAzDatadogMonitorDefaultKey_SetExpanded : global::System. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens @@ -238,6 +260,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -302,8 +329,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -359,7 +411,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -377,7 +429,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -390,7 +442,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public SetAzDatadogMonitorDefaultKey_SetExpanded() { @@ -423,12 +475,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -445,15 +497,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MonitorName=MonitorName, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, MonitorName=MonitorName, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/SetAzDatadogMonitorDefaultKey_SetViaJsonFilePath.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/SetAzDatadogMonitorDefaultKey_SetViaJsonFilePath.cs new file mode 100644 index 000000000000..7df25fcee4c1 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/SetAzDatadogMonitorDefaultKey_SetViaJsonFilePath.cs @@ -0,0 +1,510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// Set the default api key. + /// + /// [OpenAPI] SetDefaultKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/setDefaultKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Set, @"AzDatadogMonitorDefaultKey_SetViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Set the default api key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/setDefaultKey", ApiVersion = "2021-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.NotSuggestDefaultParameterSet] + public partial class SetAzDatadogMonitorDefaultKey_SetViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Set operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Set operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Set operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _monitorName; + + /// Monitor resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Monitor resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Monitor resource name", + SerializedName = @"monitorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string MonitorName { get => this._monitorName; set => this._monitorName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MonitorsSetDefaultKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MonitorsSetDefaultKeyViaJsonString(SubscriptionId, ResourceGroupName, MonitorName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public SetAzDatadogMonitorDefaultKey_SetViaJsonFilePath() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/SetAzDatadogMonitorDefaultKey_SetViaJsonString.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/SetAzDatadogMonitorDefaultKey_SetViaJsonString.cs new file mode 100644 index 000000000000..285ee7ceed4e --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/SetAzDatadogMonitorDefaultKey_SetViaJsonString.cs @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// Set the default api key. + /// + /// [OpenAPI] SetDefaultKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/setDefaultKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Set, @"AzDatadogMonitorDefaultKey_SetViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Set the default api key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/setDefaultKey", ApiVersion = "2021-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.NotSuggestDefaultParameterSet] + public partial class SetAzDatadogMonitorDefaultKey_SetViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Set operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Set operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Set operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _monitorName; + + /// Monitor resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Monitor resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Monitor resource name", + SerializedName = @"monitorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string MonitorName { get => this._monitorName; set => this._monitorName = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MonitorsSetDefaultKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MonitorsSetDefaultKeyViaJsonString(SubscriptionId, ResourceGroupName, MonitorName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public SetAzDatadogMonitorDefaultKey_SetViaJsonString() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitorSetPasswordLink_Refresh.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitorSetPasswordLink_Refresh.cs index bfd99a52f6cd..61e6aa9b91e2 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitorSetPasswordLink_Refresh.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitorSetPasswordLink_Refresh.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Refresh the set password link and return a latest one. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] RefreshSetPasswordLink=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/refreshSetPasswordLink" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDatadogMonitorSetPasswordLink_Refresh", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(string))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Refresh the set password link and return a latest one.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/refreshSetPasswordLink", ApiVersion = "2021-03-01")] public partial class UpdateAzDatadogMonitorSetPasswordLink_Refresh : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class UpdateAzDatadogMonitorSetPasswordLink_Refresh : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class UpdateAzDatadogMonitorSetPasswordLink_Refresh : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -92,7 +113,7 @@ public partial class UpdateAzDatadogMonitorSetPasswordLink_Refresh : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -138,7 +159,8 @@ public partial class UpdateAzDatadogMonitorSetPasswordLink_Refresh : global::Sys [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -147,24 +169,24 @@ public partial class UpdateAzDatadogMonitorSetPasswordLink_Refresh : global::Sys /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -187,6 +209,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -251,8 +278,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -308,7 +360,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -326,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -346,7 +398,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzDatadogMonitorSetPasswordLink_Refresh() { @@ -372,12 +424,12 @@ public UpdateAzDatadogMonitorSetPasswordLink_Refresh() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -394,15 +446,15 @@ public UpdateAzDatadogMonitorSetPasswordLink_Refresh() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -412,12 +464,12 @@ public UpdateAzDatadogMonitorSetPasswordLink_Refresh() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -429,8 +481,26 @@ public UpdateAzDatadogMonitorSetPasswordLink_Refresh() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink - WriteObject((await response).SetPasswordLink); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitorSetPasswordLink_RefreshViaIdentity.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitorSetPasswordLink_RefreshViaIdentity.cs index f5f5a23254fd..0eb498d1bd1d 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitorSetPasswordLink_RefreshViaIdentity.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitorSetPasswordLink_RefreshViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; /// Refresh the set password link and return a latest one. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets /// [OpenAPI] RefreshSetPasswordLink=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/refreshSetPasswordLink" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDatadogMonitorSetPasswordLink_RefreshViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(string))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink))] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Refresh the set password link and return a latest one.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/refreshSetPasswordLink", ApiVersion = "2021-03-01")] public partial class UpdateAzDatadogMonitorSetPasswordLink_RefreshViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class UpdateAzDatadogMonitorSetPasswordLink_RefreshViaIdentity : /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class UpdateAzDatadogMonitorSetPasswordLink_RefreshViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,7 +107,7 @@ public partial class UpdateAzDatadogMonitorSetPasswordLink_RefreshViaIdentity : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -109,24 +130,24 @@ public partial class UpdateAzDatadogMonitorSetPasswordLink_RefreshViaIdentity : /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -213,8 +239,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -270,7 +321,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -308,7 +359,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -328,7 +379,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzDatadogMonitorSetPasswordLink_RefreshViaIdentity() { @@ -354,12 +405,12 @@ public UpdateAzDatadogMonitorSetPasswordLink_RefreshViaIdentity() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -376,7 +427,7 @@ public UpdateAzDatadogMonitorSetPasswordLink_RefreshViaIdentity() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -394,12 +445,12 @@ public UpdateAzDatadogMonitorSetPasswordLink_RefreshViaIdentity() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -411,8 +462,26 @@ public UpdateAzDatadogMonitorSetPasswordLink_RefreshViaIdentity() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogSetPasswordLink - WriteObject((await response).SetPasswordLink); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSetPasswordLink + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateExpanded.cs index 24e5a866243e..f45740f5107d 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateExpanded.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; - /// Update a monitor resource. + /// update a monitor resource. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDatadogMonitor_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Update a monitor resource.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"update a monitor resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", ApiVersion = "2021-03-01")] public partial class UpdateAzDatadogMonitor_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,13 +33,25 @@ public partial class UpdateAzDatadogMonitor_UpdateExpanded : global::System.Mana private string __processRecordId; /// The parameters for a PATCH request to a monitor resource. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParameters _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceUpdateParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceUpdateParameters(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] @@ -47,6 +62,9 @@ public partial class UpdateAzDatadogMonitor_UpdateExpanded : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -60,6 +78,9 @@ public partial class UpdateAzDatadogMonitor_UpdateExpanded : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -91,9 +112,9 @@ public partial class UpdateAzDatadogMonitor_UpdateExpanded : global::System.Mana ReadOnly = false, Description = @"Flag specifying if the resource monitoring is enabled or disabled.", SerializedName = @"monitoringStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus))] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus MonitoringStatus { get => _body.MonitoringStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus)""); set => _body.MonitoringStatus = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string MonitoringStatus { get => _body.MonitoringStatus ?? null; set => _body.MonitoringStatus = value; } /// Backing field for property. private string _name; @@ -121,7 +142,7 @@ public partial class UpdateAzDatadogMonitor_UpdateExpanded : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -178,7 +199,8 @@ public partial class UpdateAzDatadogMonitor_UpdateExpanded : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -191,32 +213,32 @@ public partial class UpdateAzDatadogMonitor_UpdateExpanded : global::System.Mana ReadOnly = false, Description = @"The new tags of the monitor resource.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -263,6 +285,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.UpdateAzDatadogMonitor /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -327,11 +354,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -343,10 +395,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -414,7 +482,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -427,12 +495,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.MonitorsUpdate(SubscriptionId, ResourceGroupName, Name, _body, onOk, onDefault, this, Pipeline); + await this.Client.MonitorsUpdate(SubscriptionId, ResourceGroupName, Name, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -452,7 +520,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzDatadogMonitor_UpdateExpanded() { @@ -478,12 +546,12 @@ public UpdateAzDatadogMonitor_UpdateExpanded() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -500,15 +568,15 @@ public UpdateAzDatadogMonitor_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -518,12 +586,12 @@ public UpdateAzDatadogMonitor_UpdateExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -535,8 +603,26 @@ public UpdateAzDatadogMonitor_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateViaIdentityExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateViaIdentityExpanded.cs index e39bfe5d75b8..148c6d0c4dc8 100644 --- a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateViaIdentityExpanded.cs +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateViaIdentityExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; using System; - /// Update a monitor resource. + /// update a monitor resource. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDatadogMonitor_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Update a monitor resource.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"update a monitor resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", ApiVersion = "2021-03-01")] public partial class UpdateAzDatadogMonitor_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,13 +33,25 @@ public partial class UpdateAzDatadogMonitor_UpdateViaIdentityExpanded : global:: private string __processRecordId; /// The parameters for a PATCH request to a monitor resource. - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParameters _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.DatadogMonitorResourceUpdateParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParameters _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogMonitorResourceUpdateParameters(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] @@ -47,6 +62,9 @@ public partial class UpdateAzDatadogMonitor_UpdateViaIdentityExpanded : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; @@ -60,6 +78,9 @@ public partial class UpdateAzDatadogMonitor_UpdateViaIdentityExpanded : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -99,9 +120,9 @@ public partial class UpdateAzDatadogMonitor_UpdateViaIdentityExpanded : global:: ReadOnly = false, Description = @"Flag specifying if the resource monitoring is enabled or disabled.", SerializedName = @"monitoringStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus))] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus MonitoringStatus { get => _body.MonitoringStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support.MonitoringStatus)""); set => _body.MonitoringStatus = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string MonitoringStatus { get => _body.MonitoringStatus ?? null; set => _body.MonitoringStatus = value; } /// /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue @@ -114,7 +135,7 @@ public partial class UpdateAzDatadogMonitor_UpdateViaIdentityExpanded : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -152,32 +173,32 @@ public partial class UpdateAzDatadogMonitor_UpdateViaIdentityExpanded : global:: ReadOnly = false, Description = @"The new tags of the monitor resource.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResourceUpdateParametersTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResourceUpdateParametersTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -221,6 +242,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.UpdateAzDatadogMonitor /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -285,11 +311,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -301,10 +352,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -372,7 +439,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -387,7 +454,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.MonitorsUpdateViaIdentity(InputObject.Id, _body, onOk, onDefault, this, Pipeline); + await this.Client.MonitorsUpdateViaIdentity(InputObject.Id, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate); } else { @@ -404,13 +471,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.MonitorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.MonitorsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MonitorName ?? null, _body, onOk, onDefault, this, Pipeline); + await this.Client.MonitorsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MonitorName ?? null, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -430,7 +497,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzDatadogMonitor_UpdateViaIdentityExpanded() { @@ -456,12 +523,12 @@ public UpdateAzDatadogMonitor_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -478,15 +545,15 @@ public UpdateAzDatadogMonitor_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -496,12 +563,12 @@ public UpdateAzDatadogMonitor_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -513,8 +580,26 @@ public UpdateAzDatadogMonitor_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IDatadogMonitorResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateViaJsonFilePath.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..33324cfcc2f5 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateViaJsonFilePath.cs @@ -0,0 +1,607 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// update a monitor resource. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDatadogMonitor_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"update a monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", ApiVersion = "2021-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.NotSuggestDefaultParameterSet] + public partial class UpdateAzDatadogMonitor_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Monitor resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Monitor resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Monitor resource name", + SerializedName = @"monitorName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("MonitorName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzDatadogMonitor_UpdateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.UpdateAzDatadogMonitor_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzDatadogMonitor_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MonitorsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MonitorsUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzDatadogMonitor_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateViaJsonString.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateViaJsonString.cs new file mode 100644 index 000000000000..d2544bf5a458 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogMonitor_UpdateViaJsonString.cs @@ -0,0 +1,605 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// update a monitor resource. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDatadogMonitor_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"update a monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}", ApiVersion = "2021-03-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.NotSuggestDefaultParameterSet] + public partial class UpdateAzDatadogMonitor_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Monitor resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Monitor resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Monitor resource name", + SerializedName = @"monitorName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("MonitorName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzDatadogMonitor_UpdateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.UpdateAzDatadogMonitor_UpdateViaJsonString Clone() + { + var clone = new UpdateAzDatadogMonitor_UpdateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MonitorsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MonitorsUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzDatadogMonitor_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogMonitorResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogSingleSignOnConfiguration_UpdateExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogSingleSignOnConfiguration_UpdateExpanded.cs new file mode 100644 index 000000000000..5a43c719bdb8 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogSingleSignOnConfiguration_UpdateExpanded.cs @@ -0,0 +1,644 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// Configures single-sign-on for this resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDatadogSingleSignOnConfiguration_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Configures single-sign-on for this resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + public partial class UpdateAzDatadogSingleSignOnConfiguration_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResource(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The Id of the Enterprise App used for Single sign-on. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Id of the Enterprise App used for Single sign-on.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Id of the Enterprise App used for Single sign-on.", + SerializedName = @"enterpriseAppId", + PossibleTypes = new [] { typeof(string) })] + public string EnterpriseAppId { get => _body.EnterpriseAppId ?? null; set => _body.EnterpriseAppId = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _monitorName; + + /// Monitor resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Monitor resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Monitor resource name", + SerializedName = @"monitorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string MonitorName { get => this._monitorName; set => this._monitorName = value; } + + /// Backing field for property. + private string _name; + + /// Configuration name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Configuration name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Configuration name", + SerializedName = @"configurationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Various states of the SSO resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Various states of the SSO resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Various states of the SSO resource", + SerializedName = @"singleSignOnState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Initial", "Enable", "Disable", "Existing")] + public string SingleSignOnState { get => _body.SingleSignOnState ?? null; set => _body.SingleSignOnState = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzDatadogSingleSignOnConfiguration_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.UpdateAzDatadogSingleSignOnConfiguration_UpdateExpanded Clone() + { + var clone = new UpdateAzDatadogSingleSignOnConfiguration_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._body = this._body; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.MonitorName = this.MonitorName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SingleSignOnConfigurationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _body = await this.Client.SingleSignOnConfigurationsGetWithResult(SubscriptionId, ResourceGroupName, MonitorName, Name, this, Pipeline); + this.Update_body(); + await this.Client.SingleSignOnConfigurationsCreateOrUpdate(SubscriptionId, ResourceGroupName, MonitorName, Name, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate); + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzDatadogSingleSignOnConfiguration_UpdateExpanded() + { + + } + + private void Update_body() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnState"))) + { + this.SingleSignOnState = (string)(this.MyInvocation?.BoundParameters["SingleSignOnState"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("EnterpriseAppId"))) + { + this.EnterpriseAppId = (string)(this.MyInvocation?.BoundParameters["EnterpriseAppId"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..19aa998d6b39 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityExpanded.cs @@ -0,0 +1,616 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// Configures single-sign-on for this resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDatadogSingleSignOnConfiguration_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Configures single-sign-on for this resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + public partial class UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResource(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The Id of the Enterprise App used for Single sign-on. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Id of the Enterprise App used for Single sign-on.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Id of the Enterprise App used for Single sign-on.", + SerializedName = @"enterpriseAppId", + PossibleTypes = new [] { typeof(string) })] + public string EnterpriseAppId { get => _body.EnterpriseAppId ?? null; set => _body.EnterpriseAppId = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Various states of the SSO resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Various states of the SSO resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Various states of the SSO resource", + SerializedName = @"singleSignOnState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Initial", "Enable", "Disable", "Existing")] + public string SingleSignOnState { get => _body.SingleSignOnState ?? null; set => _body.SingleSignOnState = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._body = this._body; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SingleSignOnConfigurationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _body = await this.Client.SingleSignOnConfigurationsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_body(); + await this.Client.SingleSignOnConfigurationsCreateOrUpdateViaIdentity(InputObject.Id, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.MonitorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.MonitorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ConfigurationName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ConfigurationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _body = await this.Client.SingleSignOnConfigurationsGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MonitorName ?? null, InputObject.ConfigurationName ?? null, this, Pipeline); + this.Update_body(); + await this.Client.SingleSignOnConfigurationsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MonitorName ?? null, InputObject.ConfigurationName ?? null, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityExpanded() + { + + } + + private void Update_body() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnState"))) + { + this.SingleSignOnState = (string)(this.MyInvocation?.BoundParameters["SingleSignOnState"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("EnterpriseAppId"))) + { + this.EnterpriseAppId = (string)(this.MyInvocation?.BoundParameters["EnterpriseAppId"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityMonitorExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityMonitorExpanded.cs new file mode 100644 index 000000000000..87caf38c0dcf --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityMonitorExpanded.cs @@ -0,0 +1,628 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// Configures single-sign-on for this resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDatadogSingleSignOnConfiguration_UpdateViaIdentityMonitorExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"Configures single-sign-on for this resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + public partial class UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityMonitorExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.DatadogSingleSignOnResource(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The Id of the Enterprise App used for Single sign-on. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Id of the Enterprise App used for Single sign-on.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Id of the Enterprise App used for Single sign-on.", + SerializedName = @"enterpriseAppId", + PossibleTypes = new [] { typeof(string) })] + public string EnterpriseAppId { get => _body.EnterpriseAppId ?? null; set => _body.EnterpriseAppId = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity _monitorInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity MonitorInputObject { get => this._monitorInputObject; set => this._monitorInputObject = value; } + + /// Backing field for property. + private string _name; + + /// Configuration name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Configuration name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Configuration name", + SerializedName = @"configurationName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Various states of the SSO resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Various states of the SSO resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Various states of the SSO resource", + SerializedName = @"singleSignOnState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.PSArgumentCompleterAttribute("Initial", "Enable", "Disable", "Existing")] + public string SingleSignOnState { get => _body.SingleSignOnState ?? null; set => _body.SingleSignOnState = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityMonitorExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets.UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityMonitorExpanded Clone() + { + var clone = new UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityMonitorExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._body = this._body; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SingleSignOnConfigurationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (MonitorInputObject?.Id != null) + { + this.MonitorInputObject.Id += $"/singleSignOnConfigurations/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + _body = await this.Client.SingleSignOnConfigurationsGetViaIdentityWithResult(MonitorInputObject.Id, this, Pipeline); + this.Update_body(); + await this.Client.SingleSignOnConfigurationsCreateOrUpdateViaIdentity(MonitorInputObject.Id, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == MonitorInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + if (null == MonitorInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + if (null == MonitorInputObject.MonitorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.MonitorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + _body = await this.Client.SingleSignOnConfigurationsGetWithResult(MonitorInputObject.SubscriptionId ?? null, MonitorInputObject.ResourceGroupName ?? null, MonitorInputObject.MonitorName ?? null, Name, this, Pipeline); + this.Update_body(); + await this.Client.SingleSignOnConfigurationsCreateOrUpdate(MonitorInputObject.SubscriptionId ?? null, MonitorInputObject.ResourceGroupName ?? null, MonitorInputObject.MonitorName ?? null, Name, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzDatadogSingleSignOnConfiguration_UpdateViaIdentityMonitorExpanded() + { + + } + + private void Update_body() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SingleSignOnState"))) + { + this.SingleSignOnState = (string)(this.MyInvocation?.BoundParameters["SingleSignOnState"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("EnterpriseAppId"))) + { + this.EnterpriseAppId = (string)(this.MyInvocation?.BoundParameters["EnterpriseAppId"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogSingleSignOnResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogTagRule_UpdateExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogTagRule_UpdateExpanded.cs new file mode 100644 index 000000000000..16f71ae812b1 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogTagRule_UpdateExpanded.cs @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// update a tag rule set for a given monitor resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDatadogTagRule_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"update a tag rule set for a given monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + public partial class UpdateAzDatadogTagRule_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// Capture logs and metrics of Azure resources based on ARM tags. + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRules(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, + /// all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available + /// resources. If Include actions are specified, the rules will only include resources with the associated tags. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", + SerializedName = @"filteringTags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[] LogRuleFilteringTag { get => _body.LogRuleFilteringTag?.ToArray() ?? null /* fixedArrayOf */; set => _body.LogRuleFilteringTag = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Flag specifying if AAD logs should be sent for the Monitor resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if AAD logs should be sent for the Monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag specifying if AAD logs should be sent for the Monitor resource.", + SerializedName = @"sendAadLogs", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter LogRuleSendAadLog { get => _body.LogRuleSendAadLog ?? default(global::System.Management.Automation.SwitchParameter); set => _body.LogRuleSendAadLog = value; } + + /// Flag specifying if Azure resource logs should be sent for the Monitor resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if Azure resource logs should be sent for the Monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag specifying if Azure resource logs should be sent for the Monitor resource.", + SerializedName = @"sendResourceLogs", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter LogRuleSendResourceLog { get => _body.LogRuleSendResourceLog ?? default(global::System.Management.Automation.SwitchParameter); set => _body.LogRuleSendResourceLog = value; } + + /// + /// Flag specifying if Azure subscription logs should be sent for the Monitor resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if Azure subscription logs should be sent for the Monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag specifying if Azure subscription logs should be sent for the Monitor resource.", + SerializedName = @"sendSubscriptionLogs", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter LogRuleSendSubscriptionLog { get => _body.LogRuleSendSubscriptionLog ?? default(global::System.Management.Automation.SwitchParameter); set => _body.LogRuleSendSubscriptionLog = value; } + + /// + /// List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action + /// is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules + /// will only include resources with the associated tags. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", + SerializedName = @"filteringTags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[] MetricRuleFilteringTag { get => _body.MetricRuleFilteringTag?.ToArray() ?? null /* fixedArrayOf */; set => _body.MetricRuleFilteringTag = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _monitorName; + + /// Monitor resource name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Monitor resource name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Monitor resource name", + SerializedName = @"monitorName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string MonitorName { get => this._monitorName; set => this._monitorName = value; } + + /// Backing field for property. + private string _name; + + /// Rule set name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Rule set name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Rule set name", + SerializedName = @"ruleSetName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TagRulesCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _body = await this.Client.TagRulesGetWithResult(SubscriptionId, ResourceGroupName, MonitorName, Name, this, Pipeline); + this.Update_body(); + await this.Client.TagRulesCreateOrUpdate(SubscriptionId, ResourceGroupName, MonitorName, Name, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate); + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,MonitorName=MonitorName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzDatadogTagRule_UpdateExpanded() + { + + } + + private void Update_body() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LogRuleFilteringTag"))) + { + this.LogRuleFilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[])(this.MyInvocation?.BoundParameters["LogRuleFilteringTag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MetricRuleFilteringTag"))) + { + this.MetricRuleFilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[])(this.MyInvocation?.BoundParameters["MetricRuleFilteringTag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LogRuleSendAadLog"))) + { + this.LogRuleSendAadLog = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["LogRuleSendAadLog"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LogRuleSendSubscriptionLog"))) + { + this.LogRuleSendSubscriptionLog = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["LogRuleSendSubscriptionLog"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LogRuleSendResourceLog"))) + { + this.LogRuleSendResourceLog = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["LogRuleSendResourceLog"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogTagRule_UpdateViaIdentityExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogTagRule_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..9c54922ee0df --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogTagRule_UpdateViaIdentityExpanded.cs @@ -0,0 +1,590 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// update a tag rule set for a given monitor resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDatadogTagRule_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"update a tag rule set for a given monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + public partial class UpdateAzDatadogTagRule_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// Capture logs and metrics of Azure resources based on ARM tags. + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRules(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, + /// all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available + /// resources. If Include actions are specified, the rules will only include resources with the associated tags. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", + SerializedName = @"filteringTags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[] LogRuleFilteringTag { get => _body.LogRuleFilteringTag?.ToArray() ?? null /* fixedArrayOf */; set => _body.LogRuleFilteringTag = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Flag specifying if AAD logs should be sent for the Monitor resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if AAD logs should be sent for the Monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag specifying if AAD logs should be sent for the Monitor resource.", + SerializedName = @"sendAadLogs", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter LogRuleSendAadLog { get => _body.LogRuleSendAadLog ?? default(global::System.Management.Automation.SwitchParameter); set => _body.LogRuleSendAadLog = value; } + + /// Flag specifying if Azure resource logs should be sent for the Monitor resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if Azure resource logs should be sent for the Monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag specifying if Azure resource logs should be sent for the Monitor resource.", + SerializedName = @"sendResourceLogs", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter LogRuleSendResourceLog { get => _body.LogRuleSendResourceLog ?? default(global::System.Management.Automation.SwitchParameter); set => _body.LogRuleSendResourceLog = value; } + + /// + /// Flag specifying if Azure subscription logs should be sent for the Monitor resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if Azure subscription logs should be sent for the Monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag specifying if Azure subscription logs should be sent for the Monitor resource.", + SerializedName = @"sendSubscriptionLogs", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter LogRuleSendSubscriptionLog { get => _body.LogRuleSendSubscriptionLog ?? default(global::System.Management.Automation.SwitchParameter); set => _body.LogRuleSendSubscriptionLog = value; } + + /// + /// List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action + /// is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules + /// will only include resources with the associated tags. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", + SerializedName = @"filteringTags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[] MetricRuleFilteringTag { get => _body.MetricRuleFilteringTag?.ToArray() ?? null /* fixedArrayOf */; set => _body.MetricRuleFilteringTag = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TagRulesCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _body = await this.Client.TagRulesGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_body(); + await this.Client.TagRulesCreateOrUpdateViaIdentity(InputObject.Id, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.MonitorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.MonitorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.RuleSetName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RuleSetName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _body = await this.Client.TagRulesGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MonitorName ?? null, InputObject.RuleSetName ?? null, this, Pipeline); + this.Update_body(); + await this.Client.TagRulesCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MonitorName ?? null, InputObject.RuleSetName ?? null, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzDatadogTagRule_UpdateViaIdentityExpanded() + { + + } + + private void Update_body() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LogRuleFilteringTag"))) + { + this.LogRuleFilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[])(this.MyInvocation?.BoundParameters["LogRuleFilteringTag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MetricRuleFilteringTag"))) + { + this.MetricRuleFilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[])(this.MyInvocation?.BoundParameters["MetricRuleFilteringTag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LogRuleSendAadLog"))) + { + this.LogRuleSendAadLog = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["LogRuleSendAadLog"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LogRuleSendSubscriptionLog"))) + { + this.LogRuleSendSubscriptionLog = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["LogRuleSendSubscriptionLog"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LogRuleSendResourceLog"))) + { + this.LogRuleSendResourceLog = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["LogRuleSendResourceLog"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogTagRule_UpdateViaIdentityMonitorExpanded.cs b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogTagRule_UpdateViaIdentityMonitorExpanded.cs new file mode 100644 index 000000000000..7e2de7e0debd --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/cmdlets/UpdateAzDatadogTagRule_UpdateViaIdentityMonitorExpanded.cs @@ -0,0 +1,601 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets; + using System; + + /// update a tag rule set for a given monitor resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDatadogTagRule_UpdateViaIdentityMonitorExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Description(@"update a tag rule set for a given monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Generated] + public partial class UpdateAzDatadogTagRule_UpdateViaIdentityMonitorExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// Capture logs and metrics of Azure resources based on ARM tags. + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules _body = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.MonitoringTagRules(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, + /// all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available + /// resources. If Include actions are specified, the rules will only include resources with the associated tags. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", + SerializedName = @"filteringTags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[] LogRuleFilteringTag { get => _body.LogRuleFilteringTag?.ToArray() ?? null /* fixedArrayOf */; set => _body.LogRuleFilteringTag = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Flag specifying if AAD logs should be sent for the Monitor resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if AAD logs should be sent for the Monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag specifying if AAD logs should be sent for the Monitor resource.", + SerializedName = @"sendAadLogs", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter LogRuleSendAadLog { get => _body.LogRuleSendAadLog ?? default(global::System.Management.Automation.SwitchParameter); set => _body.LogRuleSendAadLog = value; } + + /// Flag specifying if Azure resource logs should be sent for the Monitor resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if Azure resource logs should be sent for the Monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag specifying if Azure resource logs should be sent for the Monitor resource.", + SerializedName = @"sendResourceLogs", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter LogRuleSendResourceLog { get => _body.LogRuleSendResourceLog ?? default(global::System.Management.Automation.SwitchParameter); set => _body.LogRuleSendResourceLog = value; } + + /// + /// Flag specifying if Azure subscription logs should be sent for the Monitor resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Flag specifying if Azure subscription logs should be sent for the Monitor resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Flag specifying if Azure subscription logs should be sent for the Monitor resource.", + SerializedName = @"sendSubscriptionLogs", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter LogRuleSendSubscriptionLog { get => _body.LogRuleSendSubscriptionLog ?? default(global::System.Management.Automation.SwitchParameter); set => _body.LogRuleSendSubscriptionLog = value; } + + /// + /// List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action + /// is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules + /// will only include resources with the associated tags. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.", + SerializedName = @"filteringTags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag) })] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[] MetricRuleFilteringTag { get => _body.MetricRuleFilteringTag?.ToArray() ?? null /* fixedArrayOf */; set => _body.MetricRuleFilteringTag = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity _monitorInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IDatadogIdentity MonitorInputObject { get => this._monitorInputObject; set => this._monitorInputObject = value; } + + /// Backing field for property. + private string _name; + + /// Rule set name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Rule set name")] + [Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Rule set name", + SerializedName = @"ruleSetName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Datadog.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TagRulesCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (MonitorInputObject?.Id != null) + { + this.MonitorInputObject.Id += $"/tagRules/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + _body = await this.Client.TagRulesGetViaIdentityWithResult(MonitorInputObject.Id, this, Pipeline); + this.Update_body(); + await this.Client.TagRulesCreateOrUpdateViaIdentity(MonitorInputObject.Id, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == MonitorInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + if (null == MonitorInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + if (null == MonitorInputObject.MonitorName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MonitorInputObject has null value for MonitorInputObject.MonitorName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MonitorInputObject) ); + } + _body = await this.Client.TagRulesGetWithResult(MonitorInputObject.SubscriptionId ?? null, MonitorInputObject.ResourceGroupName ?? null, MonitorInputObject.MonitorName ?? null, Name, this, Pipeline); + this.Update_body(); + await this.Client.TagRulesCreateOrUpdate(MonitorInputObject.SubscriptionId ?? null, MonitorInputObject.ResourceGroupName ?? null, MonitorInputObject.MonitorName ?? null, Name, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzDatadogTagRule_UpdateViaIdentityMonitorExpanded() + { + + } + + private void Update_body() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LogRuleFilteringTag"))) + { + this.LogRuleFilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[])(this.MyInvocation?.BoundParameters["LogRuleFilteringTag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MetricRuleFilteringTag"))) + { + this.MetricRuleFilteringTag = (Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IFilteringTag[])(this.MyInvocation?.BoundParameters["MetricRuleFilteringTag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LogRuleSendAadLog"))) + { + this.LogRuleSendAadLog = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["LogRuleSendAadLog"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LogRuleSendSubscriptionLog"))) + { + this.LogRuleSendSubscriptionLog = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["LogRuleSendSubscriptionLog"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LogRuleSendResourceLog"))) + { + this.LogRuleSendResourceLog = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["LogRuleSendResourceLog"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IMonitoringTagRules + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..32b70c56b5a0 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog +{ + using System; + using System.Collections.Generic; + using System.Text; + + [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] + public class ExternalDocsAttribute : Attribute + { + + public string Description { get; } + + public string Url { get; } + + public ExternalDocsAttribute(string url) + { + Url = url; + } + + public ExternalDocsAttribute(string url, string description) + { + Url = url; + Description = description; + } + } +} diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..a79d52e819a4 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs @@ -0,0 +1,52 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog +{ + public class PSArgumentCompleterAttribute : ArgumentCompleterAttribute + { + internal string[] ResourceTypes; + + public PSArgumentCompleterAttribute(params string[] argumentList) : base(CreateScriptBlock(argumentList)) + { + ResourceTypes = argumentList; + } + + public static ScriptBlock CreateScriptBlock(string[] resourceTypes) + { + List outputResourceTypes = new List(); + foreach (string resourceType in resourceTypes) + { + if (resourceType.Contains(" ")) + { + outputResourceTypes.Add("\'\'" + resourceType + "\'\'"); + } + else + { + outputResourceTypes.Add(resourceType); + } + } + string scriptResourceTypeList = "'" + String.Join("' , '", outputResourceTypes) + "'"; + string script = "param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)\n" + + String.Format("$values = {0}\n", scriptResourceTypeList) + + "$values | Where-Object { $_ -Like \"$wordToComplete*\" -or $_ -Like \"'$wordToComplete*\" } | Sort-Object | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) }"; + ScriptBlock scriptBlock = ScriptBlock.Create(script); + return scriptBlock; + } + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 280258ff3430..2126db75cd93 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -20,11 +20,13 @@ public class ExportFormatPs1xml : PSCmdlet public string FilePath { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; private const string PropertiesExcludedForTableview = @"Id,Type"; private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private static string SelectedBySuffix = @"#Multiple"; + protected override void ProcessRecord() { try @@ -76,7 +78,7 @@ private static View CreateViewModel(ViewParameters viewParameters) Name = viewParameters.Type.FullName, ViewSelectedBy = new ViewSelectedBy { - TypeName = viewParameters.Type.FullName + TypeName = string.Concat(viewParameters.Type.FullName, SelectedBySuffix) }, TableControl = new TableControl { diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index 8e0f97c6abd8..149ecf17aae2 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs @@ -24,7 +24,7 @@ public class ExportModelSurface : PSCmdlet public bool UseExpandedFormat { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Datadog.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index ec6dee2055e6..5248d95651b9 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -70,9 +70,8 @@ protected override void ProcessRecord() var variantGroups = profileGroups.SelectMany(pg => pg.Variants .GroupBy(v => new { v.CmdletName, v.IsInternal }) .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), - Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) + Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) .ToArray(); - var license = new StringBuilder(); license.Append(@" # ---------------------------------------------------------------------------------- @@ -114,6 +113,7 @@ protected override void ProcessRecord() sb.Append("param("); sb.Append($"{(parameterGroups.Any() ? Environment.NewLine : String.Empty)}"); + foreach (var parameterGroup in parameterGroups) { var parameters = parameterGroup.HasAllVariants ? parameterGroup.Parameters.Take(1) : parameterGroup.Parameters; diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 471b15999655..8b86cd1f58be 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -137,7 +137,7 @@ protected override void ProcessRecord() } else { - var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().ToPsList(); sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); } @@ -148,8 +148,10 @@ protected override void ProcessRecord() } else { - var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); - sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().ToPsList(); + if (!String.IsNullOrEmpty(aliasesList)) { + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } } // CmdletsToExport diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index 5ca268b38f64..324a174205f5 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell { - [Cmdlet(VerbsData.Export, "TestStub")] - [DoNotExport] - public class ExportTestStub : PSCmdlet - { - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ModuleName { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ExportsFolder { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string OutputFolder { get; set; } - - [Parameter] - public SwitchParameter IncludeGenerated { get; set; } - - protected override void ProcessRecord() + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet { - try - { - if (!Directory.Exists(ExportsFolder)) - { - throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); - } + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } - var exportDirectories = Directory.GetDirectories(ExportsFolder); - if (!exportDirectories.Any()) - { - exportDirectories = new[] { ExportsFolder }; - } - var utilFile = Path.Combine(OutputFolder, "utils.ps1"); - if (!File.Exists(utilFile)) + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() { - var sc = new StringBuilder(); - sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + /*var loadEnvFile = Path.Combine(OutputFolder, "loadEnv.ps1"); + if (!File.Exists(loadEnvFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@" +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json +}"); + File.WriteAllText(loadEnvFile, sc.ToString()); + }*/ + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { if ($allChars) { return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) } else { return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) } } +function Start-TestSleep { + [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')] + param( + [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')] + [ValidateRange(0.0, 2147483.0)] + [double] $Seconds, + + [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')] + [ValidateRange('NonNegative')] + [Alias('ms')] + [int] $Milliseconds + ) + + if ($TestMode -ne 'playback') { + switch ($PSCmdlet.ParameterSetName) { + 'SleepBySeconds' { + Start-Sleep -Seconds $Seconds + } + 'SleepByMilliseconds' { + Start-Sleep -Milliseconds $Milliseconds + } + } + } +} + $env = @{} if ($UsePreviousConfigForRecord) { $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json @@ -80,37 +126,40 @@ function cleanupEnv() { # Clean resources you create for testing } "); - File.WriteAllText(utilFile, sc.ToString()); - } - foreach (var exportDirectory in exportDirectories) - { - var outputFolder = OutputFolder; - if (exportDirectory != ExportsFolder) - { - outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); - Directory.CreateDirectory(outputFolder); - } - - var variantGroups = GetScriptCmdlets(exportDirectory) - .SelectMany(fi => fi.ToVariants()) - .Where(v => !v.IsDoNotExport) - .GroupBy(v => v.CmdletName) - .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) - .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); - - foreach (var variantGroup in variantGroups) - { - var sb = new StringBuilder(); - sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); - sb.AppendLine(@"{ + File.WriteAllText(utilFile, sc.ToString()); + } + + + + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath)" -); - sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); - sb.AppendLine(@" $currentPath = $PSScriptRoot + ); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File $currentPath = Split-Path -Path $currentPath -Parent @@ -120,29 +169,29 @@ function cleanupEnv() { "); - sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); - var variants = variantGroup.Variants - .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) - .ToList(); + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); - foreach (var variant in variants) + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) { - sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); - sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); - var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; - sb.AppendLine($"{Indent}}}{variantSeparator}"); + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; } - sb.AppendLine("}"); - - File.WriteAllText(variantGroup.FilePath, sb.ToString()); - } } - } - catch (Exception ee) - { - Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); - throw ee; - } } - } } diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 7f7e2830be6f..34edb5fa63a1 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -94,7 +94,7 @@ public static void WriteMarkdowns(IEnumerable variantGroups, PsMod sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); foreach (var relatedLink in markdownInfo.RelatedLinks) { - sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"[{relatedLink}]({relatedLink}){Environment.NewLine}{Environment.NewLine}"); } File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 305245530475..df1925c2361f 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -31,7 +31,7 @@ internal class MarkdownHelpInfo public string[] Inputs { get; } public string[] Outputs { get; } public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } - public string[] RelatedLinks { get; } + public MarkdownRelatedLinkInfo[] RelatedLinks { get; } public bool SupportsShouldProcess { get; } public bool SupportsPaging { get; } @@ -67,7 +67,11 @@ public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; OnlineVersion = commentInfo.OnlineVersion; - RelatedLinks = commentInfo.RelatedLinks; + + var relatedLinkLists = new List(); + relatedLinkLists.AddRange(commentInfo.RelatedLinks?.Select(link => new MarkdownRelatedLinkInfo(link))); + relatedLinkLists.AddRange(variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Distinct()?.Select(link => new MarkdownRelatedLinkInfo(link.Url, link.Description))); + RelatedLinks = relatedLinkLists?.ToArray(); SupportsShouldProcess = variantGroup.SupportsShouldProcess; SupportsPaging = variantGroup.SupportsPaging; @@ -218,14 +222,45 @@ public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, Param } } + internal class MarkdownRelatedLinkInfo + { + public string Url { get; } + public string Description { get; } + + public MarkdownRelatedLinkInfo(string url) + { + Url = url; + } + + public MarkdownRelatedLinkInfo(string url, string description) + { + Url = url; + Description = description; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(Description)) + { + return Url; + } + else + { + return $@"[{Description}]({Url})"; + + } + + } + } + internal static class MarkdownTypesExtensions { public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks); public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos = { - new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), - new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), }; public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index ae445b2c9229..63e7da8797b6 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -121,6 +121,21 @@ public override string ToString() => CompleterInfo != null : String.Empty; } + internal class PSArgumentCompleterOutput : ArgumentCompleterOutput + { + public PSArgumentCompleterInfo PSArgumentCompleterInfo { get; } + + public PSArgumentCompleterOutput(PSArgumentCompleterInfo completerInfo) : base(completerInfo) + { + PSArgumentCompleterInfo = completerInfo; + } + + + public override string ToString() => PSArgumentCompleterInfo != null + ? $"{Indent}[{typeof(PSArgumentCompleterAttribute)}({(PSArgumentCompleterInfo.IsTypeCompleter ? $"[{PSArgumentCompleterInfo.Type.Unwrap().ToPsType()}]" : $"{PSArgumentCompleterInfo.ResourceTypes?.Select(r => $"\"{r}\"")?.JoinIgnoreEmpty(", ")}")})]{Environment.NewLine}" + : String.Empty; + } + internal class DefaultInfoOutput { public bool HasDefaultInfo { get; } @@ -173,6 +188,7 @@ internal class BaseOutput public VariantGroup VariantGroup { get; } protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; @@ -200,6 +216,21 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetLoginVerification() + { + if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + { + return $@" +{Indent}{Indent}$context = Get-AzContext +{Indent}{Indent}if (-not $context -and -not $testPlayback) {{ +{Indent}{Indent}{Indent}Write-Error ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}{Indent}exit +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +263,16 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName -{GetTelemetry()} +{Indent}{Indent} +{Indent}{Indent}$testPlayback = $false +{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }} +{GetLoginVerification()}{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}if ($wrappedCmd -eq $null) {{ +{Indent}{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) +{Indent}{Indent}}} {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) @@ -269,13 +306,16 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to //override default value set in required readme if ("SubscriptionId".Equals(parameterName)) { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); @@ -285,13 +325,15 @@ private string GetDefaultValuesStatements() } else { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); sb.Append($"{Indent}{Indent}}}"); } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -381,6 +423,8 @@ public override string ToString() var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var externalUrls = String.Join(Environment.NewLine, CommentInfo.ExternalUrls.Select(l => $".Link{Environment.NewLine}{l}")); + var externalUrlsText = !String.IsNullOrEmpty(externalUrls) ? $"{Environment.NewLine}{externalUrls}" : String.Empty; var examples = ""; foreach (var example in VariantGroup.HelpInfo.Examples) { @@ -393,7 +437,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +631,9 @@ public static string ToSyntaxTypeName(this Type type) public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); - public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => (completerInfo is PSArgumentCompleterInfo psArgumentCompleterInfo) ? psArgumentCompleterInfo.ToArgumentCompleterOutput() : new ArgumentCompleterOutput(completerInfo); + + public static PSArgumentCompleterOutput ToArgumentCompleterOutput(this PSArgumentCompleterInfo completerInfo) => new PSArgumentCompleterOutput(completerInfo); public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 491e4a44625f..eb26fa2a1dbc 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"";} + public string RootModuleName { get => @""; } public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -49,7 +49,7 @@ internal class VariantGroup public PsHelpInfo HelpInfo { get; } public bool IsGenerated { get; } public bool IsInternal { get; } - + public bool IsModelCmdlet { get; } public string OutputFolder { get; } public string FileName { get; } public string FilePath { get; } @@ -84,7 +84,7 @@ public VariantGroup(string moduleName, string cmdletName, Variant[] variants, st HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); IsInternal = isInternal; - + IsModelCmdlet = Variants.All(v => v.IsModelCmdlet); OutputFolder = outputFolder; FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; FilePath = Path.Combine(OutputFolder, FileName); @@ -101,12 +101,23 @@ private string DetermineDefaultParameterSetName() if (String.IsNullOrEmpty(defaultParameterSet)) { var variantParamCountGroups = Variants + .Where(v => !v.IsNotSuggestDefaultParameterSet) .Select(v => ( variant: v.VariantName, paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) .GroupBy(vpc => vpc.isSimple) .ToArray(); + if (variantParamCountGroups.Length == 0) + { + variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + } var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; @@ -134,7 +145,9 @@ internal class Variant public Parameter[] Parameters { get; } public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { get; } + public bool IsModelCmdlet { get; } public bool IsDoNotExport { get; } + public bool IsNotSuggestDefaultParameterSet { get; } public string[] Profiles { get; } public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) @@ -155,6 +168,8 @@ public Variant(string cmdletName, string variantName, CommandInfo info, CommandM Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); IsInternal = Attributes.OfType().Any(); IsDoNotExport = Attributes.OfType().Any(); + IsModelCmdlet = Attributes.OfType().Any(); + IsNotSuggestDefaultParameterSet = Attributes.OfType().Any(); CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); } @@ -210,6 +225,7 @@ public ParameterGroup(string parameterName, Parameter[] parameters, string[] all HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.PSArgumentCompleterAttribute).FirstOrDefault()?.ToPSArgumentCompleterInfo() ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); @@ -244,7 +260,6 @@ internal class Parameter public ParameterMetadata Metadata { get; } public PsParameterHelpInfo HelpInfo { get; } public Type ParameterType { get; } - public Attribute[] Attributes { get; } public ParameterCategory[] Categories { get; } public ParameterCategory OrderCategory { get; } @@ -254,6 +269,7 @@ internal class Parameter public bool SupportsWildcards { get; } public CompleterInfoAttribute CompleterInfoAttribute { get; } public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + public PSArgumentCompleterAttribute PSArgumentCompleterAttribute { get; } public bool ValueFromPipeline { get; } public bool ValueFromPipelineByPropertyName { get; } @@ -286,7 +302,8 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met } SupportsWildcards = Attributes.OfType().Any(); CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); - ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + PSArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(attr => !attr.GetType().Equals(typeof(PSArgumentCompleterAttribute))); ValueFromPipeline = ParameterAttribute.ValueFromPipeline; ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; @@ -295,10 +312,10 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met IsMandatory = ParameterAttribute.Mandatory; var complexParameterName = ParameterName.ToUpperInvariant(); - var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var complexMessage = $"{Environment.NewLine}"; var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; // Remove the complex type message as it will be reinserted if this is a complex type - description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + description = description.NormalizeNewLines(); // Make an InfoAttribute for processing only if one isn't provided InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; // Set the description if the InfoAttribute does not have one since they are exported without a description @@ -318,7 +335,7 @@ internal class ComplexInterfaceInfo public bool Required { get; } public bool ReadOnly { get; } public string Description { get; } - + public ComplexInterfaceInfo[] NestedInfos { get; } public bool IsComplexInterface { get; } @@ -335,7 +352,7 @@ public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, var unwrappedType = Type.Unwrap(); var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); - NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[] { } : unwrappedType.GetInterfaces() .Concat(InfoAttribute.PossibleTypes) .SelectMany(pt => pt.GetProperties() @@ -366,6 +383,7 @@ internal class CommentInfo public string OnlineVersion { get; } public string[] RelatedLinks { get; } + public string[] ExternalUrls { get; } private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; @@ -391,6 +409,9 @@ public CommentInfo(VariantGroup variantGroup) var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + + // Get external urls from attribute + ExternalUrls = variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Select(e => e.Url)?.Distinct()?.ToArray(); } } @@ -420,11 +441,22 @@ public CompleterInfo(ArgumentCompleterAttribute completerAttribute) } } + internal class PSArgumentCompleterInfo : CompleterInfo + { + public string[] ResourceTypes { get; } + + public PSArgumentCompleterInfo(PSArgumentCompleterAttribute completerAttribute) : base(completerAttribute) + { + ResourceTypes = completerAttribute.ResourceTypes; + } + } + internal class DefaultInfo { public string Name { get; } public string Description { get; } public string Script { get; } + public string SetCondition { get; } public ParameterGroup ParameterGroup { get; } public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) @@ -432,6 +464,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -479,7 +512,8 @@ public static Parameter[] ToParameters(this Variant variant) parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); } var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); - if (variant.SupportsPaging) { + if (variant.SupportsPaging) + { // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; @@ -507,7 +541,7 @@ public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute inf public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); - + public static PSArgumentCompleterInfo ToPSArgumentCompleterInfo(this PSArgumentCompleterAttribute completerAttribute) => new PSArgumentCompleterInfo(completerAttribute); public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); } diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/PsAttributes.cs index b0451b03ab8d..673222f96ac0 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/PsAttributes.cs @@ -22,6 +22,11 @@ public class DoNotExportAttribute : Attribute { } + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class ModelCmdletAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Class)] public class InternalExportAttribute : Attribute { @@ -55,6 +60,11 @@ public class HttpPathAttribute : Attribute public string ApiVersion { get; set; } } + [AttributeUsage(AttributeTargets.Class)] + public class NotSuggestDefaultParameterSetAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public class CategoryAttribute : Attribute { @@ -109,6 +119,11 @@ public enum PropertyOrigin Inlined } + [AttributeUsage(AttributeTargets.Property)] + public class ConstantAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Property)] public class FormatTableAttribute : Attribute { diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/PsExtensions.cs index bd6f48f2e667..e70e688d7709 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PowerShell { internal static class PsExtensions { + public static PSObject AddMultipleTypeNameIntoPSObject(this object obj, string multipleTag = "#Multiple") + { + var psObj = new PSObject(obj); + psObj.TypeNames.Insert(0, $"{psObj.TypeNames[0]}{multipleTag}"); + return psObj; + } + // https://stackoverflow.com/a/863944/294804 // https://stackoverflow.com/a/4452598/294804 // https://stackoverflow.com/a/28701974/294804 diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/PsHelpers.cs index 6b022785b769..e530f5e79fef 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/BuildTime/PsHelpers.cs @@ -67,7 +67,7 @@ public static IEnumerable GetScriptHelpInfo(params string[] modulePath public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) { - var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => + var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => $@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})" )); return (cmdlet?.RunScript(getCmdletAndHelp) ?? RunScript(getCmdletAndHelp)) @@ -88,7 +88,7 @@ public static Guid ReadGuidFromPsd1(string psd1Path) if (File.Exists(psd1Path)) { var currentGuid = File.ReadAllLines(psd1Path) - .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault(l => l.TrimStart().StartsWith(GuidStart.TrimStart()))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) .LastOrDefault()?.Replace("'", String.Empty); guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; } diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/Context.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..cd2bb499a229 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/Context.cs @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime +{ + + using System; + using System.Linq; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData = System.Func; + using static Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Extensions; + + /// + /// The IContext Interface defines the communication mechanism for input customization. + /// + /// + /// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation. + /// + public interface IContext + { + System.Management.Automation.InvocationInfo InvocationInformation { get; set; } + System.Threading.CancellationTokenSource CancellationTokenSource { get; set; } + System.Collections.Generic.IDictionary ExtensibleParameters { get; } + HttpPipeline Pipeline { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Datadog.Datadog Client { get; } + } +} diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/Events.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/Events.cs index 59f419028201..36caee585e0f 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/Events.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/Events.cs @@ -22,6 +22,6 @@ public static partial class Events public const string FollowingNextLink = nameof(FollowingNextLink); public const string DelayBeforePolling = nameof(DelayBeforePolling); public const string Polling = nameof(Polling); - + public const string Progress = nameof(Progress); } -} \ No newline at end of file +} diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/ISendAsync.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/ISendAsync.cs index ffc384f870fa..43601c941b3a 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime using System.Threading.Tasks; using System.Collections; using System.Linq; + using System; + /// /// The interface for sending an HTTP request across the wire. @@ -70,6 +72,7 @@ public interface ISendAsyncTerminalFactory public partial class HttpPipeline : ISendAsync { + private const int DefaultMaxRetry = 3; private ISendAsync pipeline; private ISendAsyncTerminalFactory terminal; private List steps = new List(); @@ -92,6 +95,111 @@ public HttpPipeline(ISendAsyncTerminalFactory terminalStep) /// public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + private bool shouldRetry429(HttpResponseMessage response) + { + if (response.StatusCode == (System.Net.HttpStatusCode)429) + { + var retryAfter = response.Headers.RetryAfter; + if (retryAfter != null && retryAfter.Delta.HasValue) + { + return true; + } + } + return false; + } + /// + /// The step to handle 429 response with retry-after header. + /// + public async Task Retry429(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = int.MaxValue; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES_FOR_429")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES_FOR_429")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetry429(response) && count++ < retryCount) + { + request = await cloneRequest.CloneWithContent(); + var retryAfter = response.Headers.RetryAfter; + await Task.Delay(retryAfter.Delta.Value, callback.Token); + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code 429 after waiting {retryAfter.Delta.Value.TotalSeconds} seconds."); + response = await next.SendAsync(request, callback); + } + return response; + } + + private bool shouldRetryError(HttpResponseMessage response) + { + if (response.StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + if (response.StatusCode != System.Net.HttpStatusCode.NotImplemented && + response.StatusCode != System.Net.HttpStatusCode.HttpVersionNotSupported) + { + return true; + } + } + else if (response.StatusCode == System.Net.HttpStatusCode.RequestTimeout) + { + return true; + } + else if (response.StatusCode == (System.Net.HttpStatusCode)429 && response.Headers.RetryAfter == null) + { + return true; + } + return false; + } + + /// + /// Returns true if status code in HttpRequestExceptionWithStatus exception is greater + /// than or equal to 500 and not NotImplemented (501) or HttpVersionNotSupported (505). + /// Or it's 429 (TOO MANY REQUESTS) without Retry-After header. + /// + public async Task RetryError(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = DefaultMaxRetry; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetryError(response) && count++ < retryCount) + { + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code {response.StatusCode}"); + request = await cloneRequest.CloneWithContent(); + response = await next.SendAsync(request, callback); + } + return response; + } + public ISendAsyncTerminalFactory TerminalFactory { get => terminal; @@ -117,6 +225,11 @@ public ISendAsync Pipeline // create the pipeline from scratch. var next = terminal.Create(); + if (Convert.ToBoolean(@"true")) + { + next = (new SendAsyncFactory(Retry429)).Create(next) ?? next; + next = (new SendAsyncFactory(RetryError)).Create(next) ?? next; + } foreach (var factory in steps) { // skip factories that return null. diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/InfoAttribute.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/InfoAttribute.cs index 1e3ac27de4ea..508ef563210e 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/InfoAttribute.cs @@ -11,6 +11,9 @@ public class InfoAttribute : Attribute { public bool Required { get; set; } = false; public bool ReadOnly { get; set; } = false; + public bool Read { get; set; } = true; + public bool Create { get; set; } = true; + public bool Update { get; set; } = true; public Type[] PossibleTypes { get; set; } = new Type[0]; public string Description { get; set; } = ""; public string SerializedName { get; set; } = ""; @@ -30,5 +33,6 @@ public class DefaultInfoAttribute : Attribute public string Script { get; set; } = ""; public string Name { get; set; } = ""; public string Description { get; set; } = ""; + public string SetCondition { get; set; } = ""; } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/InputHandler.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..072c4ded6c21 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/InputHandler.cs @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.Cmdlets +{ + public abstract class InputHandler + { + protected InputHandler NextHandler = null; + + public void SetNextHandler(InputHandler nextHandler) + { + this.NextHandler = nextHandler; + } + + public abstract void Process(Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 2d2ce85298fb..4645733b5bad 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -21,6 +21,11 @@ internal XNodeArray(params JsonNode[] values) items = new List(values); } + internal XNodeArray(System.Collections.Generic.List values) + { + items = new List(values); + } + public override JsonNode this[int index] => items[index]; internal override JsonType? ElementType => null; diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/SerializationMode.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/SerializationMode.cs index a498845db584..8a8d92a8206d 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/SerializationMode.cs @@ -9,8 +9,10 @@ public enum SerializationMode { None = 0, IncludeHeaders = 1 << 0, - IncludeReadOnly = 1 << 1, - - IncludeAll = IncludeHeaders | IncludeReadOnly + IncludeRead = 1 << 1, + IncludeCreate = 1 << 2, + IncludeUpdate = 1 << 3, + IncludeAll = IncludeHeaders | IncludeRead | IncludeCreate | IncludeUpdate, + IncludeCreateOrUpdate = IncludeCreate | IncludeUpdate } } \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/Datadog/Datadog.Autorest/generated/runtime/TypeConverterExtensions.cs index bceaa5627b9d..48efba970995 100644 --- a/generated/Datadog/Datadog.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/Datadog/Datadog.Autorest/generated/runtime/TypeConverterExtensions.cs @@ -62,6 +62,56 @@ internal static T[] SelectToArray(object source, System.Func return result.ToArray(); } + internal static System.Collections.Generic.List SelectToList(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }.ToList(); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0].ToList(); // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result; + } internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) { if (null != dictionary) diff --git a/generated/Datadog/Datadog.Autorest/internal/Get-AzDatadogOperation.ps1 b/generated/Datadog/Datadog.Autorest/internal/Get-AzDatadogOperation.ps1 index e0a35ea7828f..0739ca5ffb74 100644 --- a/generated/Datadog/Datadog.Autorest/internal/Get-AzDatadogOperation.ps1 +++ b/generated/Datadog/Datadog.Autorest/internal/Get-AzDatadogOperation.ps1 @@ -25,12 +25,12 @@ List all operations provided by Microsoft.Datadog for the 2021-03-01 api version {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogoperation #> function Get-AzDatadogOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.Datadog.private\Get-AzDatadogOperation_List'; } $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/Datadog/Datadog.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/Datadog/Datadog.Autorest/internal/ProxyCmdletDefinitions.ps1 index e0a35ea7828f..0739ca5ffb74 100644 --- a/generated/Datadog/Datadog.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/Datadog/Datadog.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -25,12 +25,12 @@ List all operations provided by Microsoft.Datadog for the 2021-03-01 api version {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult +Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult .Link https://learn.microsoft.com/powershell/module/az.datadog/get-azdatadogoperation #> function Get-AzDatadogOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.Api20210301.IOperationResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Datadog.Models.IOperationResult])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Datadog.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.Datadog.private\Get-AzDatadogOperation_List'; } $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/Datadog/Datadog.Autorest/resources/README.md b/generated/Datadog/Datadog.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/generated/Datadog/Datadog.Autorest/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/generated/Datadog/Datadog.Autorest/test-module.ps1 b/generated/Datadog/Datadog.Autorest/test-module.ps1 index 831353837e4f..f9c1c3b0f119 100644 --- a/generated/Datadog/Datadog.Autorest/test-module.ps1 +++ b/generated/Datadog/Datadog.Autorest/test-module.ps1 @@ -12,17 +12,17 @@ # 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]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +param([switch]$NotIsolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) $ErrorActionPreference = 'Stop' -if(-not $Isolated) +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' if ($PSBoundParameters.ContainsKey("TestName")) { $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join "," } $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } @@ -34,7 +34,7 @@ if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and $ProgressPreference = 'SilentlyContinue' $baseName = $PSScriptRoot.BaseName $requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent)) -. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule +. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -NotIsolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule . ("$PSScriptRoot\test\utils.ps1") if ($requireResourceModule) @@ -95,4 +95,4 @@ try } } -Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file +Write-Host -ForegroundColor Green '-------------Done-------------'